aboutsummaryrefslogtreecommitdiff
path: root/debianutils/start_stop_daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'debianutils/start_stop_daemon.c')
-rw-r--r--debianutils/start_stop_daemon.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 7dadc3c9e..d7c730f45 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -56,6 +56,34 @@ Misc options:
56 -q,--quiet Quiet 56 -q,--quiet Quiet
57 -v,--verbose Verbose 57 -v,--verbose Verbose
58*/ 58*/
59//config:config START_STOP_DAEMON
60//config: bool "start-stop-daemon"
61//config: default y
62//config: help
63//config: start-stop-daemon is used to control the creation and
64//config: termination of system-level processes, usually the ones
65//config: started during the startup of the system.
66//config:
67//config:config FEATURE_START_STOP_DAEMON_FANCY
68//config: bool "Support additional arguments"
69//config: default y
70//config: depends on START_STOP_DAEMON
71//config: help
72//config: Support additional arguments.
73//config: -o|--oknodo ignored since we exit with 0 anyway
74//config: -v|--verbose
75//config: -N|--nicelevel N
76//config:
77//config:config FEATURE_START_STOP_DAEMON_LONG_OPTIONS
78//config: bool "Enable long options"
79//config: default y
80//config: depends on START_STOP_DAEMON && LONG_OPTS
81//config: help
82//config: Support long options for the start-stop-daemon applet.
83
84//applet:IF_START_STOP_DAEMON(APPLET_ODDNAME(start-stop-daemon, start_stop_daemon, BB_DIR_SBIN, BB_SUID_DROP, start_stop_daemon))
85
86//kbuild:lib-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o
59 87
60//usage:#define start_stop_daemon_trivial_usage 88//usage:#define start_stop_daemon_trivial_usage
61//usage: "[OPTIONS] [-S|-K] ... [-- ARGS...]" 89//usage: "[OPTIONS] [-S|-K] ... [-- ARGS...]"
@@ -511,15 +539,15 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
511 write_pidfile(pidfile); 539 write_pidfile(pidfile);
512 } 540 }
513 if (opt & OPT_c) { 541 if (opt & OPT_c) {
514 struct bb_uidgid_t ugid = { -1, -1 }; 542 struct bb_uidgid_t ugid;
515 parse_chown_usergroup_or_die(&ugid, chuid); 543 parse_chown_usergroup_or_die(&ugid, chuid);
516 if (ugid.uid != (uid_t) -1) { 544 if (ugid.uid != (uid_t) -1L) {
517 struct passwd *pw = xgetpwuid(ugid.uid); 545 struct passwd *pw = xgetpwuid(ugid.uid);
518 if (ugid.gid != (gid_t) -1) 546 if (ugid.gid != (gid_t) -1L)
519 pw->pw_gid = ugid.gid; 547 pw->pw_gid = ugid.gid;
520 /* initgroups, setgid, setuid: */ 548 /* initgroups, setgid, setuid: */
521 change_identity(pw); 549 change_identity(pw);
522 } else if (ugid.gid != (gid_t) -1) { 550 } else if (ugid.gid != (gid_t) -1L) {
523 xsetgid(ugid.gid); 551 xsetgid(ugid.gid);
524 setgroups(1, &ugid.gid); 552 setgroups(1, &ugid.gid);
525 } 553 }