jY | 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 | 15:41 |
---|---|---|
tlvb | 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? | 16:12 |
SpamapS | jY: are you sure it double forks for the main process? | 17:03 |
SpamapS | tlvb: I'd use 'runlevel [2345]' instead of 'static-network-up' | 17:04 |
SpamapS | tlvb: just simpler | 17:04 |
jY | SpamapS: ya my fork/clone count is 2 | 17:06 |
jY | via a strace | 17:06 |
tlvb | SpamapS: I tried that too, but no cigar | 17:09 |
SpamapS | jY: are you certain that the second fork is the main process though? sounds like it is not. | 17:11 |
SpamapS | tlvb: then its probably starting but failing. Anything in /var/log/syslog ? | 17:11 |
SpamapS | tlvb: since, you wouldn't be able to login if runlevel 2 was not reached. ;) | 17:11 |
tlvb | SpamapS: nothing in syslog that I know of, but it may be failing grepping skills | 17:12 |
tlvb | SpamapS: this is the script by the way: http://pastebin.com/8z2xF88W | 17:12 |
jY | SpamapS: resque-web is doing something funny | 17:12 |
jY | here is my ps tree | 17:12 |
SpamapS | tlvb: the job name would appear with a failure status | 17:12 |
jY | http://pastie.org/3740040 | 17:13 |
jY | if i stop it it kills the /bin/sh -e /proc/self/fd/11 | 17:14 |
tlvb | SpamapS: nope, nothing in syslog except from an earlier manual start/stop with extra logging turned on | 17:14 |
SpamapS | tlvb: pastebin your job file maybe? | 17:14 |
tlvb | 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:15 |
jY | even if i try expect fork.. same result | 17:16 |
SpamapS | tlvb: I would not expect that to 'expect fork' | 17:18 |
SpamapS | jY: if you are using 'script', the fork to run the script counts as one fork | 17:19 |
tlvb | I read a note on how to find out if expect fork or expect daemon (or nothing) is proper, hang on | 17:19 |
jY | SpamapS: here's my conf http://pastie.org/3740075 | 17:19 |
tlvb | http://upstart.ubuntu.com/cookbook/#id153 <-yep that's the one, and that told me to put expect fork | 17:20 |
SpamapS | jY: start on startup is *WAY* too early | 17:21 |
SpamapS | jY: no network interfaces, no filesystems mounted.. | 17:21 |
jY | ok | 17:21 |
SpamapS | jY: OH and expect daemon is not part of the script, it has to be its own stanza | 17:21 |
jY | should i take out the sudo.. out of script then? | 17:21 |
SpamapS | jY: the sudo is also wrong, you should use start-stop-daemon... | 17:22 |
jY | ohh didn't know i could use that | 17:22 |
SpamapS | jY: http://upstart.ubuntu.com/cookbook/#run-a-job-as-a-different-user | 17:22 |
jY | thanks | 17:23 |
SpamapS | jY: but the expect part, it has to be *before* the 'script' or after 'end script' | 17:23 |
SpamapS | jY: and you don't need script anyway, just use 'exec' | 17:23 |
jY | gotcha | 17:23 |
jY | 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:33 |
SpamapS | jY: not sure.. experiment? | 17:34 |
jY | i get this if i debug | 17:35 |
jY | 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) | 17:35 |
=== Md is now known as Md2 | ||
=== Md2 is now known as ^|^ |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!