/srv/irclogs.ubuntu.com/2014/06/10/#upstart.txt

fluterhi, I use expect daemon, but then I add exec mydaeomin in script block, it cannot track the right pid,03:49
fluteranyone suggests?03:50
fluterhello people04:56
fluterhello people06:50
fluterhello people08:17
xnoxfluter: "exec" cancels any expect, and tracks that pid.10:23
xnoxdon't use exec, if you want to use expect daemon10:24
xnox(inside script block that is)10:24
fluterxnox, what is exec will track if no script block?10:25
xnoxfluter: exec outside script block is an upstart stanza, and will use expect correctly.10:26
xnoxfluter: exec inside script block is exec(1posix) which doesn't consider "expect" upstart stanzas.10:26
xnoxhttp://manpages.ubuntu.com/manpages/trusty/en/man1/exec.1posix.html10:27
xnoxvs10:27
fluterxnox, because I have some setups before exec, so have to use script block10:27
xnoxcan you pastebin your full job.10:27
xnox?10:27
fluterxnox, sure, 10:27
fluterxnox, http://sprunge.us/DMhP10:31
fluterI use this, and the pid is wrong10:32
xnoxfluter: just remove "exec" word, and all should just work.10:32
xnoxfluter: why did you add exec, instead of just:10:32
xnoxscript10:32
xnox[ -f /etc/sysconfig/chunk_server_main ] && . /etc/sysconfig/chunk_server_main10:32
xnox/usr/sbin/chunk_server_main  $CHUNK_SERVER_MAIN_OPTIONS10:32
xnoxend script10:32
fluterxnox, I read the docs, it says exec is to run the command :) I read it wrong :(10:33
flutersection for exec in upstart cookbook10:33
fluterthanks a lot xnox 10:33
xnoxfluter: on it's own, not inside a script block, which is fed completely into "sh -c"10:34
fluterxnox, another question, inside script, there are mutiple lines, which pid will upstart tracking?10:34
xnoxthe first one.10:34
xnoxso e.g. sourcing /etc/sysconfig/chunk_server_main may not exec processes.10:35
fluterxnox, that would be the [  ] one?10:35
fluterxnox, /usr/sbin/chunk_server will fork twice  to become a daemon, witll that work?10:35
xnoxit should work.10:36
xnox[ ] is not a process, but a shell builtin. Checked with strace against dash.10:37
fluterxnox, I see10:37
fluterxnox, I removed exec, but it still says the wrong pid10:39
fluterxnox, initctl status says 1521, but ps shows it is 152310:39
fluterI think it got the pid before fork10:40
xnoxfluter: what's the pid you want to track, and what does "status job" say?10:40
fluterxnox, status says "chunkd sttart/running, process 1521"10:40
fluterbut in ps, it is 152310:40
xnoxfluter: did you follow http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count ?10:40
fluterbecause it's the wrong pid, stop job will hang10:40
fluterxnox, yes, the daemon fork twice, so I used expect daemon10:41
xnoxfluter: did you fully stop the job after modifying the config files?10:41
fluterxnox, yes10:42
xnox(as in initctl said stop/waiting)10:42
xnoxok.10:42
fluterxnox, I rebooted10:42
xnoxfluter: can you provide the strace.log ? is in http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count ?10:42
fluterok, 1 sec10:42
xnoxalso try a basick job first http://paste.ubuntu.com/7622871/10:43
fluterxnox, http://sprunge.us/LaUG10:47
fluterxnox, it works, 10:49
fluterthe paste you gave, it tackes right pid, so I can start stop without hang10:50
xnoxfluter: what's the contents of  /etc/sysconfig/chunk_server_main ?10:50
flutersome lines of NAME=VALUE paris10:50
fluterpairs10:50
xnoxdoes it have any $(), `cmd` or commands that are executed ?10:51
fluterxnox, no, it is all static shell variables10:51
fluterhmm, if use script block, if only one line of /usr/sbin/..., it works,10:54
fluterif I add . /etc/sysconfig/some config file, it does not work anymore10:54
fluterI think source a shell file is the problem10:55
xnoxone option is to have two jobs10:56
xnoxin one job do:10:56
xnoxtask10:56
xnoxscript10:56
xnox. /etc/sysconfig/chunk_server_main10:57
xnoxstart chunk-server VAR1=$VAR110:57
xnoxend script10:57
fluterin the chunk-server job, it will get the VAR1 variable?10:58
xnoxyes.10:58
fluteraha, ok10:58
fluterlet me try that10:58
xnoxso one job is a "sourcer/environment assembler", the other one just runs the daemon straight.10:58
fluterxnox, start command will start it, but will it be started twice,10:59
fluterwhen 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!