-.\" $OpenBSD: rcctl.8,v 1.5 2014/08/21 12:47:22 ajacoutot Exp $
+.\" $OpenBSD: rcctl.8,v 1.6 2014/08/24 07:33:26 ajacoutot Exp $
.\"
.\" Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 21 2014 $
+.Dd $Mdocdate: August 24 2014 $
.Dt RCCTL 8
.Os
.Sh NAME
.Nd configure and control daemons and services
.Sh SYNOPSIS
.Nm rcctl
+.Op Fl df
.Sm off
.Cm enable | disable | status | Ar action
.Sm on
.Ar daemon Ns _flags
with their values in a format compatible with
.Xr rc.conf 8 .
-.It Ar action daemon
+.It Oo Fl df Oc Ar action daemon
Run the
.Xr rc.d 8
.Ar daemon
script with the
.Ar action
-argument.
+argument, passing through the specified options, if any.
.El
.Sh EXIT STATUS
.Nm Ar action
#!/bin/sh
#
-# $OpenBSD: rcctl.sh,v 1.11 2014/08/21 14:26:16 jsg Exp $
+# $OpenBSD: rcctl.sh,v 1.12 2014/08/24 07:33:26 ajacoutot Exp $
#
# Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
#
usage()
{
- _rc_err "usage: ${0##*/} enable|disable|status|action [service | daemon [flags [...]]]"
+ _rc_err "usage: ${0##*/} [-df] enable|disable|status|action [service | daemon [flags [...]]]"
}
needs_root()
rcconf_edit_end
}
+unset _RC_DEBUG _RC_FORCE
+while getopts "df" c; do
+ case "$c" in
+ d) _RC_DEBUG=-d;;
+ f) _RC_FORCE=-f;;
+ *) usage;;
+ esac
+done
+shift $((OPTIND-1))
+
action=$1
svc=$2
flag=$3
if svc_is_special $svc; then
_rc_err "\"$svc\" is a special variable, no rc.d(8) script"
fi
- /etc/rc.d/$svc $action
+ /etc/rc.d/$svc ${_RC_DEBUG} ${_RC_FORCE} $action
;;
*)
usage