[15:41] i have an app that double forks.. i put the expect daemon and it works.. but it's not picking up the correct process.. when i stop it it kills 1 but not the real process [16:12] Hi, I'm trying to set up a reverse ssh tunnel (triggering on static-network-up) but it does not start automatically, manual start is ok though, any suggestions on what to do next? [17:03] jY: are you sure it double forks for the main process? [17:04] tlvb: I'd use 'runlevel [2345]' instead of 'static-network-up' [17:04] tlvb: just simpler [17:06] SpamapS: ya my fork/clone count is 2 [17:06] via a strace [17:09] SpamapS: I tried that too, but no cigar [17:11] jY: are you certain that the second fork is the main process though? sounds like it is not. [17:11] tlvb: then its probably starting but failing. Anything in /var/log/syslog ? [17:11] tlvb: since, you wouldn't be able to login if runlevel 2 was not reached. ;) [17:12] SpamapS: nothing in syslog that I know of, but it may be failing grepping skills [17:12] SpamapS: this is the script by the way: http://pastebin.com/8z2xF88W [17:12] SpamapS: resque-web is doing something funny [17:12] here is my ps tree [17:12] tlvb: the job name would appear with a failure status [17:13] http://pastie.org/3740040 [17:14] if i stop it it kills the /bin/sh -e /proc/self/fd/11 [17:14] SpamapS: nope, nothing in syslog except from an earlier manual start/stop with extra logging turned on [17:14] tlvb: pastebin your job file maybe? [17:15] SpamapS: job file? you mean the /etc/init/... I did that a few lines up, though I see now I mislabeled it as the script [17:16] even if i try expect fork.. same result [17:18] tlvb: I would not expect that to 'expect fork' [17:19] jY: if you are using 'script', the fork to run the script counts as one fork [17:19] I read a note on how to find out if expect fork or expect daemon (or nothing) is proper, hang on [17:19] SpamapS: here's my conf http://pastie.org/3740075 [17:20] http://upstart.ubuntu.com/cookbook/#id153 <-yep that's the one, and that told me to put expect fork [17:21] jY: start on startup is *WAY* too early [17:21] jY: no network interfaces, no filesystems mounted.. [17:21] ok [17:21] jY: OH and expect daemon is not part of the script, it has to be its own stanza [17:21] should i take out the sudo.. out of script then? [17:22] jY: the sudo is also wrong, you should use start-stop-daemon... [17:22] ohh didn't know i could use that [17:22] jY: http://upstart.ubuntu.com/cookbook/#run-a-job-as-a-different-user [17:23] thanks [17:23] jY: but the expect part, it has to be *before* the 'script' or after 'end script' [17:23] jY: and you don't need script anyway, just use 'exec' [17:23] gotcha [17:33] SpamapS: does start-stop accept env vars set in the upstart script.. or do I have to pass them in at run time like I did with the sudo? [17:34] jY: not sure.. experiment? [17:35] i get this if i debug [17:35] start-stop-daemon: stat cd /data/resque-web/; export PATH=/home/resque-web/.rbenv/bin:/home/resque-web/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin; export RACK_ENV=qa; exec bundle exec rackup -p5678 >> resque-web.log 2>&1: No such file or directory (No such file or directory) === Md is now known as Md2 === Md2 is now known as ^|^