aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-08-16 09:42:39 +0100
committerRon Yorston <rmy@pobox.com>2019-08-16 09:45:21 +0100
commit517cf74f6265ec4308b790b637b3f9778cbdc6e0 (patch)
treebe9337069b60ca1bb03565d8575bacfc71181003 /debianutils
parentae65dc37bcc9b1d9cef0b111131c79dc4ba1bf51 (diff)
parentac78f2ac96b3efd6551a08e7dc609efa1fb69481 (diff)
downloadbusybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.tar.gz
busybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.tar.bz2
busybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/start_stop_daemon.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 72642ae74..68df44ae9 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -317,7 +317,7 @@ static void do_procinit(void)
317 } 317 }
318 closedir(procdir); 318 closedir(procdir);
319 if (!pid) 319 if (!pid)
320 bb_error_msg_and_die("nothing in /proc - not mounted?"); 320 bb_simple_error_msg_and_die("nothing in /proc - not mounted?");
321} 321}
322 322
323static int do_stop(void) 323static int do_stop(void)
@@ -337,7 +337,7 @@ static int do_stop(void)
337 } else if (userspec) { 337 } else if (userspec) {
338 what = xasprintf("process(es) owned by '%s'", userspec); 338 what = xasprintf("process(es) owned by '%s'", userspec);
339 } else { 339 } else {
340 bb_error_msg_and_die("internal error, please report"); 340 bb_simple_error_msg_and_die("internal error, please report");
341 } 341 }
342 342
343 if (!G.found_procs) { 343 if (!G.found_procs) {
@@ -537,6 +537,15 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
537 /* User wants _us_ to make the pidfile */ 537 /* User wants _us_ to make the pidfile */
538 write_pidfile(pidfile); 538 write_pidfile(pidfile);
539 } 539 }
540#if ENABLE_FEATURE_START_STOP_DAEMON_FANCY
541 if (opt & OPT_NICELEVEL) {
542 /* Set process priority (must be before OPT_c) */
543 int prio = getpriority(PRIO_PROCESS, 0) + xatoi_range(opt_N, INT_MIN/2, INT_MAX/2);
544 if (setpriority(PRIO_PROCESS, 0, prio) < 0) {
545 bb_perror_msg_and_die("setpriority(%d)", prio);
546 }
547 }
548#endif
540 if (opt & OPT_c) { 549 if (opt & OPT_c) {
541 struct bb_uidgid_t ugid; 550 struct bb_uidgid_t ugid;
542 parse_chown_usergroup_or_die(&ugid, chuid); 551 parse_chown_usergroup_or_die(&ugid, chuid);
@@ -551,15 +560,6 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
551 setgroups(1, &ugid.gid); 560 setgroups(1, &ugid.gid);
552 } 561 }
553 } 562 }
554#if ENABLE_FEATURE_START_STOP_DAEMON_FANCY
555 if (opt & OPT_NICELEVEL) {
556 /* Set process priority */
557 int prio = getpriority(PRIO_PROCESS, 0) + xatoi_range(opt_N, INT_MIN/2, INT_MAX/2);
558 if (setpriority(PRIO_PROCESS, 0, prio) < 0) {
559 bb_perror_msg_and_die("setpriority(%d)", prio);
560 }
561 }
562#endif
563 /* Try: 563 /* Try:
564 * strace -oLOG start-stop-daemon -S -x /bin/usleep -a qwerty 500000 564 * strace -oLOG start-stop-daemon -S -x /bin/usleep -a qwerty 500000
565 * should exec "/bin/usleep", but argv[0] should be "qwerty": 565 * should exec "/bin/usleep", but argv[0] should be "qwerty":