I was trying to follow the tutorial here using upStart (Run php script as daemon process), but I ran into some snags when I get the error 'startserver: unrecognized service'
Here is some images to show what I tried
At the bottom of the console is where the errors are. I also show proof that my file is in /etc/init where it should be in the docker container. I logged in using docker exec -it draftandpermit_web_1 bash
Am I missing something?
Other Reference Data:
startserver.conf
# Info
description "Start Server"
author "Joseph Astrahan"
# Events
start on startup
stop on shutdown
# Automatically respawn
respawn
respawn limit 20 5
# Run the script!
# Note, in this example, if your PHP script returns
# the string "ERROR", the daemon will stop itself.
script
[ $(exec /usr/bin/php -f /var/www/callcenter/livesite/bin/startwebsocketserver.php) = 'ERROR' ] && ( stop; exit 1; )
end script
I activate it either manually as you saw in the images or using my convenience script
echo "Copying startserver.conf to /etc/init"
docker exec -it draftandpermit_web_1 bash -c "cd /app/docker; cp -f startserver.conf /etc/init/"
echo "Stopping & Starting the WebSocket & HTTP Server"
docker exec -it draftandpermit_web_1 bash -c "service startserver stop"
docker exec -it draftandpermit_web_1 bash -c "service startserver start"
Keep in mind paths are correct for where the file is since I manually went into the container to look at /etc/init as shown in the images.