Skip Menu |
 

Subject: Support optional creation of PID files for krb5kdc and kadmind
We had a request in Debian that the Kerberos KDC daemons write out PID
files. Among other things, this would allow somewhat better process
management by init scripts and allow people to run other krb5kdc or
kadmind processes on the same system listening to different ports and
not risk them being killed by the regular init script.

Attached is a tested patch implementing this feature.

Please let me know if this patch is acceptable; if so, I will commit it.
Download kdc-pid-patch
application/octet-stream 6.4KiB

Message body not shown because it is not plain text.

What I'd like to see, in both cases, is pid file setup moved into a
static helper function. This would reduce the number of duplicate
cleanup sequences from two to one (both functions would benefit from
flow control which avoids the need for duplicate cleanup sequences, but
that's not your problem) and would also eliminate the need for inner
variable declarations, which are discouraged by our coding practices.

That said, the patches look functionally correct, and it's probably
better to commit them in their current form before the 1.8 branch (which
may happen as early as Monday) than to wait until after for the sake of
cleanliness.
[ghudson - Thu Dec 31 13:11:33 2009]:

Show quoted text
> What I'd like to see, in both cases, is pid file setup moved into a
> static helper function. This would reduce the number of duplicate
> cleanup sequences from two to one (both functions would benefit from
> flow control which avoids the need for duplicate cleanup sequences, but
> that's not your problem) and would also eliminate the need for inner
> variable declarations, which are discouraged by our coding practices.

Oh, sure, that's an easy fix and a good idea. Attached is a new version
of the patch.
Download kdc-pid-patch
application/octet-stream 7KiB

Message body not shown because it is not plain text.

See also ticket 6213... the Apple behavior (and presumably standard FreeBSD behavior) is to not
overwrite an existing pid file. Not sure if that's better...
This looks fine. (I would have put the conditional on pid_file == NULL
into the helper, but it doesn't really matter.) I looked over the
source to some other open-source daemons and it didn't look like
treating the pid file as a lock file is terribly common, so I think
simply writing out the pid unconditionally is fine.
From: Russ Allbery <rra@stanford.edu>
Subject: SVN Commit

Add a new -P option to krb5kdc and kadmind which, if given, specifies
the path to which to write the PID file of the daemon after it finishes
initializing.


https://github.com/krb5/krb5/commit/b54e343cb8b672585875fa7400a08ea338b1500d
Commit By: rra
Revision: 23560
Changed Files:
U trunk/src/kadmin/server/kadmind.M
U trunk/src/kadmin/server/ovsec_kadmd.c
U trunk/src/kdc/krb5kdc.M
U trunk/src/kdc/main.c