From 9e0f589208c14cede61b899523f12b221b28963d Mon Sep 17 00:00:00 2001 From: reyk <> Date: Thu, 6 Oct 2016 20:20:41 +0000 Subject: [PATCH] Add switchd OK deraadt@ --- src/etc/Makefile | 4 ++-- src/etc/changelist | 3 ++- src/etc/mail/aliases | 3 ++- src/etc/master.passwd | 1 + src/etc/rc | 4 ++-- src/etc/rc.conf | 3 ++- src/etc/rc.d/switchd | 14 ++++++++++++++ 7 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 src/etc/rc.d/switchd diff --git a/src/etc/Makefile b/src/etc/Makefile index 55349ee9..0a57bc7a 100644 --- a/src/etc/Makefile +++ b/src/etc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.439 2016/10/06 18:56:17 natano Exp $ +# $OpenBSD: Makefile,v 1.440 2016/10/06 20:20:41 reyk Exp $ TZDIR= /usr/share/zoneinfo LOCALTIME= Canada/Mountain @@ -54,7 +54,7 @@ RCDAEMONS=amd apmd bgpd bootparamd cron dhcpd dhcrelay dvmrpd eigrpd ftpd \ lpd mopd mountd mrouted nfsd npppd nsd ntpd ospf6d ospfd \ pflogd portmap radiusd rarpd rbootd rebound relayd ripd route6d \ rtadvd sasyncd sensorsd slowcgi smtpd sndiod snmpd spamd \ - spamlogd sshd statd syslogd tftpd tftpproxy unbound \ + spamlogd sshd statd switchd syslogd tftpd tftpproxy unbound \ vmd watchdogd wsmoused xdm ypbind ypldap ypserv MISETS= base${OSrev}.tgz comp${OSrev}.tgz man${OSrev}.tgz game${OSrev}.tgz diff --git a/src/etc/changelist b/src/etc/changelist index 56ffc279..6352b9bc 100644 --- a/src/etc/changelist +++ b/src/etc/changelist @@ -1,4 +1,4 @@ -# $OpenBSD: changelist,v 1.113 2016/09/26 06:51:23 ajacoutot Exp $ +# $OpenBSD: changelist,v 1.114 2016/10/06 20:20:41 reyk Exp $ # # List of files which the security script backs up and checks # for modifications. @@ -132,6 +132,7 @@ /etc/suid_profile /etc/sysctl.conf /etc/syslog.conf +/etc/switchd.conf /etc/sysmerge.ignore /etc/ttys /etc/usermgmt.conf diff --git a/src/etc/mail/aliases b/src/etc/mail/aliases index 3cb44a77..0d03e65a 100644 --- a/src/etc/mail/aliases +++ b/src/etc/mail/aliases @@ -1,5 +1,5 @@ # -# $OpenBSD: aliases,v 1.59 2016/09/27 05:31:37 florian Exp $ +# $OpenBSD: aliases,v 1.60 2016/10/06 20:20:41 reyk Exp $ # # Aliases in this file will NOT be expanded in the header from # Mail, but WILL be visible over networks or from /usr/libexec/mail.local. @@ -63,6 +63,7 @@ _smtpq: /dev/null _sndio: /dev/null _snmpd: /dev/null _spamd: /dev/null +_switchd: /dev/null _syslogd: /dev/null _tcpdump: /dev/null _traceroute: /dev/null diff --git a/src/etc/master.passwd b/src/etc/master.passwd index 82aa4e96..3f4a17e5 100644 --- a/src/etc/master.passwd +++ b/src/etc/master.passwd @@ -58,4 +58,5 @@ _vmd:*:107:107::0:0:VM Daemon:/var/empty:/sbin/nologin _tftp_proxy:*:108:108::0:0:tftp proxy daemon:/nonexistent:/sbin/nologin _ftp_proxy:*:109:109::0:0:ftp proxy daemon:/nonexistent:/sbin/nologin _sndiop:*:110:110::0:0:sndio privileged user:/var/empty:/sbin/nologin +_switchd:*:111:111::0:0:Switch Daemon:/var/empty:/sbin/nologin nobody:*:32767:32767::0:0:Unprivileged user:/nonexistent:/sbin/nologin diff --git a/src/etc/rc b/src/etc/rc index e9f6a702..4ce80b09 100644 --- a/src/etc/rc +++ b/src/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.488 2016/10/06 19:32:23 reyk Exp $ +# $OpenBSD: rc,v 1.489 2016/10/06 20:20:41 reyk Exp $ # System startup script run by init on autoboot or after single-user. # Output and error are redirected to console by init, and the console is the @@ -527,7 +527,7 @@ echo 'preserving editor files.'; /usr/libexec/vi.recover run_upgrade_script sysmerge echo -n 'starting network daemons:' -start_daemon ldomd sshd snmpd ldpd ripd ospfd ospf6d bgpd ifstated +start_daemon ldomd sshd switchd snmpd ldpd ripd ospfd ospf6d bgpd ifstated start_daemon relayd dhcpd dhcrelay mrouted dvmrpd radiusd eigrpd if ifconfig lo0 inet6 >/dev/null 2>&1; then diff --git a/src/etc/rc.conf b/src/etc/rc.conf index 0c948b9a..00619d21 100644 --- a/src/etc/rc.conf +++ b/src/etc/rc.conf @@ -1,4 +1,4 @@ -# $OpenBSD: rc.conf,v 1.211 2015/12/06 13:51:41 rpe Exp $ +# $OpenBSD: rc.conf,v 1.212 2016/10/06 20:20:41 reyk Exp $ # DO NOT EDIT THIS FILE!! # @@ -64,6 +64,7 @@ snmpd_flags=NO spamd_flags=NO # also see spamd_black below spamlogd_flags= # use eg. "-i interface" and see spamlogd(8) sshd_flags= +switchd_flags=NO syslogd_flags= # add more flags, e.g. "-u -a /chroot/dev/log" tftpd_flags=NO tftpproxy_flags=NO diff --git a/src/etc/rc.d/switchd b/src/etc/rc.d/switchd new file mode 100644 index 00000000..468ec70d --- /dev/null +++ b/src/etc/rc.d/switchd @@ -0,0 +1,14 @@ +#!/bin/sh +# +# $OpenBSD: switchd,v 1.1 2016/10/06 20:20:41 reyk Exp $ + +daemon="/usr/sbin/switchd" + +. /etc/rc.d/rc.subr + +# child will not return a config loading error to the parent +rc_pre() { + ${daemon} -n ${daemon_flags} +} + +rc_cmd $1