=== apachelogger is now known as releaselogger === releaselogger is now known as apachelogger [22:19] hi all. anyone alive& [22:19] ?? [22:23] only zombies around here [22:23] :) [22:24] I've got a problem w/ writing upstart script for my daemon... :( anyone can help? [22:28] not without a crystal ball [22:28] unless you tell what the problem is [22:29] `service stop mydaemon` won't send a SIGTERM to my daemon... it hust hangs on poll() some socket (dbus I guess)... [22:29] s,hust,just, [22:30] I use 'expect daemon' in the script (which is means that daemon will fork() tiwce, as my daemon do) [22:30] you mean "stop foo", not "service stop foo"? [22:31] yep [22:31] ... I'm playing with ubuntu 10.10 where `service` calls `start`/`stop` for upstarted programs [22:32] can you run your daemon without forking? [22:32] Don’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] absolutely [22:32] I'm prettu sure my daemon fork() exactly twice :) [22:33] Please pastebin the job definition. [22:33] does status foo list the correct pid? [22:34] The next major release of Upstart will have a considerably better method of following forks. [22:34] mbiebl: oops... I'm forget to check... let me reboot to ubuntu and check :) (I'm in gentoo usually) [22:34] I'm just trying to get familiar w/ ubuntu ) [22:39] mbiebl: PIDs are differ... [22:40] that's your problem then [22:40] Please pastebin the job definition. [22:40] mbiebl: http://pastebin.com/HRfuCdWr [22:40] as said, can you run your daemon without forking? [22:41] http://pastebin.com/VHW8UzcV [22:41] Ok I'll try... but how to 'stop` it now :(( [22:42] kill 2060 [22:43] so I have to comment 'expect' stanza and remove -d option (to allow fg execution) ... am I correct?? [22:43] yeah, try that [22:44] huh... `start` hangs [22:44] cut it poll() smth [22:44] s,cut,cuz. [22:45] if I Ctrl-C it next start it says that indexer already running [22:45] I guess I have to reboot... to cleanup dbus state [22:45] ?? [22:50] mbiebl: w/o '-d' and expect start/stop works fine [22:53] problem solved [22:54] not exactly... ( [22:54] my program must be running w/ -d [22:54] in fg mode it makes spam to console only... in -d (daemon) to syslog [22:55] so being running w/o -d from upstart I can't c any log messages [22:57] zaufi: you can try export fork [22:57] instead of daemon [22:58] argh, expect fork [22:58] it fork() twice! [22:58] as most real daemons do [22:58] Or strace -f it to see exactly what it *really* does. :-) [23:00] `expect fork` won't stop it, as expected [23:04] http://pastebin.com/ZgHubxM8 [23:05] here is a strace result... I used 'expect daemon' [23:06] and it still pilling... [23:06] I mean strace -o strace.out -f /…/indexer -d [23:07] ok [23:07] just a sec [23:13] this is first child: http://pastebin.com/Vs3EKTbz [23:13] this is second generation child: http://pastebin.com/cKSusw2W [23:14] I used -ff for strace cuz daemon loads JVM (which makes a lot of spam) [23:14] Use -f [23:15] ok [23:16] 270K ... same file sharing required [23:16] just a sec I'll find smth [23:18] Perhaps just egrep -A5 -B5 'clone|exec|exit' or something like that. [23:18] http://up.k10x.net/webgkjidzbojj/indexer.log [23:21] Java seems to do ten forks or so before your code daemonizes. [23:21] Upstart happily follows the first one of them and gets confused. [23:21] it forks threads [23:21] not processes [23:22] I think I can delay JVM loading... and do it after daemonize... [23:22] I need some tome to fix a code [23:23] You could separate the parameter to daemonize from the parameter to log to syslog. [23:39] I 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] I 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 ?