/srv/irclogs.ubuntu.com/2010/11/30/#upstart.txt

=== apachelogger is now known as releaselogger
=== releaselogger is now known as apachelogger
zaufihi all. anyone alive&22:19
zaufi??22:19
mbieblonly zombies around here22:23
zaufi:)22:23
zaufiI've got a problem w/ writing upstart script for my daemon... :( anyone can help?22:24
mbieblnot without a crystal ball22:28
mbieblunless you tell what the problem is22:28
zaufi`service stop mydaemon` won't send a SIGTERM to my daemon... it hust hangs on poll() some socket (dbus I guess)...22:29
zaufis,hust,just,22:29
zaufiI use 'expect daemon' in the script (which is means that daemon will fork() tiwce, as my daemon do)22:30
mbieblyou mean "stop foo", not "service stop foo"?22:30
zaufiyep22:31
zaufi... I'm playing with ubuntu 10.10 where `service` calls `start`/`stop` for upstarted programs22:31
mbieblcan you run your daemon without forking?22:32
ionDon’t use the expect stanza unless you’re *absolute* sure of the forking behavior of your main process. The current version of Upstart gets confused if the behavior differs from what the expect stanza claims.22:32
ionabsolutely22:32
zaufiI'm prettu sure my daemon fork() exactly twice :)22:32
ionPlease pastebin the job definition.22:33
mbiebldoes status foo list the correct pid?22:33
ionThe next major release of Upstart will have a considerably better method of following forks.22:34
zaufimbiebl: oops... I'm forget to check... let me reboot to ubuntu and check :) (I'm in gentoo usually)22:34
zaufiI'm just trying to get familiar w/ ubuntu )22:34
zaufimbiebl: PIDs are differ...22:39
mbieblthat's your problem then22:40
ionPlease pastebin the job definition.22:40
zaufimbiebl: http://pastebin.com/HRfuCdWr22:40
mbieblas said, can you run your daemon without forking?22:40
zaufihttp://pastebin.com/VHW8UzcV22:41
zaufiOk I'll try... but how to 'stop` it now :((22:41
mbieblkill 206022:42
zaufiso I have to comment 'expect' stanza and remove -d option (to allow fg execution) ... am I correct??22:43
mbieblyeah, try that22:43
zaufihuh... `start` hangs22:44
zauficut it poll() smth22:44
zaufis,cut,cuz.22:44
zaufiif I Ctrl-C it next start it says that indexer already running22:45
zaufiI guess I have to reboot... to cleanup dbus state22:45
zaufi??22:45
zaufimbiebl: w/o '-d' and expect start/stop works fine22:50
mbieblproblem solved22:53
zaufinot exactly... (22:54
zaufimy program must be running w/ -d22:54
zaufiin fg mode it makes spam to console only... in -d (daemon) to syslog22:54
zaufiso being running w/o -d from upstart I can't c any log messages22:55
mbieblzaufi: you can try export fork22:57
mbieblinstead of daemon22:57
mbieblargh, expect fork22:58
zaufiit fork() twice!22:58
zaufias most real daemons do22:58
ionOr strace -f it to see exactly what it *really* does. :-)22:58
zaufi`expect fork` won't stop it, as expected23:00
zaufihttp://pastebin.com/ZgHubxM823:04
zaufihere is a strace result... I used 'expect daemon'23:05
zaufiand it still pilling...23:06
ionI mean strace -o strace.out -f /…/indexer -d23:06
zaufiok23:07
zaufijust a sec23:07
zaufithis is first child: http://pastebin.com/Vs3EKTbz23:13
zaufithis is second generation child: http://pastebin.com/cKSusw2W23:13
zaufiI used -ff for strace cuz daemon loads JVM (which makes a lot of spam)23:14
ionUse -f23:14
zaufiok23:15
zaufi270K ... same file sharing required23:16
zaufijust a sec I'll find smth23:16
ionPerhaps just egrep -A5 -B5 'clone|exec|exit' or something like that.23:18
zaufihttp://up.k10x.net/webgkjidzbojj/indexer.log23:18
ionJava seems to do ten forks or so before your code daemonizes.23:21
ionUpstart happily follows the first one of them and gets confused.23:21
zaufiit forks threads23:21
zaufinot processes23:21
zaufiI think I can delay JVM loading... and do it after daemonize...23:22
zaufiI need some tome to fix a code23:22
ionYou could separate the parameter to daemonize from the parameter to log to syslog.23:23
VotingI want to start my application level server (a tomcat instance) once everything else is running... how do I run something at the end of the existing startup sequence ?23:39
VotingI want to start my application-level server (a tomcat instance) once everything else is running... how do I run something at the end of the existing startup sequence ?23:58

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!