I have this upstart script
When I run: sudo start poxa
it starts the process but when I run: initctl list
it shows me that is is stop/waiting
but when I check ps aux | grep poxa
it show the process.
And, as expected, when I try to stop it: sudo stop poxa
it returns: stop: unknown instance:
# Upstart Configuration
# put on /etc/init
description "Poxa"
author "Poxa"
start on (filesystem or runlevel [2345])
stop on runlevel [!2345]
#respawn
#respawn limit 10 5
umask 022
console none
pre-start script
test -x /home/ec2-user/poxa/rel/poxa/bin/poxa || { stop; exit 0; }
end script
pre-stop script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] Stoping..." >> /var/log/poxa.log 2>&1
end script
script
export HOME=/home/ec2-user
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] Starting..." >> /var/log/poxa.log 2>&1
exec /home/ec2-user/poxa/rel/poxa/bin/poxa start >> /var/log/poxa.log 2>&1
end script
ps aux | grep poxa
root 29032 0.0 0.1 13656 1720 ? S 11:42 0:00 /usr/local/lib/erlang/erts-7.0/bin/run_erl -daemon /home/ec2-user/poxa/rel/poxa/tmp/erl_pipes/poxa/ /home/ec2-user/poxa/rel/poxa/log exec "/home/ec2-user/poxa/rel/poxa/bin/poxa" "console"
root 29033 0.3 2.0 318992 21100 pts/1 Ssl+ 11:42 0:00 /usr/local/lib/erlang/erts-7.0/bin/beam -- -root /home/ec2-user/poxa/rel/poxa -progname home/ec2-user/poxa/rel/poxa/releases/0.4.3/poxa.sh -- -home /home/ec2-user -- -boot /home/ec2-user/poxa/rel/poxa/releases/0.4.3/poxa -boot_var ERTS_LIB_DIR /usr/local/lib/erlang/erts-7.0/../lib -config /home/ec2-user/poxa/rel/poxa/running-config/sys.config -pa /home/ec2-user/poxa/rel/poxa/lib/consolidated -name poxa@127.0.0.1 -setcookie
poxa -user Elixir.IEx.CLI -extra --no-halt +iex -- console
I have made this: http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count to get the fork count but it returns 44
!
ps aux | grep poxa
I can see the process running – Nov 27 '15 at 11:32sudo start poxa
but since it doesn't track the PID I can't stop it, upstart is considering it as astopped
job. Maybe forcing a PID? – Nov 27 '15 at 11:39poxa
process, as you can see it has two processes running – Nov 27 '15 at 11:45expect fork
command to my script ;) – Nov 27 '15 at 11:48expect fork
didn't fix the problem completely, it started the process and I could check that it was running withinitctl list
but I can't stop it, it hangs andinitctl list
shows a different PID number than the one showed withps aux
– Nov 30 '15 at 12:54expect daemon
, ref http://askubuntu.com/questions/89518/upstart-script-and-start-stop-daemon – user.dz Nov 30 '15 at 16:10start on runlevel [2345]
insteadstart on (filesystem or runlevel [2345])
??? – Marcos Silveira Nov 30 '15 at 23:05