summaryrefslogtreecommitdiff
blob: 6fb5bd0df62f62d3cff2499e7e72ea50ef5663ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 0491397d7648fd70ad0a6cef9e8626b9c2a968e9 Mon Sep 17 00:00:00 2001
From: Lance Albertson <ramereth@gmail.com>
Date: Mon, 8 Aug 2011 23:34:33 -0700
Subject: [PATCH 1/2] Remove/fix deprecated start-stop-daemon functions

daemon-util uses the deprecated functions --startas, --chuid and, most
importantly, --oknodo. The last one causes start-stop-daemon to exit with a
non-zero status, which makes openrc think it crashed (when in reality it just
shut down properly) [1].

[1] https://bugs.gentoo.org/show_bug.cgi?id=377905
---
 daemons/daemon-util.in |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in
index b754e7f..c19daa7 100644
--- a/daemons/daemon-util.in
+++ b/daemons/daemon-util.in
@@ -222,10 +222,10 @@ start() {
   @PKGLIBDIR@/ensure-dirs
 
   if type -p start-stop-daemon >/dev/null; then
-    start-stop-daemon --start --quiet --oknodo \
+    start-stop-daemon --start --quiet \
       --pidfile $pidfile \
-      --startas $daemonexec \
-      --chuid $usergroup \
+      --exec $daemonexec \
+      --user $usergroup \
       -- $args "$@"
   else
     # TODO: Find a way to start daemon with a group, until then the group must
@@ -248,7 +248,7 @@ stop() {
   local pidfile=$(_daemon_pidfile $name)
 
   if type -p start-stop-daemon >/dev/null; then
-    start-stop-daemon --stop --quiet --oknodo --retry 30 \
+    start-stop-daemon --stop --quiet --retry 30 \
       --pidfile $pidfile
   else
     _ignore_error killproc -p $pidfile $name
-- 
1.7.9.5