From 4114667275dcf157ef3f4efbb76bebeba8fe25ff Mon Sep 17 00:00:00 2001 From: sthen <> Date: Tue, 2 Feb 2016 17:51:11 +0000 Subject: [PATCH] Remove setproctitle() for the parent process. Because rc.d(8) uses process titles (including flags) to distinguish between daemons, this makes it possible to manage multiple copies of a daemon using the normal infrastructure by symlinking rc.d scripts to a new name. ok jung@ ajacoutot@, smtpd ok gilles@ --- src/etc/rc.d/eigrpd | 4 +--- src/etc/rc.d/httpd | 4 +--- src/etc/rc.d/ldpd | 4 +--- src/etc/rc.d/npppd | 4 +--- src/etc/rc.d/ntpd | 3 +-- src/etc/rc.d/ospf6d | 4 +--- src/etc/rc.d/ospfd | 4 +--- src/etc/rc.d/relayd | 4 +--- src/etc/rc.d/ripd | 4 +--- src/etc/rc.d/smtpd | 3 +-- src/etc/rc.d/snmpd | 3 +-- src/etc/rc.d/vmd | 4 +--- src/usr.sbin/ntpd/ntpd.c | 3 +-- 13 files changed, 13 insertions(+), 35 deletions(-) diff --git a/src/etc/rc.d/eigrpd b/src/etc/rc.d/eigrpd index b0bbb1d5..f6e71c1a 100644 --- a/src/etc/rc.d/eigrpd +++ b/src/etc/rc.d/eigrpd @@ -1,11 +1,9 @@ #!/bin/sh # -# $OpenBSD: eigrpd,v 1.2 2015/10/21 11:28:02 gsoares Exp $ +# $OpenBSD: eigrpd,v 1.3 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/eigrpd" . /etc/rc.d/rc.subr -pexp="eigrpd: parent.*" - rc_cmd $1 diff --git a/src/etc/rc.d/httpd b/src/etc/rc.d/httpd index 50be2367..3bfc63c1 100644 --- a/src/etc/rc.d/httpd +++ b/src/etc/rc.d/httpd @@ -1,13 +1,11 @@ #!/bin/sh # -# $OpenBSD: httpd,v 1.4 2015/12/19 13:45:12 ajacoutot Exp $ +# $OpenBSD: httpd,v 1.5 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/httpd" . /etc/rc.d/rc.subr -pexp="httpd: parent.*" - # child will not return a config parsing error to the parent rc_pre() { ${daemon} -n ${daemon_flags} diff --git a/src/etc/rc.d/ldpd b/src/etc/rc.d/ldpd index 9ea10b42..b043b1c3 100644 --- a/src/etc/rc.d/ldpd +++ b/src/etc/rc.d/ldpd @@ -1,11 +1,9 @@ #!/bin/sh # -# $OpenBSD: ldpd,v 1.1 2011/07/06 18:55:36 robert Exp $ +# $OpenBSD: ldpd,v 1.2 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/ldpd" . /etc/rc.d/rc.subr -pexp="ldpd: parent.*" - rc_cmd $1 diff --git a/src/etc/rc.d/npppd b/src/etc/rc.d/npppd index fb8ffd1d..f364d314 100644 --- a/src/etc/rc.d/npppd +++ b/src/etc/rc.d/npppd @@ -1,11 +1,9 @@ #!/bin/sh # -# $OpenBSD: npppd,v 1.1 2012/09/20 12:51:43 yasuoka Exp $ +# $OpenBSD: npppd,v 1.2 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/npppd" . /etc/rc.d/rc.subr -pexp="npppd: main" - rc_cmd $1 diff --git a/src/etc/rc.d/ntpd b/src/etc/rc.d/ntpd index b706a605..5b95bc14 100644 --- a/src/etc/rc.d/ntpd +++ b/src/etc/rc.d/ntpd @@ -1,12 +1,11 @@ #!/bin/sh # -# $OpenBSD: ntpd,v 1.2 2011/09/14 02:36:09 william Exp $ +# $OpenBSD: ntpd,v 1.3 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/ntpd" . /etc/rc.d/rc.subr -pexp="ntpd: \[priv\]" rc_reload=NO rc_cmd $1 diff --git a/src/etc/rc.d/ospf6d b/src/etc/rc.d/ospf6d index aee5c402..c21a881b 100644 --- a/src/etc/rc.d/ospf6d +++ b/src/etc/rc.d/ospf6d @@ -1,11 +1,9 @@ #!/bin/sh # -# $OpenBSD: ospf6d,v 1.1 2011/07/17 00:25:58 david Exp $ +# $OpenBSD: ospf6d,v 1.2 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/ospf6d" . /etc/rc.d/rc.subr -pexp="ospf6d: parent.*" - rc_cmd $1 diff --git a/src/etc/rc.d/ospfd b/src/etc/rc.d/ospfd index 2120468e..a867d35b 100644 --- a/src/etc/rc.d/ospfd +++ b/src/etc/rc.d/ospfd @@ -1,11 +1,9 @@ #!/bin/sh # -# $OpenBSD: ospfd,v 1.1 2011/07/08 22:20:07 deraadt Exp $ +# $OpenBSD: ospfd,v 1.2 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/ospfd" . /etc/rc.d/rc.subr -pexp="ospfd: parent.*" - rc_cmd $1 diff --git a/src/etc/rc.d/relayd b/src/etc/rc.d/relayd index 07b7971e..883775a9 100644 --- a/src/etc/rc.d/relayd +++ b/src/etc/rc.d/relayd @@ -1,13 +1,11 @@ #!/bin/sh # -# $OpenBSD: relayd,v 1.2 2015/12/19 13:45:12 ajacoutot Exp $ +# $OpenBSD: relayd,v 1.3 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/relayd" . /etc/rc.d/rc.subr -pexp="relayd: parent.*" - # child will not return a config parsing error to the parent rc_pre() { ${daemon} -n ${daemon_flags} diff --git a/src/etc/rc.d/ripd b/src/etc/rc.d/ripd index 8eec7370..83ff7802 100644 --- a/src/etc/rc.d/ripd +++ b/src/etc/rc.d/ripd @@ -1,11 +1,9 @@ #!/bin/sh # -# $OpenBSD: ripd,v 1.1 2011/07/06 18:55:36 robert Exp $ +# $OpenBSD: ripd,v 1.2 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/ripd" . /etc/rc.d/rc.subr -pexp="ripd: parent.*" - rc_cmd $1 diff --git a/src/etc/rc.d/smtpd b/src/etc/rc.d/smtpd index 2696455e..e8d0325f 100644 --- a/src/etc/rc.d/smtpd +++ b/src/etc/rc.d/smtpd @@ -1,12 +1,11 @@ #!/bin/sh # -# $OpenBSD: smtpd,v 1.5 2015/12/26 09:55:15 ajacoutot Exp $ +# $OpenBSD: smtpd,v 1.6 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/smtpd" . /etc/rc.d/rc.subr -pexp="smtpd: \[priv\]" rc_reload=NO rc_cmd $1 diff --git a/src/etc/rc.d/snmpd b/src/etc/rc.d/snmpd index ae8f1a39..aba68612 100644 --- a/src/etc/rc.d/snmpd +++ b/src/etc/rc.d/snmpd @@ -1,12 +1,11 @@ #!/bin/sh # -# $OpenBSD: snmpd,v 1.2 2014/08/25 12:08:55 halex Exp $ +# $OpenBSD: snmpd,v 1.3 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/snmpd" . /etc/rc.d/rc.subr -pexp="snmpd: parent.*" rc_reload=NO rc_cmd $1 diff --git a/src/etc/rc.d/vmd b/src/etc/rc.d/vmd index a86631a4..4d0b0a02 100644 --- a/src/etc/rc.d/vmd +++ b/src/etc/rc.d/vmd @@ -1,13 +1,11 @@ #!/bin/sh # -# $OpenBSD: vmd,v 1.3 2015/12/19 13:45:12 ajacoutot Exp $ +# $OpenBSD: vmd,v 1.4 2016/02/02 17:51:11 sthen Exp $ daemon="/usr/sbin/vmd" . /etc/rc.d/rc.subr -pexp="vmd: parent.*" - # child will not return a config parsing error to the parent rc_pre() { ${daemon} -n ${daemon_flags} diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c index fe79f6d9..914027d8 100644 --- a/src/usr.sbin/ntpd/ntpd.c +++ b/src/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.105 2016/01/27 21:48:34 reyk Exp $ */ +/* $OpenBSD: ntpd.c,v 1.106 2016/02/02 17:51:11 sthen Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -210,7 +210,6 @@ main(int argc, char *argv[]) /* fork child process */ chld_pid = ntp_main(pipe_chld, fd_ctl, &lconf, pw); - setproctitle("[priv]"); log_procinit("[priv]"); readfreq();