Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 497740
Collapse All | Expand All

(-)file_not_specified_in_diff (-8 / +29 lines)
Line  Link Here
0
-- a/src/rc/rc-update.c
0
++ b/src/rc/rc-update.c
Lines 199-211 Link Here
199
	"Usage: rc-update [options] add <service> [<runlevel>...]\n"	\
199
	"Usage: rc-update [options] add <service> [<runlevel>...]\n"	\
200
	"   or: rc-update [options] del <service> [<runlevel>...]\n"	\
200
	"   or: rc-update [options] del <service> [<runlevel>...]\n"	\
201
	"   or: rc-update [options] [show [<runlevel>...]]"
201
	"   or: rc-update [options] [show [<runlevel>...]]"
202
#define getoptstring "su" getoptstring_COMMON
202
#define getoptstring "asu" getoptstring_COMMON
203
static const struct option longopts[] = {
203
static const struct option longopts[] = {
204
	{ "all",             0, NULL, 'a' },
204
	{ "stack",           0, NULL, 's' },
205
	{ "stack",           0, NULL, 's' },
205
	{ "update",          0, NULL, 'u' },
206
	{ "update",          0, NULL, 'u' },
206
	longopts_COMMON
207
	longopts_COMMON
207
};
208
};
208
static const char * const longopts_help[] = {
209
static const char * const longopts_help[] = {
210
	"Operate on all the runlevels",
209
	"Stack a runlevel instead of a service",
211
	"Stack a runlevel instead of a service",
210
	"Force an update of the dependency tree",
212
	"Force an update of the dependency tree",
211
	longopts_help_COMMON
213
	longopts_help_COMMON
Lines 225-231 Link Here
225
	char *service = NULL;
227
	char *service = NULL;
226
	char *p;
228
	char *p;
227
	int action = 0;
229
	int action = 0;
228
	bool verbose = false, stack = false;
230
	bool verbose = false, stack = false, all_runlevels = false;
229
	int opt;
231
	int opt;
230
	int retval = EXIT_FAILURE;
232
	int retval = EXIT_FAILURE;
231
	int num_updated = 0;
233
	int num_updated = 0;
Lines 238-243 Link Here
238
		case 's':
240
		case 's':
239
		    stack = true;
241
		    stack = true;
240
		break;
242
		break;
243
		case 'a':
244
		    all_runlevels = true;
245
		break;
241
		case 'u':
246
		case 'u':
242
			deptree = _rc_deptree_load(-1, &ret);
247
			deptree = _rc_deptree_load(-1, &ret);
243
			if (deptree)
248
			if (deptree)
Lines 315-323 Link Here
315
			}
320
			}
316
321
317
			if (!TAILQ_FIRST(runlevels)) {
322
			if (!TAILQ_FIRST(runlevels)) {
318
				p = rc_runlevel_get();
323
				if (all_runlevels) {
319
				rc_stringlist_add(runlevels, p);
324
					free(runlevels);
320
				free(p);
325
					runlevels = rc_runlevel_list();
326
				} else {
327
					p = rc_runlevel_get();
328
					rc_stringlist_add(runlevels, p);
329
					free(p);
330
				}
321
			}
331
			}
322
332
323
			if (!TAILQ_FIRST(runlevels)) {
333
			if (!TAILQ_FIRST(runlevels)) {
324
-- a/man/rc-update.8
334
++ b/man/rc-update.8
Lines 21-27 Link Here
21
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
.\" SUCH DAMAGE.
22
.\" SUCH DAMAGE.
23
.\"
23
.\"
24
.Dd May 2, 2009
24
.Dd Jan 13, 2014
25
.Dt RC-UPDATE 8 SMM
25
.Dt RC-UPDATE 8 SMM
26
.Os OpenRC
26
.Os OpenRC
27
.Sh NAME
27
.Sh NAME
Lines 30-40 Link Here
30
.Sh SYNOPSIS
30
.Sh SYNOPSIS
31
.Nm
31
.Nm
32
.Op Fl s , -stack
32
.Op Fl s , -stack
33
.Op Fl a , -all
33
.Ar add
34
.Ar add
34
.Ar service
35
.Ar service
35
.Op Ar runlevel ...
36
.Op Ar runlevel ...
36
.Nm
37
.Nm
37
.Op Fl s , -stack
38
.Op Fl s , -stack
39
.Op Fl a , -all
38
.Ar delete
40
.Ar delete
39
.Ar service
41
.Ar service
40
.Op Ar runlevel ...
42
.Op Ar runlevel ...
Lines 86-94 Link Here
86
.Fl s , -stack
88
.Fl s , -stack
87
option is given then we either add or remove the runlevel from the runlevel.
89
option is given then we either add or remove the runlevel from the runlevel.
88
This allows inheritance of runlevels.
90
This allows inheritance of runlevels.
91
92
If the
93
.Fl a, -all
94
option is given and no runlevel is specified, we either add (not much
95
use though) or remove the service from all the runlevels. If a
96
runlevel is specified, it takes no effect. It is useful when a service
97
is removed and the dangling symlinks in the runlevels should be
98
cleaned up.
89
.Sh SEE ALSO
99
.Sh SEE ALSO
90
.Xr openrc 8 ,
100
.Xr openrc 8 ,
91
.Xr openrc-run 8 ,
101
.Xr openrc-run 8 ,
92
.Xr rc-status 8
102
.Xr rc-status 8
93
.Sh AUTHORS
103
.Sh AUTHORS
94
.An Roy Marples <roy@marples.name>
104
.An Roy Marples <roy@marples.name>
105
.An The OpenRC Team <openrc@gentoo.org>

Return to bug 497740