pulz | seems i was incorrect when using start stop daemon its tracking the wrong pid | 06:42 |
---|---|---|
SpamapS | pulz: 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 |
pulz | SpamapS: http://pastebin.com/AkszchTK here you go | 07:56 |
pulz | and thx for the intrest | 07:56 |
JanC | pulz: you should probably use one of the matching options of start-stop-daemon | 14:01 |
JanC | e.g. the -p/--pidfile option | 14:02 |
SpamapS | pulz: just drop the -D and the 'expect fork' | 14:40 |
SpamapS | amazing how many things do daemonization *wrong* | 14:41 |
SpamapS | https://github.com/gamelinux/passivedns/blob/master/src/passivedns.c | 14:42 |
SpamapS | should not daemonize until after compiling the pcap config and setting up the filters | 14:42 |
pulz | SpamapS: so the program is wrong ? | 15:48 |
SpamapS | pulz: well, its silly that it crashes after daemonize() is called, thats all | 15:54 |
SpamapS | pulz: 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 |
SpamapS | pulz: 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 |
pulz | im assigning it the wrong interface to listen to, so it doesnt crash just exit to quick ? | 16:00 |
SpamapS | pulz: yeah not much upstart can do about that :) | 16:05 |
SpamapS | pulz: 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 |
pulz | SpamapS: 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 |
meme | hello. 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 |
SpamapS | meme: reading | 19:11 |
SpamapS | meme: /etc/init/yourprogram.conf | 19:12 |
SpamapS | meme: which, it says | 19:12 |
meme | huh? really? | 19:20 |
SpamapS | meme: yes, its in the paragraph right under the upstart config block | 19:21 |
meme | oh, yes. now i see, i just got confused, thanks for pointing that out | 19:24 |
SpamapS | meme: thanks for using upstart. :) Thats a pretty good article btw :) | 19:25 |
meme | oky :) | 19:25 |
SpamapS | meme: note that the pre-start and pre-stop in that job file are *completely* unnecessary | 19:25 |
SpamapS | meme: as is the script section.. it could be rewritten quite a bit simpler | 19:26 |
meme | alright, cheers | 19:26 |
SpamapS | meme: also 'start on startup' is dead wrong | 19:26 |
SpamapS | ok never mind that article is not so smart ;) | 19:27 |
meme | o.O | 19:27 |
meme | lol | 19:27 |
meme | i just need the basics, for now | 19:27 |
SpamapS | http://paste.ubuntu.com/1170475/ | 19:27 |
SpamapS | thats all you need | 19:27 |
SpamapS | meme: start on startup just won't work unfortunately.. startup is before the filesystems are mounted, before networking is up.. | 19:28 |
SpamapS | it probably accidentally works only because the root FS is mounted (readonly) and the thing listens on 0.0.0.0 | 19:28 |
SpamapS | but the monit stuff is, I think, alright :) | 19:29 |
meme | it's ok, it is just for my personal site now, not a multi million traffic site :D | 19:30 |
meme | who knows in the future.... I have nginx as a proxy, so the power is there | 19:31 |
meme | `start on (filesystem and net-device-up IFACE!=lo)` | 19:37 |
SpamapS | ew | 19:38 |
SpamapS | don't use that | 19:38 |
SpamapS | ever | 19:38 |
SpamapS | meme: thats going to get you into trouble. Just trust that runlevel 2 is "when things are basically ready" | 19:38 |
meme | lol, someone at node,js is telling me, cauze i have asked the same question there also, lol | 19:38 |
SpamapS | yeah | 19:39 |
SpamapS | its a common misconception because a lot of official Ubuntu packages use it still | 19:39 |
SpamapS | but having rewritten the code th delay runlevel 2 until things are ready.. I'm well aware.. use runlevel 2. :) | 19:39 |
meme | i see, thanks god i meet you, you seems like an expert | 19:39 |
SpamapS | actually, having participated in the rewrite that smoser did .. :) | 19:39 |
SpamapS | meme: its only good in 11.10 and later. In 10.04 .. runlevel 2 is too early usually | 19:39 |
meme | i see | 19:40 |
meme | so i will just stick with the bin you gave me for now, let's see what's happen | 19:40 |
meme | SpamapS, 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 |
SpamapS | meme: nginx would be a completely different process, so no | 20:49 |
SpamapS | meme: why don't you try connecting directly to the node.js port, just to see if it works? | 20:49 |
meme | ok, but how? | 20:50 |
meme | i got the system message and all, app start/running, process 7613 | 20:50 |
meme | after i do sudo start app | 20:50 |
meme | where app, is the app.js file, in my node app, it is an express app(not sure if you know node ) | 20:51 |
meme | but i got a 502, if i visit the domain | 20:51 |
meme | when using the upstart | 20:52 |
meme | if i just do a normal node app.js command, all works with nginx | 20:53 |
SpamapS | meme: oh, I think you might need $HOME set | 20:54 |
SpamapS | meme: so add a line.. 'env HOME=/wherever/users/home/is' | 20:55 |
SpamapS | meme: i bet node is printing stuff into /var/log/upstart/app.log tho | 20:55 |
meme | lemme me check | 20:55 |
meme | i will vim'it | 20:56 |
meme | ;P | 20:56 |
meme | nope, it is not, it is empty | 20:57 |
meme | i have the app in my $HOME user folder | 20:58 |
meme | if i env HOME=/wherever/users/home/is same as env HOME=/home/[username] ? | 20:59 |
meme | or env HOME=/home/[username]/sites/domain.com/public/app.js ? | 20:59 |
meme | ugh, i'm getting a lil bit frustrated, i will try this now https://github.com/nodejitsu/forever | 21:05 |
meme | i just need a quick hack for now | 21:05 |
pulz | SpamapS: about your fix, when disabling the daemon flag and just using exec it forks 13 procs | 21:37 |
SpamapS | pulz: yeah that shouldn't really matter though | 21:42 |
meme | mm, 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 |
meme | ops, sry | 21:46 |
JanC | SpamapS: "runlevel 2" should be renamed to something more sensible IMO ;) | 22:15 |
SpamapS | JanC: *100%* agree | 22:16 |
SpamapS | JanC: I meant to work on that this cycle but it got pushed out by other stuff | 22:16 |
SpamapS | JanC: I think 'start on starting network-services' and 'stop on stopping network-services' makes a *lot* more sense. | 22:16 |
SpamapS | JanC: 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 |
SpamapS | like cron | 22:17 |
JanC | as long as it uses human-understandable names that are more or less self-explanatory ☺ | 22:19 |
JanC | and of course well-documented | 22:21 |
SpamapS | yeah, runlevels are just left overs | 22:22 |
SpamapS | But I intend to have that network-services job 'start on runlevel [2345]' and 'stop on runlevel [016]' | 22:23 |
SpamapS | but having a job to follow gives us sequencing so its better then runlevel whcih is just a signal | 22:23 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!