From 09f6f3d055ea17332593e6a3cbfb1fa02b80d4b9 Mon Sep 17 00:00:00 2001 From: ajacoutot <> Date: Tue, 26 Apr 2016 16:39:59 +0000 Subject: [PATCH] Extend _RC_RUNFILE (/var/run/rc.d/scriptname) content with: daemon_class, daemon_flags, daemon_timeout, daemon_user, pexp Add "pexp" as a valid variable to _rc_parse_conf() and sort the list while here. Besides having an easy way to see how a daemon was started exactly, it opens the door to rdomain/rtable support in rc.d(8). We need to have as much information on a daemon as possible if we want to target a specific rtable (using -T) and it also makes it easier to start multiple instances of the same daemon with similar flags as a different user... Of course that only works with rc.d scripts *not* overwritting the default rc_* functions. Man page tweaks coming later. discussed with and ok robert@ --- src/etc/rc.d/rc.subr | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/etc/rc.d/rc.subr b/src/etc/rc.d/rc.subr index cd083d14..83dc0251 100644 --- a/src/etc/rc.d/rc.subr +++ b/src/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.107 2016/03/26 13:59:36 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.108 2016/04/26 16:39:59 ajacoutot Exp $ # # Copyright (c) 2010, 2011, 2014, 2015 Antoine Jacoutot # Copyright (c) 2010, 2011 Ingo Schwarze @@ -46,13 +46,13 @@ _rc_usage() { _rc_write_runfile() { [ -d ${_RC_RUNDIR} ] || mkdir -p ${_RC_RUNDIR} && \ - print -rn -- "${pexp}" > ${_RC_RUNFILE} -} - -_rc_read_runfile() { - local _new_pexp - [ -f ${_RC_RUNFILE} ] && _new_pexp=$(< ${_RC_RUNFILE}) - [ -n "${_new_pexp}" ] && pexp="${_new_pexp}" + cat >${_RC_RUNFILE} <