dragonresearch / rpki.net

Dragon Research Labs rpki.net RPKI toolkit
54 stars 26 forks source link

Couldn't write PID file #700

Open sraustein opened 10 years ago

sraustein commented 10 years ago

I restarted my daemons this morning noticed some messages about writing the pid file. There is no /var/run/rpki directory on my system (Ubuntu 12.04, source install). Doesn't seem to affect anything that I can see, so not sure if this completely harmless. {{{ Apr 11 09:11:12 rpki irdbd[21736]: Couldn't write PID file /var/run/rpki/irdbd.pid: No such file or directory Apr 11 09:11:12 rpki rpkid[21738]: Couldn't write PID file /var/run/rpki/rpkid.pid: No such file or directory Apr 11 09:11:12 rpki rpkid[21738]: Updating /usr/local/share/rpki/ca.cer, timestamp 2014-04-10T18:01:44Z Apr 11 09:11:12 rpki rpkid[21738]: Updating /usr/local/share/rpki/irdbd.cer, timestamp 2014-04-10T18:01:44Z Apr 11 09:11:12 rpki rpkid[21738]: Updating /usr/local/share/rpki/irbe.cer, timestamp 2014-04-10T18:01:44Z Apr 11 09:11:12 rpki rpkid[21738]: Updating /usr/local/share/rpki/rpkid.cer, timestamp 2014-04-10T18:01:44Z Apr 11 09:11:12 rpki rpkid[21738]: Updating /usr/local/share/rpki/rpkid.key, timestamp 2013-10-09T20:04:58Z Apr 11 09:11:12 rpki rpkid[21738]: Scheduling initial cron pass at 2014-04-11T16:11:34Z Apr 11 09:11:12 rpki pubd[21741]: Couldn't write PID file /var/run/rpki/pubd.pid: No such file or directory Apr 11 09:11:12 rpki pubd[21741]: Updating /usr/local/share/rpki/ca.cer, timestamp 2014-04-10T18:01:44Z Apr 11 09:11:12 rpki pubd[21741]: Updating /usr/local/share/rpki/irbe.cer, timestamp 2014-04-10T18:01:44Z Apr 11 09:11:12 rpki pubd[21741]: Updating /usr/local/share/rpki/pubd.cer, timestamp 2014-04-10T18:01:44Z Apr 11 09:11:12 rpki pubd[21741]: Updating /usr/local/share/rpki/pubd.key, timestamp 2013-10-09T20:04:58Z Apr 11 09:11:12 rpki rootd[21744]: Couldn't write PID file /var/run/rpki/rootd.pid: No such file or directory }}}

Trac ticket #688 component rpkid priority minor, owner , created by melkins on 2014-04-11T16:17:47Z, last modified 2014-04-11T22:29:22Z

sraustein commented 10 years ago

I restarted my daemons this morning noticed some messages about writing the pid file. There is no /var/run/rpki directory on my system (Ubuntu 12.04, source install). Doesn't seem to affect anything that I can see, so not sure if this completely harmless.

Thought I had something in rpki-ca.upstart (or some equivalent place in the startup sequence) to create that directory, but I don't see it now. IIRC /var/run is a temporary filesystem on Ubuntu, so creating that directory at install time doesn't work.

Will do something about this once I'm done with my taxes :)

Absence of the .pid files means upstart won't know how to shut the daemons down. Other than that it should be harmless.

Trac comment by sra on 2014-04-11T16:28:02Z

sraustein commented 10 years ago

Thought I had something in rpki-ca.upstart (or some equivalent place in the startup sequence) to create that directory, but I don't see it now. IIRC /var/run is a temporary filesystem on Ubuntu, so creating that directory at install time doesn't work.

My recollection was correct, I just didn't see it in rpki-ca.upstart when I looked earlier today: {{{ install -m 755 -o rpkid -g rpkid -d /var/run/rpki /usr/share/rpki/publication }}}

So that directory should have existed, so how did this happen?

That said: the current upstart configuration is nasty, because upstart isn't really designed to start multiple daemons from a single script, at least not this way. We might want a simplified version of:

http://surniaulula.com/2013/08/01/multiple-mongodb-instances-with-ubuntus-upstart/

where there's a master upstart job that just starts the others; whether we use separate upstart scripts (one per daemon) or consider the daemon name to be the instance or what, I don't much care at the moment. I suppose we might even be able to do something clever where we use the same upstart configuration file to do all of the above, eg, null instance means it's the master, otherwise instance name is the daemon we're trying to start.

This would mean we're not using rpki-start-servers under upstart, but that wouldn't particularly bother me; the main thing that script does is check rpki.conf to figure out which daemons to start, and we'd need to do that anyway.

If there's some way to include multiple upstart scripts in the debian/ directory and expect debhelper to do anything useful with them, I haven't figured out the scheme yet. This makes the approach of one upstart config file that does everything somewhat appealing, but I have to read a bit more to figure out if it's practical.

Trac comment by sra on 2014-04-11T22:08:56Z

sraustein commented 10 years ago

So, yeah, it looks possible to have a single rpki-ca.upstart configuration which uses the null instance trick (http://upstart.ubuntu.com/cookbook/#id173) to act as the master, then (somehow) reads rpki.conf to figure out which daemon instances it needs to spawn. Probably need to make all the relevant sections be scripts rather than simple exec, but seems doable.

Trac comment by sra on 2014-04-11T22:29:22Z