1 |
sbriesen 08/09/03 19:22:00 |
2 |
|
3 |
Modified: ser2net.confd ser2net.initd |
4 |
Log: |
5 |
reworked init-script. |
6 |
(Portage version: 2.2_rc8/cvs/Linux 2.6.26-gentoo-r1 i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.2 net-misc/ser2net/files/ser2net.confd |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/ser2net/files/ser2net.confd?rev=1.2&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/ser2net/files/ser2net.confd?rev=1.2&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/ser2net/files/ser2net.confd?r1=1.1&r2=1.2 |
14 |
|
15 |
Index: ser2net.confd |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/net-misc/ser2net/files/ser2net.confd,v |
18 |
retrieving revision 1.1 |
19 |
retrieving revision 1.2 |
20 |
diff -u -r1.1 -r1.2 |
21 |
--- ser2net.confd 2 Sep 2008 18:02:28 -0000 1.1 |
22 |
+++ ser2net.confd 3 Sep 2008 19:22:00 -0000 1.2 |
23 |
@@ -21,3 +21,7 @@ |
24 |
# |
25 |
#UUCP_LOCKS="no" |
26 |
|
27 |
+# see the ser2net(8) manual page for additional options you can configure here |
28 |
+# |
29 |
+#EXTRA_OPTS="" |
30 |
+ |
31 |
|
32 |
|
33 |
|
34 |
1.2 net-misc/ser2net/files/ser2net.initd |
35 |
|
36 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/ser2net/files/ser2net.initd?rev=1.2&view=markup |
37 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/ser2net/files/ser2net.initd?rev=1.2&content-type=text/plain |
38 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/ser2net/files/ser2net.initd?r1=1.1&r2=1.2 |
39 |
|
40 |
Index: ser2net.initd |
41 |
=================================================================== |
42 |
RCS file: /var/cvsroot/gentoo-x86/net-misc/ser2net/files/ser2net.initd,v |
43 |
retrieving revision 1.1 |
44 |
retrieving revision 1.2 |
45 |
diff -u -r1.1 -r1.2 |
46 |
--- ser2net.initd 2 Sep 2008 18:02:28 -0000 1.1 |
47 |
+++ ser2net.initd 3 Sep 2008 19:22:00 -0000 1.2 |
48 |
@@ -1,41 +1,53 @@ |
49 |
#!/sbin/runscript |
50 |
# Copyright 1999-2008 Gentoo Foundation |
51 |
# Distributed under the terms of the GNU General Public License v2 |
52 |
-# $Header: /var/cvsroot/gentoo-x86/net-misc/ser2net/files/ser2net.initd,v 1.1 2008/09/02 18:02:28 sbriesen Exp $ |
53 |
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ser2net/files/ser2net.initd,v 1.2 2008/09/03 19:22:00 sbriesen Exp $ |
54 |
+ |
55 |
+description="Serial to network proxy (${RC_SVCNAME})" |
56 |
+description_reload="Reread configuration file and make the appropriate changes" |
57 |
+extra_started_commands="reload" |
58 |
+command="/usr/sbin/ser2net" |
59 |
+pidfile="/var/run/${RC_SVCNAME}.pid" |
60 |
|
61 |
depend() { |
62 |
+ use logger |
63 |
need net |
64 |
- after bootmisc |
65 |
} |
66 |
|
67 |
config_check() { |
68 |
- SER2NET_OPTS="" |
69 |
+ command_args="${EXTRA_OPTS}" |
70 |
CONFIG_FILE_DEFAULT="/etc/ser2net.conf" |
71 |
|
72 |
- yesno "${CISCO_IOS:-no}" && SER2NET_OPTS="${SER2NET_OPTS} -b" |
73 |
- yesno "${UUCP_LOCKS:-yes}" || SER2NET_OPTS="${SER2NET_OPTS} -u" |
74 |
+ yesno "${CISCO_IOS:-no}" && command_args="${SER2NET_OPTS} -b" |
75 |
+ yesno "${UUCP_LOCKS:-yes}" || command_args="${command_args} -u" |
76 |
[ -z "${CONFIG_FILE}" ] && CONFIG_FILE="${CONFIG_FILE_DEFAULT}" |
77 |
- [ -n "${CONTROL_PORT}" ] && SER2NET_OPTS="${SER2NET_OPTS} -p ${CONTROL_PORT}" |
78 |
- [ "${CONFIG_FILE}" != "${CONFIG_FILE_DEFAULT}" ] && SER2NET_OPTS="${SER2NET_OPTS} -c ${CONFIG_FILE}" |
79 |
+ [ -n "${CONTROL_PORT}" ] && command_args="${command_args} -p ${CONTROL_PORT}" |
80 |
+ [ "${CONFIG_FILE}" != "${CONFIG_FILE_DEFAULT}" ] && command_args="${command_args} -c ${CONFIG_FILE}" |
81 |
|
82 |
- if [ ! -f "${CONFIG_FILE}" ]; then |
83 |
- eerror "Please create ${CONFIG_FILE}" |
84 |
- eerror "Sample conf: ${CONFIG_FILE_DEFAULT}.dist" |
85 |
- return 1 |
86 |
- fi |
87 |
- return 0 |
88 |
+ if [ ! -f "${CONFIG_FILE}" ]; then |
89 |
+ eerror "Please create ${CONFIG_FILE}" |
90 |
+ eerror "Sample conf: ${CONFIG_FILE_DEFAULT}.dist" |
91 |
+ return 1 |
92 |
+ fi |
93 |
+ return 0 |
94 |
} |
95 |
|
96 |
start() { |
97 |
config_check || return ${?} |
98 |
- ebegin "Starting Serial to network proxy (${SVCNAME})" |
99 |
- start-stop-daemon --start --quiet --pidfile /var/run/${SVCNAME}.pid \ |
100 |
- --exec /usr/sbin/ser2net -- ${SER2NET_OPTS} -P /var/run/${SVCNAME}.pid |
101 |
+ ebegin "Starting ${description}" |
102 |
+ start-stop-daemon --start --quiet --pidfile "${pidfile}" \ |
103 |
+ --exec "${command}" -- ${command_args} -P "${pidfile}" |
104 |
eend ${?} |
105 |
} |
106 |
|
107 |
stop() { |
108 |
- ebegin "Stopping Serial to network proxy (${SVCNAME})" |
109 |
- start-stop-daemon --stop --quiet --pidfile /var/run/${SVCNAME}.pid |
110 |
+ ebegin "Stopping ${description}" |
111 |
+ start-stop-daemon --stop --quiet --pidfile "${pidfile}" |
112 |
+ eend ${?} |
113 |
+} |
114 |
+ |
115 |
+reload() { |
116 |
+ ebegin "Reloading ${description}" |
117 |
+ start-stop-daemon --stop --signal HUP --oknodo --pidfile "${pidfile}" |
118 |
eend ${?} |
119 |
} |