1 |
commit: 35e7f95e54449356b99a7aceac106e2e4c49eedf |
2 |
Author: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 28 08:30:35 2016 +0000 |
4 |
Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 28 08:30:35 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35e7f95e |
7 |
|
8 |
net-proxy/nutcracker: Fix init script |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
net-proxy/nutcracker/files/nutcracker.confd.2 | 10 ++++++ |
13 |
net-proxy/nutcracker/files/nutcracker.initd.2 | 40 ++++++++++++++++++++++ |
14 |
...ker-0.4.1.ebuild => nutcracker-0.4.1-r1.ebuild} | 4 +-- |
15 |
3 files changed, 52 insertions(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/net-proxy/nutcracker/files/nutcracker.confd.2 b/net-proxy/nutcracker/files/nutcracker.confd.2 |
18 |
new file mode 100644 |
19 |
index 0000000..128c378 |
20 |
--- /dev/null |
21 |
+++ b/net-proxy/nutcracker/files/nutcracker.confd.2 |
22 |
@@ -0,0 +1,10 @@ |
23 |
+# Copyright 1999-2016 Gentoo Foundation |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+# $Id$ |
26 |
+ |
27 |
+#USER="nobody" |
28 |
+#PIDFILE="/var/run/nutcracker.pid" |
29 |
+#CONF_FILE="/etc/nutcracker/nutcracker.yaml" |
30 |
+ |
31 |
+#NUTCRACKER_BIN="/usr/bin/nutcracker" |
32 |
+NUTCRACKER_OPTS="--daemonize" |
33 |
|
34 |
diff --git a/net-proxy/nutcracker/files/nutcracker.initd.2 b/net-proxy/nutcracker/files/nutcracker.initd.2 |
35 |
new file mode 100644 |
36 |
index 0000000..ee5e3f4 |
37 |
--- /dev/null |
38 |
+++ b/net-proxy/nutcracker/files/nutcracker.initd.2 |
39 |
@@ -0,0 +1,40 @@ |
40 |
+#!/sbin/openrc-run |
41 |
+# Copyright 1999-2016 Gentoo Foundation |
42 |
+# Distributed under the terms of the GNU General Public License v2 |
43 |
+# $Id$ |
44 |
+ |
45 |
+USER="${USER:-nobody}" |
46 |
+PIDFILE="${PIDFILE:-/var/run/nutcracker.pid}" |
47 |
+NUTCRACKER_BIN="${NUTCRACKER_BIN:-/usr/sbin/nutcracker}" |
48 |
+CONF_FILE="${CONF_FILE:-/etc/nutcracker/nutcracker.yml}" |
49 |
+ |
50 |
+depend() { |
51 |
+ need net |
52 |
+} |
53 |
+ |
54 |
+checkconf() { |
55 |
+ ebegin "Testing configuration" |
56 |
+ ${NUTCRACKER_BIN} --test-conf \ |
57 |
+ --conf-file=${CONF_FILE} \ |
58 |
+ >/dev/null 2>&1 |
59 |
+ eend $? |
60 |
+} |
61 |
+ |
62 |
+start() { |
63 |
+ checkconf || exit 1 |
64 |
+ ebegin "Starting Nutcracker" |
65 |
+ start-stop-daemon --start -u ${USER} \ |
66 |
+ --name ${SVCNAME} \ |
67 |
+ --exec ${NUTCRACKER_BIN} -- \ |
68 |
+ --conf-file="${CONF_FILE}" \ |
69 |
+ --pid-file=${PIDFILE} \ |
70 |
+ ${NUTCRACKER_OPTS} |
71 |
+ eend $? |
72 |
+} |
73 |
+ |
74 |
+stop() { |
75 |
+ ebegin "Stopping Nutcracker" |
76 |
+ start-stop-daemon --stop --pidfile "${PIDFILE}" |
77 |
+ eend $? |
78 |
+} |
79 |
+ |
80 |
|
81 |
diff --git a/net-proxy/nutcracker/nutcracker-0.4.1.ebuild b/net-proxy/nutcracker/nutcracker-0.4.1-r1.ebuild |
82 |
similarity index 88% |
83 |
rename from net-proxy/nutcracker/nutcracker-0.4.1.ebuild |
84 |
rename to net-proxy/nutcracker/nutcracker-0.4.1-r1.ebuild |
85 |
index f97f42c..aec29cf 100644 |
86 |
--- a/net-proxy/nutcracker/nutcracker-0.4.1.ebuild |
87 |
+++ b/net-proxy/nutcracker/nutcracker-0.4.1-r1.ebuild |
88 |
@@ -37,8 +37,8 @@ src_install() { |
89 |
insinto /etc/nutcracker |
90 |
newins conf/nutcracker.yml nutcracker.yml.example |
91 |
|
92 |
- newconfd "${FILESDIR}/nutcracker.confd" nutcracker |
93 |
- newinitd "${FILESDIR}/nutcracker.initd" nutcracker |
94 |
+ newconfd "${FILESDIR}/nutcracker.confd.2" nutcracker |
95 |
+ newinitd "${FILESDIR}/nutcracker.initd.2" nutcracker |
96 |
|
97 |
if use doc; then |
98 |
dodoc -r notes |