1 |
commit: 33c2ef480fe82a521108da3276ca2f7a160e547a |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Dec 3 15:30:54 2021 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 3 15:30:54 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33c2ef48 |
7 |
|
8 |
net-misc/ser2net: Update OpenRC script |
9 |
|
10 |
Non-maintainer commit: This is effectively the same options reorganized |
11 |
for future consideration. |
12 |
|
13 |
Signed-off-by: Brian Evans <grknight <AT> gentoo.org> |
14 |
|
15 |
net-misc/ser2net/files/ser2net.initd | 25 +++++++------------------ |
16 |
1 file changed, 7 insertions(+), 18 deletions(-) |
17 |
|
18 |
diff --git a/net-misc/ser2net/files/ser2net.initd b/net-misc/ser2net/files/ser2net.initd |
19 |
index 3ce489bd1ff1..7652bc9b0350 100644 |
20 |
--- a/net-misc/ser2net/files/ser2net.initd |
21 |
+++ b/net-misc/ser2net/files/ser2net.initd |
22 |
@@ -1,22 +1,24 @@ |
23 |
#!/sbin/openrc-run |
24 |
-# Copyright 1999-2012 Gentoo Foundation |
25 |
+# Copyright 1999-2021 Gentoo Foundation |
26 |
# Distributed under the terms of the GNU General Public License v2 |
27 |
|
28 |
description="Serial to network proxy (${RC_SVCNAME#*.})" |
29 |
pidfile="/var/run/${RC_SVCNAME}.pid" |
30 |
command="/usr/sbin/ser2net" |
31 |
-name="${RC_SVCNAME}" |
32 |
+name="${description}" |
33 |
|
34 |
extra_started_commands="reload" |
35 |
description_reload="Reread configuration file and make the appropriate changes" |
36 |
-start_stop_daemon_args="--quiet --exec ${command} --name ${name} --pidfile ${pidfile}" |
37 |
+start_stop_daemon_args="--quiet" |
38 |
+command_args_background="-P ${pidfile}" |
39 |
+command_args_foreground="-n" |
40 |
|
41 |
depend() { |
42 |
use logger |
43 |
need net |
44 |
} |
45 |
|
46 |
-config_check() { |
47 |
+start_pre() { |
48 |
command_args="${EXTRA_OPTS}" |
49 |
CONFIG_FILE_DEFAULT="/etc/ser2net.conf" |
50 |
|
51 |
@@ -34,21 +36,8 @@ config_check() { |
52 |
return 0 |
53 |
} |
54 |
|
55 |
-start() { |
56 |
- config_check || return ${?} |
57 |
- ebegin "Starting ${description}" |
58 |
- start-stop-daemon --start ${start_stop_daemon_args} -- ${command_args} -P "${pidfile}" |
59 |
- eend ${?} |
60 |
-} |
61 |
- |
62 |
-stop() { |
63 |
- ebegin "Stopping ${description}" |
64 |
- start-stop-daemon --stop ${start_stop_daemon_args} |
65 |
- eend ${?} |
66 |
-} |
67 |
- |
68 |
reload() { |
69 |
ebegin "Reloading ${description}" |
70 |
- start-stop-daemon --signal HUP ${start_stop_daemon_args} |
71 |
+ start-stop-daemon --signal HUP --pidfile "${pidfile}" |
72 |
eend ${?} |
73 |
} |