/srv/irclogs.ubuntu.com/2012/08/27/#upstart.txt

pulzseems i was incorrect when using start stop daemon its tracking the wrong pid 06:42
SpamapSpulz: would you mind pasting your job file somewhere so we can take a look?06:58
pulz hehe, i mangled it now, but i can put up here the orig and the new 07:53
pulzSpamapS: http://pastebin.com/AkszchTK here you go07:56
pulzand thx for the intrest07:56
JanCpulz: you should probably use one of the matching options of start-stop-daemon14:01
JanCe.g. the -p/--pidfile option14:02
SpamapSpulz: just drop the -D and the 'expect fork'14:40
SpamapSamazing how many things do daemonization *wrong*14:41
SpamapShttps://github.com/gamelinux/passivedns/blob/master/src/passivedns.c14:42
SpamapSshould not daemonize until after compiling the pcap config and setting up the filters14:42
pulzSpamapS: so the program is wrong ? 15:48
SpamapSpulz: well, its silly that it crashes after daemonize() is called, thats all15:54
SpamapSpulz: anyway, there's no reason to need -D and use 'expect fork'.. just run it without -D, and without expect fork, and you'll have an easier time....15:55
SpamapSpulz: that said, if it immediately crashes, you should see something about that in /var/log/syslog, like "passivedns exitted with exit code 1"15:56
pulzim assigning it the wrong interface to listen to, so it doesnt crash just exit to quick ? 16:00
SpamapSpulz: yeah not much upstart can do about that :)16:05
SpamapSpulz: note that if you are on Ubuntu 11.10 or later you should have a log of its output in /var/log/upstart/passivedns.log (assuming your job is /etc/init/passivedns.conf)16:05
pulzSpamapS: yes it does, just tells you that it cant open the interface ([*] Error pcap_open_live: eth1: No such device exists (SIOCGIFHWADDR: No such device)) 16:39
memehello. i'm trying to daemonize node.js, with upstart. i follow this tut http://howtonode.org/deploying-node-upstart-monit , it gives a configuration sample, but it never mentions where it should go. any tips?19:07
SpamapSmeme: reading19:11
SpamapSmeme: /etc/init/yourprogram.conf19:12
SpamapSmeme: which, it says19:12
memehuh? really?19:20
SpamapSmeme: yes, its in the paragraph right under the upstart config block19:21
memeoh, yes. now i see, i just got confused, thanks for pointing that out19:24
SpamapSmeme: thanks for using upstart. :) Thats a pretty good article btw :)19:25
memeoky :)19:25
SpamapSmeme: note that the pre-start and pre-stop in that job file are *completely* unnecessary19:25
SpamapSmeme: as is the script section.. it could be rewritten quite a bit simpler19:26
memealright, cheers19:26
SpamapSmeme: also 'start on startup' is dead wrong19:26
SpamapSok never mind that article is not so smart ;)19:27
memeo.O19:27
memelol19:27
memei just need the basics, for now19:27
SpamapShttp://paste.ubuntu.com/1170475/19:27
SpamapSthats all you need19:27
SpamapSmeme: start on startup just won't work unfortunately.. startup is before the filesystems are mounted, before networking is up..19:28
SpamapSit probably accidentally works only because the root FS is mounted (readonly) and the thing listens on 0.0.0.019:28
SpamapSbut the monit stuff is, I think, alright :)19:29
memeit's ok, it is just for my personal site now, not a multi million traffic site :D19:30
memewho knows in the future.... I have nginx as a proxy, so the power is there19:31
meme`start on (filesystem and net-device-up IFACE!=lo)`19:37
SpamapSew19:38
SpamapSdon't use that19:38
SpamapSever19:38
SpamapSmeme: thats going to get you into trouble. Just trust that runlevel 2 is "when things are basically ready"19:38
memelol, someone at node,js is telling me, cauze i have asked the same question there also, lol19:38
SpamapSyeah19:39
SpamapSits a common misconception because a lot of official Ubuntu packages use it still19:39
SpamapSbut having rewritten the code th delay runlevel 2 until things are ready.. I'm well aware.. use runlevel 2. :)19:39
memei see, thanks god i meet you, you seems like an expert19:39
SpamapSactually, having participated in the rewrite that smoser did .. :)19:39
SpamapSmeme: its only good in 11.10 and later. In 10.04 .. runlevel 2 is too early usually19:39
memei see19:40
memeso i will just stick with the bin you gave me for now, let's see what's happen19:40
memeSpamapS, i cannot get it to work. do you think that for the fact i'm using nginx as a proxy, it could be there some conflict?20:49
SpamapSmeme: nginx would be a completely different process, so no20:49
SpamapSmeme: why don't you try connecting directly to the node.js port, just to see if it works?20:49
memeok, but how?20:50
memei got the system message and all, app start/running, process 761320:50
memeafter i do sudo start app20:50
memewhere app, is the app.js file, in my node app, it is an express app(not sure if you know node )20:51
memebut i got a 502, if i visit the domain20:51
memewhen using the upstart20:52
memeif i just do a normal node app.js command, all works with nginx 20:53
SpamapSmeme: oh, I think you might need $HOME set20:54
SpamapSmeme: so add a line..  'env HOME=/wherever/users/home/is'20:55
SpamapSmeme: i bet node is printing stuff into /var/log/upstart/app.log tho20:55
memelemme me check20:55
memei will vim'it20:56
meme;P20:56
memenope, it is not, it is empty20:57
memei have the app in my $HOME user folder20:58
memeif i env HOME=/wherever/users/home/is same as env HOME=/home/[username] ?20:59
memeor  env HOME=/home/[username]/sites/domain.com/public/app.js ?20:59
memeugh, i'm getting a lil bit frustrated, i will try this now https://github.com/nodejitsu/forever21:05
memei just need a quick hack for now21:05
pulzSpamapS: about your fix, when disabling the daemon flag and just using exec it forks 13 procs 21:37
SpamapSpulz: yeah that shouldn't really matter though21:42
mememm, i think i have a clue now, when trying to unistall i got npm WARN uninstall not installed in /usr/lib/node_modules: "npm"21:45
memeops, sry21:46
JanCSpamapS: "runlevel 2" should be renamed to something more sensible IMO  ;)22:15
SpamapSJanC: *100%* agree22:16
SpamapSJanC: I meant to work on that this cycle but it got pushed out by other stuff22:16
SpamapSJanC: I think  'start on starting network-services' and 'stop on stopping network-services' makes a *lot* more sense.22:16
SpamapSJanC: there's another benefit to that which is that we can then have back our sequencing of things we want to start "after everything normal"22:16
SpamapSlike cron22:17
JanCas long as it uses human-understandable names that are more or less self-explanatory  ☺22:19
JanCand of course well-documented22:21
SpamapSyeah, runlevels are just left overs22:22
SpamapSBut I intend to have that network-services job 'start on runlevel [2345]' and 'stop on runlevel [016]'22:23
SpamapSbut having a job to follow gives us sequencing so its better then runlevel whcih is just a signal22:23

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