From 4b16c051414c735e118926f33401ffdaa60a7396 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Mon, 29 Aug 2022 19:14:25 +0000 Subject: [PATCH] Use rc_configtest. --- etc/rc.d/bgpd | 5 ++--- etc/rc.d/httpd | 5 ++--- etc/rc.d/iked | 10 +++++----- etc/rc.d/nfsd | 3 +-- etc/rc.d/relayd | 5 ++--- etc/rc.d/sshd | 6 +++--- etc/rc.d/vmd | 5 ++--- 7 files changed, 17 insertions(+), 22 deletions(-) diff --git a/etc/rc.d/bgpd b/etc/rc.d/bgpd index 0ad58ea468c..90308f80705 100644 --- a/etc/rc.d/bgpd +++ b/etc/rc.d/bgpd @@ -1,13 +1,12 @@ #!/bin/ksh # -# $OpenBSD: bgpd,v 1.6 2022/05/21 12:42:21 ajacoutot Exp $ +# $OpenBSD: bgpd,v 1.7 2022/08/29 19:14:25 ajacoutot Exp $ daemon="/usr/sbin/bgpd" . /etc/rc.d/rc.subr -# child will not return a config parsing error to the parent -rc_pre() { +rc_configtest() { # use rc_exec here since daemon_flags may contain arguments with spaces rc_exec "${daemon} -n ${daemon_flags}" } diff --git a/etc/rc.d/httpd b/etc/rc.d/httpd index 3747e45418b..c0e1ca53a73 100644 --- a/etc/rc.d/httpd +++ b/etc/rc.d/httpd @@ -1,13 +1,12 @@ #!/bin/ksh # -# $OpenBSD: httpd,v 1.8 2022/05/21 12:42:21 ajacoutot Exp $ +# $OpenBSD: httpd,v 1.9 2022/08/29 19:14:25 ajacoutot Exp $ daemon="/usr/sbin/httpd" . /etc/rc.d/rc.subr -# child will not return a config parsing error to the parent -rc_pre() { +rc_configtest() { # use rc_exec here since daemon_flags may contain arguments with spaces rc_exec "${daemon} -n ${daemon_flags}" } diff --git a/etc/rc.d/iked b/etc/rc.d/iked index 383ffe767e7..8cfb786e6a8 100644 --- a/etc/rc.d/iked +++ b/etc/rc.d/iked @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: iked,v 1.8 2022/05/21 12:42:21 ajacoutot Exp $ +# $OpenBSD: iked,v 1.9 2022/08/29 19:14:25 ajacoutot Exp $ daemon="/sbin/iked" @@ -8,13 +8,13 @@ daemon="/sbin/iked" pexp="iked: parent.*" -# Child will not return a config parsing error to the parent. +rc_configtest() { + # use rc_exec here since daemon_flags may contain arguments with spaces + rc_exec "${daemon} -n ${daemon_flags}" +} rc_pre() { [[ ${sasyncd_flags} != NO ]] && daemon_flags="-S ${daemon_flags}" - - # use rc_exec here since daemon_flags may contain arguments with spaces - rc_exec "${daemon} -n ${daemon_flags}" } rc_cmd $1 diff --git a/etc/rc.d/nfsd b/etc/rc.d/nfsd index 2020f1593ba..8311742a3b6 100644 --- a/etc/rc.d/nfsd +++ b/etc/rc.d/nfsd @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: nfsd,v 1.8 2018/01/11 21:09:26 rpe Exp $ +# $OpenBSD: nfsd,v 1.9 2022/08/29 19:14:25 ajacoutot Exp $ daemon="/sbin/nfsd" daemon_flags="-tun 4" @@ -8,7 +8,6 @@ daemon_flags="-tun 4" . /etc/rc.d/rc.subr pexp="(${daemon}( |$)|nfsd: (master|server)$)" - rc_reload=NO rc_pre() { diff --git a/etc/rc.d/relayd b/etc/rc.d/relayd index 0548ac538ca..d5b3bdc59a4 100644 --- a/etc/rc.d/relayd +++ b/etc/rc.d/relayd @@ -1,13 +1,12 @@ #!/bin/ksh # -# $OpenBSD: relayd,v 1.7 2022/05/21 12:42:21 ajacoutot Exp $ +# $OpenBSD: relayd,v 1.8 2022/08/29 19:14:25 ajacoutot Exp $ daemon="/usr/sbin/relayd" . /etc/rc.d/rc.subr -# Child will not return a config parsing error to the parent. -rc_pre() { +rc_configtest() { # use rc_exec here since daemon_flags may contain arguments with spaces rc_exec "${daemon} -n ${daemon_flags}" } diff --git a/etc/rc.d/sshd b/etc/rc.d/sshd index 94cc554a9ed..ac726779a65 100644 --- a/etc/rc.d/sshd +++ b/etc/rc.d/sshd @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: sshd,v 1.6 2020/01/25 12:05:08 sthen Exp $ +# $OpenBSD: sshd,v 1.7 2022/08/29 19:14:25 ajacoutot Exp $ daemon="/usr/sbin/sshd" @@ -8,8 +8,8 @@ daemon="/usr/sbin/sshd" pexp="sshd: ${daemon}${daemon_flags:+ ${daemon_flags}} \[listener\].*" -rc_reload() { - ${daemon} ${daemon_flags} -t && pkill -HUP -xf "${pexp}" +rc_configtest() { + ${daemon} ${daemon_flags} -t } rc_cmd $1 diff --git a/etc/rc.d/vmd b/etc/rc.d/vmd index 2356ecf6f5e..00cfc8dfc3f 100644 --- a/etc/rc.d/vmd +++ b/etc/rc.d/vmd @@ -1,13 +1,12 @@ #!/bin/ksh # -# $OpenBSD: vmd,v 1.11 2022/05/21 12:42:21 ajacoutot Exp $ +# $OpenBSD: vmd,v 1.12 2022/08/29 19:14:25 ajacoutot Exp $ daemon="/usr/sbin/vmd" . /etc/rc.d/rc.subr -# Child will not return a config parsing error to the parent. -rc_pre() { +rc_configtest() { # use rc_exec here since daemon_flags may contain arguments with spaces rc_exec "${daemon} -n ${daemon_flags}" } -- 2.20.1