axisys | ion: thanks | 00:06 |
---|---|---|
axisys | start foo says already running, status foo says killed and pid is 1234 | 00:34 |
axisys | how do I clean it up and try with expect daemon? | 00:34 |
axisys | exec foo.pl start within script .. end script | 00:35 |
axisys | ion: start on started mysql did the trick .. now need to fix the actual job :-) | 00:36 |
axisys | stop on shutdown probably broke it | 00:38 |
ion | axisys: https://github.com/ion1/workaround-upstart-snafu | 01:15 |
axisys | ion: sweet.. I will give that a try | 03:22 |
axisys | reboot starts the job (perl script) fine, but status shows different process id and stop jobname hangs | 03:32 |
axisys | http://pastie.org/private/vequdcuhb0ojvykrerjzha | 03:32 |
axisys | I guess I should try expect fork instead of expect daemon | 03:33 |
ion | Figure out what the exact forking behavior of the main program is and *if* one of the expect values matches, use it. Otherwise disable daemonizing altogether. Feel free to skip directly to the latter alternative. | 03:37 |
axisys | egrep "\<(fork|clone)\>\(" /tmp/strace.log | wc | awk '{print $1}' | 03:48 |
axisys | 17 | 03:48 |
axisys | all are clone, grep fork gets none | 03:49 |
axisys | ok, let me try the alternate method | 03:54 |
axisys | alternate method showing same behavior.. start and status gives wrong PID and then stop hangs with process killed showing wrong PID.. thanks for your workaround-upstart-snafu or I have to reboot again | 04:03 |
axisys | core part | 04:05 |
axisys | exec start-stop-daemon --start --exec /opt/rt4/local/plugins/RT-Extension-Nginx/sbin/rt-nginx-control start | 04:05 |
ion | Why not: exec /opt/rt4/local/plugins/RT-Extension-Nginx/sbin/rt-nginx-control start? | 04:13 |
ion | (Also, make sure *that* doesn’t daemonize) | 04:13 |
axisys | ion: thats how I started and then went with start-stop-daemon alternate | 04:23 |
axisys | /opt/rt4/local/plugins/RT-Extension-Nginx/sbin/rt-nginx-control start gives 17 clones per strace log | 04:23 |
axisys | ion: my orig paste | 04:24 |
axisys | ion: http://pastie.org/private/vequdcuhb0ojvykrerjzha | 04:24 |
ion | Get rid of “expect daemon” and make rt-nginx-control refrain from daemonizing. | 04:26 |
ion | You can remove “script…end script” if all you’re doing is an exec. | 04:26 |
axisys | removed the expect and removed the script..end script and just the exec there now | 04:28 |
axisys | # status rt-nginx-control | 04:28 |
axisys | rt-nginx-control stop/waiting | 04:28 |
axisys | ps -ef | grep nginx showing it started though | 04:29 |
axisys | https://github.com/bestpractical/rt-extension-nginx does not say how to start in foreground | 04:31 |
axisys | actual script | 04:33 |
axisys | https://github.com/bestpractical/rt-extension-nginx/blob/master/sbin/rt-nginx-control | 04:33 |
axisys | essentially this gets called | 04:37 |
axisys | /usr/sbin/nginx -c /opt/rt4/var/nginx/nginx.conf | 04:37 |
axisys | and I get my prompt back right away if I run the above | 04:38 |
axisys | so I guess nginx starts in daemon mode | 04:38 |
axisys | looks like nginx requires a expect fork ? | 04:42 |
axisys | http://wiki.nginx.org/Upstart | 04:42 |
ion | Or preferably don’t make it daemonize. | 04:43 |
ion | “if [ $? -ne 0 ]; then exit $?; fi” is very weird. | 04:44 |
axisys | ion: i did not use that part.. but otherwise /usr/sbin/nginx -c /opt/rt4/var/nginx/nginx.conf worked . | 04:47 |
axisys | PID matches and start/status/stop worked | 04:47 |
axisys | http://pastie.org/private/yelt8scmp5rieu2stjkw8g works | 04:48 |
axisys | how to not fork with nginx.. still searching | 04:48 |
axisys | https://gist.github.com/serepo/3006274 doing expect fork too | 04:49 |
axisys | ion: found it.. https://gist.github.com/sickill/2492523 | 04:49 |
axisys | ion: will try that | 04:49 |
axisys | that worked perfect too | 04:57 |
axisys | back to the board | 05:10 |
axisys | /usr/sbin/nginx -c /opt/rt4/var/nginx/nginx.conf only does half the work of | 05:11 |
axisys | https://github.com/bestpractical/rt-extension-nginx/blob/master/sbin/rt-nginx-control | 05:11 |
axisys | rt-nginx-control start calls start_nginx and start_fcgi | 05:11 |
axisys | start_fcgi has the --daemonize in line 120 of | 05:12 |
axisys | https://github.com/bestpractical/rt-extension-nginx/blob/master/sbin/rt-nginx-control | 05:12 |
axisys | I guess I could have two jobs | 05:12 |
axisys | rt-nginx-control start nginx as one and rt-nginx-control start fcgi as the other | 05:13 |
axisys | fcgi needs to start before nginx | 05:13 |
spope | im using forever to keep a node app running, and using setuid in the upstart script, but forever keeps trying to create the .forever files in /root, any ideas? | 05:17 |
axisys | ion: something wrong with that script.. it does not take start nginx | 05:20 |
axisys | or start fcgi | 05:20 |
axisys | only start | 05:20 |
ion | spope: Try using su. | 05:24 |
ion | axisys: What happens when you try that? | 05:24 |
spope | ion: but im using setuid to set the user | 05:25 |
ion | spope: Try using su instead. exec su -s /bin/sh -c 'exec "$0" "$@" user -- command | 05:29 |
spope | did you mean to only use one ' | 05:33 |
spope | what is the -- command part? | 05:34 |
ion | Sorry, 'exec "$0" "$@"' | 05:34 |
ion | The command is whichever command you want to run. | 05:34 |
ion | See the cookbook. | 05:36 |
axisys | ion: it display the man page | 05:36 |
axisys | as if I did not use an argument | 05:37 |
axisys | ion: same behavior | 05:37 |
ion | What exactly did you run and what was the output? | 05:37 |
spope | it seems to get stuck | 05:40 |
spope | exec su -s /bin/sh -c 'exec "$0" "$@"' meteorapp -- forever --sourceDir $APPLICATION_DIRECTORY -a -l $LOG --minUptime 5000 --spinSleepTime 2000 start $APPLICATION_START | 05:40 |
spope | just sits there | 05:41 |
axisys | ion: ran /opt/rt4/local/plugins/RT-Extension-Nginx/sbin/rt-nginx-control start nginx | 05:45 |
axisys | ion: output was ... | 05:45 |
axisys | ion: https://github.com/bestpractical/rt-extension-nginx/blob/master/README | 05:45 |
axisys | exactly that | 05:45 |
axisys | nawp | 05:46 |
axisys | perldoc https://github.com/bestpractical/rt-extension-nginx/blob/master/sbin/rt-nginx-control | 05:46 |
axisys | output ^ | 05:46 |
axisys | may be logic is wrong on line 55 of that file | 05:47 |
axisys | if ( !$command || !$commands{ $command } || ($target && !$target) ) | 05:47 |
axisys | anyways.. I were able to find the commands.. I am testing them | 05:47 |
axisys | /usr/local/bin/plackup --server FCGI --listen /opt/rt4/var/nginx/fcgi.sock --pid /opt/rt4/var/nginx/fcgi.pid --daemonize --nproc 10 --keep-stderr 1 /opt/rt4/sbin/rt-server | 05:48 |
axisys | this the fcgi part ^ | 05:48 |
axisys | looks like that did it | 05:52 |
axisys | i can control both upstart | 05:52 |
axisys | i can control both with two separate upstart | 05:53 |
axisys | job* | 05:53 |
axisys | wish I could disable a upstart job with a switch on precise.. instead of doing though echo manual | 05:56 |
axisys | its fine.. it will do | 05:56 |
spope | ion: it might also be good if I mention the forever script, calls another | 05:56 |
axisys | well.. spoke too fast | 06:10 |
axisys | if I dont start plackup in daemon mode I am getting bad gateway on the web | 06:11 |
axisys | yep the only way web app works if I call rt-nginx-control start.. calling plackup and calling nginx in any order does not do the trick | 06:16 |
axisys | so I cannot make rt-nginx-control start work from upstart yet | 06:17 |
reynir | With a non-graphical session, is there an event that gets triggered when the session starts? | 10:06 |
reynir | I found out: 'startup' | 10:13 |
wrouesnel | is there a way to have upstart send mail when the respawn limit is reached? | 10:35 |
axisys | how to use a job name in LSB header? | 18:25 |
axisys | can I do # Required-Start: $network $remote_fs $local_fs mysql ? | 18:26 |
axisys | mysql is a jobname | 18:26 |
axisys | i want to start rt-nginx-control sysv init script, but after mysql starts | 18:27 |
axisys | starting rt-nginx-control from upstart would be right direction.. but did not work | 18:35 |
axisys | right now, workaround is adding sleep 5 on the rt-nginx-control does the job | 19:06 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!