summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorajacoutot <ajacoutot@openbsd.org>2021-02-27 09:28:04 +0000
committerajacoutot <ajacoutot@openbsd.org>2021-02-27 09:28:04 +0000
commit9cd4f3a55f2a6d6f69c7b6d26e397c1a5e05f45c (patch)
tree66691c3b8864b04b608704fad1cfad919361b9e7 /share
parenttrim some code i accidentally left into the nvgre add address function (diff)
downloadwireguard-openbsd-9cd4f3a55f2a6d6f69c7b6d26e397c1a5e05f45c.tar.xz
wireguard-openbsd-9cd4f3a55f2a6d6f69c7b6d26e397c1a5e05f45c.zip
Add logger(1) support for daemons that are logging to stdout/stderr (mostly from
the go ecosystem). Properly handle failing daemon startup now that we have pipefail. To take advantage of this new feature, just add foo_logger=facility to the daemon rc.d(8) script or in rc.conf.local(8) or use rcctl: rcctl set foo logger daemon.info tweak for checking flags in rcctl(8) from martijn@ "this looks pretty good" deraadt@ ok sthen@
Diffstat (limited to 'share')
-rw-r--r--share/man/man8/rc.d.89
-rw-r--r--share/man/man8/rc.subr.811
2 files changed, 16 insertions, 4 deletions
diff --git a/share/man/man8/rc.d.8 b/share/man/man8/rc.d.8
index e0af34085ab..95f56725916 100644
--- a/share/man/man8/rc.d.8
+++ b/share/man/man8/rc.d.8
@@ -1,5 +1,6 @@
-.\" $OpenBSD: rc.d.8,v 1.35 2019/08/27 20:05:02 awolk Exp $
+.\" $OpenBSD: rc.d.8,v 1.36 2021/02/27 09:28:05 ajacoutot Exp $
.\"
+.\" Copyright (c) 2021 Antoine Jacoutot
.\" Copyright (c) 2011 Robert Nagy, Antoine Jacoutot, Ingo Schwarze
.\" All rights reserved.
.\"
@@ -24,7 +25,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: August 27 2019 $
+.Dd $Mdocdate: February 27 2021 $
.Dt RC.D 8
.Os
.Sh NAME
@@ -110,6 +111,10 @@ is set to
.Dq NO ,
it will prevent the daemon from starting even when listed in
.Va pkg_scripts .
+.It Ar daemon Ns _logger
+Redirect standard output and error to
+.Xr logger 1
+using the configured priority (e.g. "daemon.info").
.It Ar daemon Ns _rtable
Routing table to run the daemon under, using
.Xr route 8 .
diff --git a/share/man/man8/rc.subr.8 b/share/man/man8/rc.subr.8
index af7bd55226d..27f54bebdbb 100644
--- a/share/man/man8/rc.subr.8
+++ b/share/man/man8/rc.subr.8
@@ -1,5 +1,6 @@
-.\" $OpenBSD: rc.subr.8,v 1.37 2020/02/21 00:47:21 kn Exp $
+.\" $OpenBSD: rc.subr.8,v 1.38 2021/02/27 09:28:05 ajacoutot Exp $
.\"
+.\" Copyright (c) 2021 Antoine Jacoutot
.\" Copyright (c) 2011 Robert Nagy, Antoine Jacoutot, Ingo Schwarze
.\" All rights reserved.
.\"
@@ -24,7 +25,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: February 21 2020 $
+.Dd $Mdocdate: February 27 2021 $
.Dt RC.SUBR 8
.Os
.Sh NAME
@@ -247,6 +248,10 @@ If no such login class exists then
will be used.
.It Va daemon_flags
Arguments to call the daemon with.
+.It Ar daemon Ns _logger
+Redirect standard output and error to
+.Xr logger 1
+using the configured priority (e.g. "daemon.info").
.It Va daemon_rtable
Routing table to run the daemon under, using
.Xr route 8 .
@@ -333,6 +338,7 @@ Global defaults are provided by
.Bd -literal -offset indent
daemon_class=daemon
daemon_flags=
+daemon_logger=
daemon_rtable=0
daemon_timeout=30
daemon_user=root
@@ -352,6 +358,7 @@ site-specific values provided in
.Xr rc.conf.local 8
for
.Va daemon_flags ,
+.Va daemon_logger ,
.Va daemon_rtable ,
.Va daemon_timeout ,
and