Since the last (7.2) update to BIND, I've been seeing complaints in 
syslog about it being unable to write the PID file in /var/run/named.pid 
- to cut a long story short, since it's now running as user ``bind'' it 
no longer has write permission in /var/run/ and the killproc function in 
/etc/rc.d/init.d/functions has to rely on pidof (essentially the same as 
doing a killall).

To get around this, may I suggest having services write their PID into 
/var/run/$SERVICE/$SERVICE.pid? - for example /var/run/named/named.pid - 
that way, /var/run/$SERVICE/ (/var/run/named/ in this case) can be owned 
by the user running the service. The code to add this to 
/etc/rc.d/init.d/functions is trivial.

As an alternative, perhaps some processes could use 
/var/run/$SERVICE/$PID.pid to permit several of each kind of process to 
run alongside each other. The killproc function (which refers to the 
basename of the service as ${base}) need only look for 
/var/run/$SERVICE/*.pid and kill everything it finds a PIDfile for there.

I think a special file named something like 
/var/run/$SERVICE/nokillall.pid would also be useful here to avoid 
killproc nailing services not started through the SysV scripts by 
accident if it does a killall on not finding a .pid file, unless 
killproc accepted an empty /var/run/$SERVICE/ directory as evidence that 
the service existed but was not running.

How say you?

-- 
"Mistakes are the price we pay for a full life."
     -- Sophia Loren


Reply via email to