Re: INN 2.6.4 release candidate
Marco d'Itri <[email protected]>
| Newsgroups | gmane.network.inn |
|---|---|
| Message-ID | <X/[email protected]> |
Sorry, I forgot that this patch or something to the same effect is needed to make systemd notifications (and future socket activation) work. The reason is that systemd will only accept notifications from the child process it spawned, so we need innd to be exec'ed by rc.news. Without this patch inn will be stopped after one minute with messages like: Jan 10 01:10:26 erode systemd[1]: inn2.service: Got notification message from PID 23629, but reception only permitted for main PID which is currently not known Jan 10 01:11:23 erode systemd[1]: inn2.service: Failed with result 'protocol'. Jan 10 01:11:23 erode systemd[1]: Failed to start InterNetNews. -- ciao, Marco
systemd-rcnews
(text/plain, 656 B)
--- a/scripts/rc.news.in
+++ b/scripts/rc.news.in
@@ -157,8 +157,12 @@ if [ "$OVMETHOD" = "ovdb" ]; then
fi
## Start the show.
+## When using systemd, the daemon must be started last with exec to keep
+## the same PID of this script.
+if [ -z "$NOTIFY_SOCKET" -a -z "$LISTEN_PID" ]; then
echo 'Starting innd.'
eval ${WHAT} ${RFLAG} ${INNFLAGS}
+fi
# Gee, looks like lisp, doesn't it?
${DOINNWATCH} && {
@@ -188,3 +192,9 @@ done &
if [ -f ${PATHBIN}/rc.news.local ] ; then
${PATHBIN}/rc.news.local start
fi
+
+if [ "$NOTIFY_SOCKET" -o "$LISTEN_PID" ]; then
+ echo 'Starting innd.'
+ eval exec ${WHAT} -f ${RFLAG} ${INNFLAGS}
+fi
+