HomeClusterLabs Projects

Refactor: libcrmcommon: Don't create or lock pidfile in pcmk__daemonize

Description

Refactor: libcrmcommon: Don't create or lock pidfile in pcmk__daemonize

The only caller is crm_mon.c:main(). There doesn't seem to be any reason
why we shouldn't have multiple crm_mon daemons running simultaneously.
For example, a user may want a XML output going to one file and HTML
output going to another file.

Additionally, at least as far back as Pacemaker 2.1.5, the locking
didn't work. Multiple daemonized crm_mon processes can already be run at
the same time. If two of them use the same pidfile, then the process
that's created later overwrites the pidfile created by the first one.

Also, nothing deletes the pidfile when the daemon exits. The pidfile is
supposed to be deleted later when a new process checks it and finds that
the PID contained within refers to a process that's no longer active.

The pidfile lock was meaningful until commit 8cdc185 in 2012. Until that
commit, pacemakerd called pcmk__daemonize() (as crm_make_daemon()). We
needed to ensure that there was only one pacemakerd process, so pidfile
lock made sense.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Tue, Aug 12, 5:03 PM
Parents
rP73a1d1a670b3: Refactor: tools: Process more options before daemonizing
Branches
Unknown
Tags
Unknown