moved from misc. On 2016-01-28, Antoine Jacoutot <ajacou...@bsdfrog.org> wrote: >> Well, we "tradionally" had setproctitle("[priv]") in the parent. I >> changed the tradition to setproctitle("parent"). >> >> I have no objections with changing this in the parent (but keeping the >> setproctitles in the children) to either the default (all command line >> flags) or to something like setproctitle("parent, %s", conffile). >> Command line flags suck and I don't think that -d or -v would be >> helpful in the output, so I prefer the latter. > > "-v" is helpful at least for rc.d which needs to match the full args list by > default > >> All rc scripts would have to be adjusted by somebody with better rc-fu. > > Actually if things are properly done, the non default pexp line in the rc.d > scripts should just be removed and that's it. >
Here it is for the majority of base daemons. I've left ypldap for now, the rc script matches "ldap client" not "parent". radiusd already leaves the parent process title as-is (the setproctitle("[main]") are separate processes). OK? Index: etc/rc.d/eigrpd =================================================================== RCS file: /cvs/src/etc/rc.d/eigrpd,v retrieving revision 1.2 diff -u -p -r1.2 eigrpd --- etc/rc.d/eigrpd 21 Oct 2015 11:28:02 -0000 1.2 +++ etc/rc.d/eigrpd 1 Feb 2016 13:51:58 -0000 @@ -6,6 +6,4 @@ daemon="/usr/sbin/eigrpd" . /etc/rc.d/rc.subr -pexp="eigrpd: parent.*" - rc_cmd $1 Index: etc/rc.d/httpd =================================================================== RCS file: /cvs/src/etc/rc.d/httpd,v retrieving revision 1.4 diff -u -p -r1.4 httpd --- etc/rc.d/httpd 19 Dec 2015 13:45:12 -0000 1.4 +++ etc/rc.d/httpd 1 Feb 2016 13:51:58 -0000 @@ -6,8 +6,6 @@ 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} Index: etc/rc.d/ldpd =================================================================== RCS file: /cvs/src/etc/rc.d/ldpd,v retrieving revision 1.1 diff -u -p -r1.1 ldpd --- etc/rc.d/ldpd 6 Jul 2011 18:55:36 -0000 1.1 +++ etc/rc.d/ldpd 1 Feb 2016 13:51:58 -0000 @@ -6,6 +6,4 @@ daemon="/usr/sbin/ldpd" . /etc/rc.d/rc.subr -pexp="ldpd: parent.*" - rc_cmd $1 Index: etc/rc.d/npppd =================================================================== RCS file: /cvs/src/etc/rc.d/npppd,v retrieving revision 1.1 diff -u -p -r1.1 npppd --- etc/rc.d/npppd 20 Sep 2012 12:51:43 -0000 1.1 +++ etc/rc.d/npppd 1 Feb 2016 13:51:58 -0000 @@ -6,6 +6,4 @@ daemon="/usr/sbin/npppd" . /etc/rc.d/rc.subr -pexp="npppd: main" - rc_cmd $1 Index: etc/rc.d/ntpd =================================================================== RCS file: /cvs/src/etc/rc.d/ntpd,v retrieving revision 1.2 diff -u -p -r1.2 ntpd --- etc/rc.d/ntpd 14 Sep 2011 02:36:09 -0000 1.2 +++ etc/rc.d/ntpd 1 Feb 2016 13:51:58 -0000 @@ -6,7 +6,6 @@ daemon="/usr/sbin/ntpd" . /etc/rc.d/rc.subr -pexp="ntpd: \[priv\]" rc_reload=NO rc_cmd $1 Index: etc/rc.d/ospf6d =================================================================== RCS file: /cvs/src/etc/rc.d/ospf6d,v retrieving revision 1.1 diff -u -p -r1.1 ospf6d --- etc/rc.d/ospf6d 17 Jul 2011 00:25:58 -0000 1.1 +++ etc/rc.d/ospf6d 1 Feb 2016 13:51:58 -0000 @@ -6,6 +6,4 @@ daemon="/usr/sbin/ospf6d" . /etc/rc.d/rc.subr -pexp="ospf6d: parent.*" - rc_cmd $1 Index: etc/rc.d/ospfd =================================================================== RCS file: /cvs/src/etc/rc.d/ospfd,v retrieving revision 1.1 diff -u -p -r1.1 ospfd --- etc/rc.d/ospfd 8 Jul 2011 22:20:07 -0000 1.1 +++ etc/rc.d/ospfd 1 Feb 2016 13:51:58 -0000 @@ -6,6 +6,4 @@ daemon="/usr/sbin/ospfd" . /etc/rc.d/rc.subr -pexp="ospfd: parent.*" - rc_cmd $1 Index: etc/rc.d/relayd =================================================================== RCS file: /cvs/src/etc/rc.d/relayd,v retrieving revision 1.2 diff -u -p -r1.2 relayd --- etc/rc.d/relayd 19 Dec 2015 13:45:12 -0000 1.2 +++ etc/rc.d/relayd 1 Feb 2016 13:51:58 -0000 @@ -6,8 +6,6 @@ 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} Index: etc/rc.d/ripd =================================================================== RCS file: /cvs/src/etc/rc.d/ripd,v retrieving revision 1.1 diff -u -p -r1.1 ripd --- etc/rc.d/ripd 6 Jul 2011 18:55:36 -0000 1.1 +++ etc/rc.d/ripd 1 Feb 2016 13:51:58 -0000 @@ -6,6 +6,4 @@ daemon="/usr/sbin/ripd" . /etc/rc.d/rc.subr -pexp="ripd: parent.*" - rc_cmd $1 Index: etc/rc.d/snmpd =================================================================== RCS file: /cvs/src/etc/rc.d/snmpd,v retrieving revision 1.2 diff -u -p -r1.2 snmpd --- etc/rc.d/snmpd 25 Aug 2014 12:08:55 -0000 1.2 +++ etc/rc.d/snmpd 1 Feb 2016 13:51:58 -0000 @@ -6,7 +6,6 @@ daemon="/usr/sbin/snmpd" . /etc/rc.d/rc.subr -pexp="snmpd: parent.*" rc_reload=NO rc_cmd $1 Index: etc/rc.d/vmd =================================================================== RCS file: /cvs/src/etc/rc.d/vmd,v retrieving revision 1.3 diff -u -p -r1.3 vmd --- etc/rc.d/vmd 19 Dec 2015 13:45:12 -0000 1.3 +++ etc/rc.d/vmd 1 Feb 2016 13:51:58 -0000 @@ -6,8 +6,6 @@ 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} Index: usr.sbin/bgpd/bgpd.c =================================================================== RCS file: /cvs/src/usr.sbin/bgpd/bgpd.c,v retrieving revision 1.183 diff -u -p -r1.183 bgpd.c --- usr.sbin/bgpd/bgpd.c 27 Nov 2015 21:41:30 -0000 1.183 +++ usr.sbin/bgpd/bgpd.c 1 Feb 2016 13:51:58 -0000 @@ -214,8 +214,6 @@ main(int argc, char *argv[]) io_pid = start_child(PROC_SE, saved_argv0, pipe_m2s[1], debug, cmd_opts & BGPD_OPT_VERBOSE); - setproctitle("parent"); - signal(SIGTERM, sighdlr); signal(SIGINT, sighdlr); signal(SIGCHLD, sighdlr); Index: usr.sbin/dvmrpd/dvmrpd.c =================================================================== RCS file: /cvs/src/usr.sbin/dvmrpd/dvmrpd.c,v retrieving revision 1.20 diff -u -p -r1.20 dvmrpd.c --- usr.sbin/dvmrpd/dvmrpd.c 5 Dec 2015 13:11:00 -0000 1.20 +++ usr.sbin/dvmrpd/dvmrpd.c 1 Feb 2016 13:51:58 -0000 @@ -231,9 +231,6 @@ main(int argc, char *argv[]) if (mrt_init(conf->mroute_socket)) fatal("multicast routing not enabled in kernel"); - /* show who we are */ - setproctitle("parent"); - event_init(); /* setup signal handler */ Index: usr.sbin/eigrpd/eigrpd.c =================================================================== RCS file: /cvs/src/usr.sbin/eigrpd/eigrpd.c,v retrieving revision 1.4 diff -u -p -r1.4 eigrpd.c --- usr.sbin/eigrpd/eigrpd.c 5 Dec 2015 15:49:01 -0000 1.4 +++ usr.sbin/eigrpd/eigrpd.c 1 Feb 2016 13:51:58 -0000 @@ -227,9 +227,6 @@ main(int argc, char *argv[]) eigrpe_pid = eigrpe(eigrpd_conf, pipe_parent2eigrpe, pipe_eigrpe2rde, pipe_parent2rde); - /* show who we are */ - setproctitle("parent"); - event_init(); /* setup signal handler */ Index: usr.sbin/hostapd/privsep.c =================================================================== RCS file: /cvs/src/usr.sbin/hostapd/privsep.c,v retrieving revision 1.24 diff -u -p -r1.24 privsep.c --- usr.sbin/hostapd/privsep.c 16 Jan 2015 06:40:17 -0000 1.24 +++ usr.sbin/hostapd/privsep.c 1 Feb 2016 13:51:58 -0000 @@ -170,8 +170,6 @@ hostapd_priv_init(struct hostapd_config hostapd_roaming_init(cfg); - setproctitle("[priv]"); - /* Start a new event listener */ event_set(&cfg->c_priv_ev, socks[0], EV_READ, hostapd_priv, cfg); if (event_add(&cfg->c_priv_ev, NULL) == -1) Index: usr.sbin/httpd/httpd.c =================================================================== RCS file: /cvs/src/usr.sbin/httpd/httpd.c,v retrieving revision 1.53 diff -u -p -r1.53 httpd.c --- usr.sbin/httpd/httpd.c 3 Dec 2015 11:46:25 -0000 1.53 +++ usr.sbin/httpd/httpd.c 1 Feb 2016 13:51:58 -0000 @@ -247,8 +247,6 @@ main(int argc, char *argv[]) } proc_init(ps, procs, nitems(procs)); - - setproctitle("parent"); log_procinit("parent"); if (pledge("stdio rpath wpath cpath inet dns proc ioctl sendfd", Index: usr.sbin/ldpd/ldpd.c =================================================================== RCS file: /cvs/src/usr.sbin/ldpd/ldpd.c,v retrieving revision 1.27 diff -u -p -r1.27 ldpd.c --- usr.sbin/ldpd/ldpd.c 5 Dec 2015 13:11:48 -0000 1.27 +++ usr.sbin/ldpd/ldpd.c 1 Feb 2016 13:51:58 -0000 @@ -206,9 +206,6 @@ main(int argc, char *argv[]) ldpe_pid = ldpe(ldpd_conf, pipe_parent2ldpe, pipe_ldpe2lde, pipe_parent2lde); - /* show who we are */ - setproctitle("parent"); - event_init(); /* setup signal handler */ Index: usr.sbin/ntpd/ntpd.c =================================================================== RCS file: /cvs/src/usr.sbin/ntpd/ntpd.c,v retrieving revision 1.105 diff -u -p -r1.105 ntpd.c --- usr.sbin/ntpd/ntpd.c 27 Jan 2016 21:48:34 -0000 1.105 +++ usr.sbin/ntpd/ntpd.c 1 Feb 2016 13:51:58 -0000 @@ -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(); Index: usr.sbin/ospf6d/ospf6d.c =================================================================== RCS file: /cvs/src/usr.sbin/ospf6d/ospf6d.c,v retrieving revision 1.29 diff -u -p -r1.29 ospf6d.c --- usr.sbin/ospf6d/ospf6d.c 5 Dec 2015 13:12:41 -0000 1.29 +++ usr.sbin/ospf6d/ospf6d.c 1 Feb 2016 13:51:58 -0000 @@ -240,9 +240,6 @@ main(int argc, char *argv[]) ospfe_pid = ospfe(ospfd_conf, pipe_parent2ospfe, pipe_ospfe2rde, pipe_parent2rde); - /* show who we are */ - setproctitle("parent"); - event_init(); /* setup signal handler */ Index: usr.sbin/ospfd/ospfd.c =================================================================== RCS file: /cvs/src/usr.sbin/ospfd/ospfd.c,v retrieving revision 1.88 diff -u -p -r1.88 ospfd.c --- usr.sbin/ospfd/ospfd.c 5 Dec 2015 12:20:13 -0000 1.88 +++ usr.sbin/ospfd/ospfd.c 1 Feb 2016 13:51:58 -0000 @@ -243,9 +243,6 @@ main(int argc, char *argv[]) ospfe_pid = ospfe(ospfd_conf, pipe_parent2ospfe, pipe_ospfe2rde, pipe_parent2rde); - /* show who we are */ - setproctitle("parent"); - event_init(); /* setup signal handler */ Index: usr.sbin/relayd/relayd.c =================================================================== RCS file: /cvs/src/usr.sbin/relayd/relayd.c,v retrieving revision 1.152 diff -u -p -r1.152 relayd.c --- usr.sbin/relayd/relayd.c 30 Dec 2015 16:00:57 -0000 1.152 +++ usr.sbin/relayd/relayd.c 1 Feb 2016 13:51:58 -0000 @@ -244,8 +244,6 @@ main(int argc, char *argv[]) ps->ps_ninstances = env->sc_prefork_relay; proc_init(ps, procs, nitems(procs)); - - setproctitle("parent"); log_procinit("parent"); event_init(); Index: usr.sbin/ripd/ripd.c =================================================================== RCS file: /cvs/src/usr.sbin/ripd/ripd.c,v retrieving revision 1.26 diff -u -p -r1.26 ripd.c --- usr.sbin/ripd/ripd.c 5 Dec 2015 13:13:47 -0000 1.26 +++ usr.sbin/ripd/ripd.c 1 Feb 2016 13:51:58 -0000 @@ -221,9 +221,6 @@ main(int argc, char *argv[]) rde_pid = rde(conf, pipe_parent2rde, pipe_ripe2rde, pipe_parent2ripe); ripe_pid = ripe(conf, pipe_parent2ripe, pipe_ripe2rde, pipe_parent2rde); - /* show who we are */ - setproctitle("parent"); - event_init(); /* setup signal handler */ Index: usr.sbin/snmpd/snmpd.c =================================================================== RCS file: /cvs/src/usr.sbin/snmpd/snmpd.c,v retrieving revision 1.31 diff -u -p -r1.31 snmpd.c --- usr.sbin/snmpd/snmpd.c 23 Nov 2015 19:31:52 -0000 1.31 +++ usr.sbin/snmpd/snmpd.c 1 Feb 2016 13:51:58 -0000 @@ -217,9 +217,7 @@ main(int argc, char *argv[]) ps->ps_ninstances = 1; proc_init(ps, procs, nitems(procs)); - setproctitle("parent"); log_procinit("parent"); - log_info("startup"); event_init(); Index: usr.sbin/vmd/vmd.c =================================================================== RCS file: /cvs/src/usr.sbin/vmd/vmd.c,v retrieving revision 1.25 diff -u -p -r1.25 vmd.c --- usr.sbin/vmd/vmd.c 11 Dec 2015 10:16:53 -0000 1.25 +++ usr.sbin/vmd/vmd.c 1 Feb 2016 13:51:58 -0000 @@ -369,7 +369,6 @@ main(int argc, char **argv) if (!env->vmd_debug && daemon(0, 0) == -1) fatal("can't daemonize"); - setproctitle("parent"); log_procinit("parent"); ps->ps_ninstances = 1; Index: usr.sbin/npppd/npppd/privsep.c =================================================================== RCS file: /cvs/src/usr.sbin/npppd/npppd/privsep.c,v retrieving revision 1.20 diff -u -p -r1.20 privsep.c --- usr.sbin/npppd/npppd/privsep.c 5 Dec 2015 18:43:36 -0000 1.20 +++ usr.sbin/npppd/npppd/privsep.c 1 Feb 2016 13:51:59 -0000 @@ -188,7 +188,6 @@ privsep_init(void) _exit(0); /* NOTREACHED */ } - setproctitle("main"); close(pairsock[0]); privsep_sock = pairsock[1]; privsep_pid = pid;