pid file is created with wrong permissions
in function prelude_daemonize() (libprelude), pid file is created before calling setsid(). This means that the pid will be created with permissions 0600 and owner root. If running prelude-manager with a non-privileged user, it will be unable to remove file on exit:
# grep ^user /etc/prelude-manager/prelude-manager.conf user = prelude # prelude-manager -d -P /var/run/prelude-manager/prelude-manager.pid # ls -al /var/run/prelude-manager/prelude-manager.pid -rw------- 1 root prelude 5 2007-05-06 19:53 /var/run/prelude-manager/prelude-manager.pid
Stopping the server will fail with error:
piche prelude-manager: daemonize.c:lockfile_unlink:52: couldn't delete lockfile /var/run/prelude-manager/prelude-manager.pid.
#2 Updated by Yoann VANDOORSELAERE almost 12 years ago
- Status changed from Assigned to Closed
- Resolution set to fixed
(In r9775) Lock pidfile in the children, since advisory lock aren't shared accross fork().
Improved error reporting in case the lock is already held.
Don't try to delete the lockfile on exit() (there is no problem with leaving it
here since it is protected by the advisory lock) (fix #223).