xref: /openbsd/usr.sbin/rcctl/rcctl.8 (revision a6445c1d)
1.\"	$OpenBSD: rcctl.8,v 1.10 2014/10/13 14:12:57 schwarze Exp $
2.\"
3.\" Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: October 13 2014 $
18.Dt RCCTL 8
19.Os
20.Sh NAME
21.Nm rcctl
22.Nd configure and control daemons and services
23.Sh SYNOPSIS
24.Nm rcctl
25.Op Fl df
26.Sm off
27.Cm enable | disable | status | default | Ar action
28.Sm on
29.Op Ar service | daemon Op Cm flags Op Ar arguments
30.Sh DESCRIPTION
31The
32.Nm
33utility can enable or disable a base system
34.Ar service
35or a base system or package
36.Ar daemon
37in
38.Xr rc.conf.local 8
39or display its status.
40For a daemon, it can also change the command line arguments or call its
41.Xr rc.d 8
42.Ar daemon
43control script.
44.Pp
45The following commands are available:
46.Bl -tag -width Ds
47.It Cm enable Ar service | daemon Op Cm flags Op Ar arguments
48Enable the service or daemon in
49.Xr rc.conf.local 8 .
50For a daemon, optionally set the variable
51.Ar daemon Ns _flags
52to the specified
53.Ar arguments .
54If
55.Cm flags
56is appended without any
57.Ar arguments ,
58.Ar daemon Ns _flags
59is reset to its default value.
60If
61.Ar daemon
62is already enabled,
63.Ar daemon Ns _flags
64is reset to the optionally provided
65.Cm flags .
66.It Cm disable Ar service | daemon
67Disable the service or daemon in
68.Xr rc.conf.local 8 .
69.It Cm status Op Ar service | daemon
70Display the value of
71.Ar service
72or
73.Ar daemon Ns _flags .
74Without an argument, display all services and
75.Ar daemon Ns _flags
76with their values in a format compatible with
77.Xr rc.conf 8 .
78.It Cm default Op Ar service | daemon
79For a daemon, display the flags that will be used if
80.Dq Cm enable Ar daemon Cm flags
81is called without
82.Ar arguments .
83For a base system service, display whether it is enabled by default.
84.It Oo Fl df Oc Ar action daemon
85Run the
86.Xr rc.d 8
87.Ar daemon
88script with the
89.Ar action
90argument, passing through the specified options, if any.
91.El
92.Sh EXIT STATUS
93.Nm Ar action
94returns with the exit status of the
95.Xr rc.d 8
96.Ar daemon
97script.
98.Nm Cm status
99exits with 0 if the daemon or service is enabled and 1 if it is not.
100.Nm Cm default
101exits with 0 if the daemon or service is enabled by default
102and 1 if it is not.
103Otherwise, the
104.Nm
105utility exits 0 on success, and >0 if an error occurs
106.Po 2 indicates a non-existent
107.Ar service
108.Pc .
109.Sh EXAMPLES
110Disable
111.Xr ntpd 8
112and check its status:
113.Bd -literal -offset indent
114# rcctl disable ntpd
115# rcctl status ntpd
116NO
117# echo $?
1181
119.Ed
120.Pp
121Enable and set
122.Xr ntpd 8
123flags:
124.Bd -literal -offset indent
125# rcctl enable ntpd flags -s
126# rcctl status ntpd
127-s
128# echo $?
1290
130.Ed
131.Pp
132Start
133.Xr ntpd 8
134and check that it is running:
135.Bd -literal -offset indent
136# rcctl start ntpd
137ntpd(ok)
138# rcctl check ntpd
139ntpd(ok)
140# echo $?
1410
142.Ed
143.Sh SEE ALSO
144.Xr rc.conf.local 8 ,
145.Xr rc.d 8
146.Sh HISTORY
147.Nm
148first appeared in
149.Ox 5.7 .
150.Sh AUTHORS
151.Nm
152was written by
153.An Antoine Jacoutot Aq Mt ajacoutot@openbsd.org .
154