fluter | hi, I use expect daemon, but then I add exec mydaeomin in script block, it cannot track the right pid, | 03:49 |
---|---|---|
fluter | anyone suggests? | 03:50 |
fluter | hello people | 04:56 |
fluter | hello people | 06:50 |
fluter | hello people | 08:17 |
xnox | fluter: "exec" cancels any expect, and tracks that pid. | 10:23 |
xnox | don't use exec, if you want to use expect daemon | 10:24 |
xnox | (inside script block that is) | 10:24 |
fluter | xnox, what is exec will track if no script block? | 10:25 |
xnox | fluter: exec outside script block is an upstart stanza, and will use expect correctly. | 10:26 |
xnox | fluter: exec inside script block is exec(1posix) which doesn't consider "expect" upstart stanzas. | 10:26 |
xnox | http://manpages.ubuntu.com/manpages/trusty/en/man1/exec.1posix.html | 10:27 |
xnox | vs | 10:27 |
fluter | xnox, because I have some setups before exec, so have to use script block | 10:27 |
xnox | can you pastebin your full job. | 10:27 |
xnox | ? | 10:27 |
fluter | xnox, sure, | 10:27 |
fluter | xnox, http://sprunge.us/DMhP | 10:31 |
fluter | I use this, and the pid is wrong | 10:32 |
xnox | fluter: just remove "exec" word, and all should just work. | 10:32 |
xnox | fluter: why did you add exec, instead of just: | 10:32 |
xnox | script | 10:32 |
xnox | [ -f /etc/sysconfig/chunk_server_main ] && . /etc/sysconfig/chunk_server_main | 10:32 |
xnox | /usr/sbin/chunk_server_main $CHUNK_SERVER_MAIN_OPTIONS | 10:32 |
xnox | end script | 10:32 |
fluter | xnox, I read the docs, it says exec is to run the command :) I read it wrong :( | 10:33 |
fluter | section for exec in upstart cookbook | 10:33 |
fluter | thanks a lot xnox | 10:33 |
xnox | fluter: on it's own, not inside a script block, which is fed completely into "sh -c" | 10:34 |
fluter | xnox, another question, inside script, there are mutiple lines, which pid will upstart tracking? | 10:34 |
xnox | the first one. | 10:34 |
xnox | so e.g. sourcing /etc/sysconfig/chunk_server_main may not exec processes. | 10:35 |
fluter | xnox, that would be the [ ] one? | 10:35 |
fluter | xnox, /usr/sbin/chunk_server will fork twice to become a daemon, witll that work? | 10:35 |
xnox | it should work. | 10:36 |
xnox | [ ] is not a process, but a shell builtin. Checked with strace against dash. | 10:37 |
fluter | xnox, I see | 10:37 |
fluter | xnox, I removed exec, but it still says the wrong pid | 10:39 |
fluter | xnox, initctl status says 1521, but ps shows it is 1523 | 10:39 |
fluter | I think it got the pid before fork | 10:40 |
xnox | fluter: what's the pid you want to track, and what does "status job" say? | 10:40 |
fluter | xnox, status says "chunkd sttart/running, process 1521" | 10:40 |
fluter | but in ps, it is 1523 | 10:40 |
xnox | fluter: did you follow http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count ? | 10:40 |
fluter | because it's the wrong pid, stop job will hang | 10:40 |
fluter | xnox, yes, the daemon fork twice, so I used expect daemon | 10:41 |
xnox | fluter: did you fully stop the job after modifying the config files? | 10:41 |
fluter | xnox, yes | 10:42 |
xnox | (as in initctl said stop/waiting) | 10:42 |
xnox | ok. | 10:42 |
fluter | xnox, I rebooted | 10:42 |
xnox | fluter: can you provide the strace.log ? is in http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count ? | 10:42 |
fluter | ok, 1 sec | 10:42 |
xnox | also try a basick job first http://paste.ubuntu.com/7622871/ | 10:43 |
fluter | xnox, http://sprunge.us/LaUG | 10:47 |
fluter | xnox, it works, | 10:49 |
fluter | the paste you gave, it tackes right pid, so I can start stop without hang | 10:50 |
xnox | fluter: what's the contents of /etc/sysconfig/chunk_server_main ? | 10:50 |
fluter | some lines of NAME=VALUE paris | 10:50 |
fluter | pairs | 10:50 |
xnox | does it have any $(), `cmd` or commands that are executed ? | 10:51 |
fluter | xnox, no, it is all static shell variables | 10:51 |
fluter | hmm, if use script block, if only one line of /usr/sbin/..., it works, | 10:54 |
fluter | if I add . /etc/sysconfig/some config file, it does not work anymore | 10:54 |
fluter | I think source a shell file is the problem | 10:55 |
xnox | one option is to have two jobs | 10:56 |
xnox | in one job do: | 10:56 |
xnox | task | 10:56 |
xnox | script | 10:56 |
xnox | . /etc/sysconfig/chunk_server_main | 10:57 |
xnox | start chunk-server VAR1=$VAR1 | 10:57 |
xnox | end script | 10:57 |
fluter | in the chunk-server job, it will get the VAR1 variable? | 10:58 |
xnox | yes. | 10:58 |
fluter | aha, ok | 10:58 |
fluter | let me try that | 10:58 |
xnox | so one job is a "sourcer/environment assembler", the other one just runs the daemon straight. | 10:58 |
fluter | xnox, start command will start it, but will it be started twice, | 10:59 |
fluter | when init says chunk-server in /etc/init | 10:59 |
=== PaulePan1er is now known as PaulePanter |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!