plajjan/NIPAP — Issue #137: Handle error when trying to open PID file gracefully
Author: plajjan
Created: 2011-11-27 11:24:59+00:00
State: open

I have a nipap.conf in /etc/nipap which includes the PID file statement so nipapd will try to open the PID file on startup. If nipapd is started by root, this isn't a problem, but as I'm using this machine for development too, it would be nice to be able to start the daemon as me and not have to write that pid file.

kll@lingloi320 ~/kod/NIPAP/nipap $ ./nipapd -f -d
Traceback (most recent call last):
File "./nipapd", line 79, in
lf = open(cfg.get('nipapd', 'pid_file'), 'a+', 0)
IOError: [Errno 13] Permission denied: '/var/run/nipapd.pid'
kll@lingloi320 ~/kod/NIPAP/nipap $

Fix the bloody error message to something readable..

and perhaps add a --no-pidfile so the daemon can be started without a pidfile (overriding the setting in /etc/nipap/nipap.conf)