Project

General

Profile

Bug #223

pid file is created with wrong permissions

Added by admin admin almost 12 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
Due date:
% Done:

0%

Resolution:
fixed

Description

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.

History

#1 Updated by Yoann VANDOORSELAERE over 11 years ago

  • Status changed from New to Assigned

#2 Updated by Yoann VANDOORSELAERE over 11 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).

#3 Updated by Yoann VANDOORSELAERE almost 10 years ago

  • Project changed from PRELUDE SIEM to Libprelude
  • Category deleted (1)
  • Target version deleted (0.9.15)

Also available in: Atom PDF