summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Briesenick <sbriesen@gentoo.org>2008-09-03 19:22:00 +0000
committerStefan Briesenick <sbriesen@gentoo.org>2008-09-03 19:22:00 +0000
commit7c07b74764e253559e955d3c33db7f4944ef7ea3 (patch)
tree4bba7dbea1efd8324c96cfb3f54b3ffbf8d8484c /net-misc/ser2net
parentAdd doc and examples USE flags (diff)
downloadgentoo-2-7c07b74764e253559e955d3c33db7f4944ef7ea3.tar.gz
gentoo-2-7c07b74764e253559e955d3c33db7f4944ef7ea3.tar.bz2
gentoo-2-7c07b74764e253559e955d3c33db7f4944ef7ea3.zip
reworked init-script.
(Portage version: 2.2_rc8/cvs/Linux 2.6.26-gentoo-r1 i686)
Diffstat (limited to 'net-misc/ser2net')
-rw-r--r--net-misc/ser2net/ChangeLog6
-rw-r--r--net-misc/ser2net/files/ser2net.confd4
-rw-r--r--net-misc/ser2net/files/ser2net.initd50
3 files changed, 40 insertions, 20 deletions
diff --git a/net-misc/ser2net/ChangeLog b/net-misc/ser2net/ChangeLog
index 19bbc96222dc..9c07dcd04abf 100644
--- a/net-misc/ser2net/ChangeLog
+++ b/net-misc/ser2net/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-misc/ser2net
# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/ser2net/ChangeLog,v 1.18 2008/09/02 18:02:27 sbriesen Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ser2net/ChangeLog,v 1.19 2008/09/03 19:21:59 sbriesen Exp $
+
+ 03 Sep 2008; Stefan Briesenick <sbriesen@gentoo.org> files/ser2net.confd,
+ files/ser2net.initd:
+ reworked init-script.
*ser2net-2.5 (02 Sep 2008)
diff --git a/net-misc/ser2net/files/ser2net.confd b/net-misc/ser2net/files/ser2net.confd
index 7d9c536f4376..c66685159348 100644
--- a/net-misc/ser2net/files/ser2net.confd
+++ b/net-misc/ser2net/files/ser2net.confd
@@ -21,3 +21,7 @@
#
#UUCP_LOCKS="no"
+# see the ser2net(8) manual page for additional options you can configure here
+#
+#EXTRA_OPTS=""
+
diff --git a/net-misc/ser2net/files/ser2net.initd b/net-misc/ser2net/files/ser2net.initd
index 7ba1b0a85830..31b4ab96cde4 100644
--- a/net-misc/ser2net/files/ser2net.initd
+++ b/net-misc/ser2net/files/ser2net.initd
@@ -1,41 +1,53 @@
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/ser2net/files/ser2net.initd,v 1.1 2008/09/02 18:02:28 sbriesen Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ser2net/files/ser2net.initd,v 1.2 2008/09/03 19:22:00 sbriesen Exp $
+
+description="Serial to network proxy (${RC_SVCNAME})"
+description_reload="Reread configuration file and make the appropriate changes"
+extra_started_commands="reload"
+command="/usr/sbin/ser2net"
+pidfile="/var/run/${RC_SVCNAME}.pid"
depend() {
+ use logger
need net
- after bootmisc
}
config_check() {
- SER2NET_OPTS=""
+ command_args="${EXTRA_OPTS}"
CONFIG_FILE_DEFAULT="/etc/ser2net.conf"
- yesno "${CISCO_IOS:-no}" && SER2NET_OPTS="${SER2NET_OPTS} -b"
- yesno "${UUCP_LOCKS:-yes}" || SER2NET_OPTS="${SER2NET_OPTS} -u"
+ yesno "${CISCO_IOS:-no}" && command_args="${SER2NET_OPTS} -b"
+ yesno "${UUCP_LOCKS:-yes}" || command_args="${command_args} -u"
[ -z "${CONFIG_FILE}" ] && CONFIG_FILE="${CONFIG_FILE_DEFAULT}"
- [ -n "${CONTROL_PORT}" ] && SER2NET_OPTS="${SER2NET_OPTS} -p ${CONTROL_PORT}"
- [ "${CONFIG_FILE}" != "${CONFIG_FILE_DEFAULT}" ] && SER2NET_OPTS="${SER2NET_OPTS} -c ${CONFIG_FILE}"
-
- if [ ! -f "${CONFIG_FILE}" ]; then
- eerror "Please create ${CONFIG_FILE}"
- eerror "Sample conf: ${CONFIG_FILE_DEFAULT}.dist"
- return 1
- fi
- return 0
+ [ -n "${CONTROL_PORT}" ] && command_args="${command_args} -p ${CONTROL_PORT}"
+ [ "${CONFIG_FILE}" != "${CONFIG_FILE_DEFAULT}" ] && command_args="${command_args} -c ${CONFIG_FILE}"
+
+ if [ ! -f "${CONFIG_FILE}" ]; then
+ eerror "Please create ${CONFIG_FILE}"
+ eerror "Sample conf: ${CONFIG_FILE_DEFAULT}.dist"
+ return 1
+ fi
+ return 0
}
start() {
config_check || return ${?}
- ebegin "Starting Serial to network proxy (${SVCNAME})"
- start-stop-daemon --start --quiet --pidfile /var/run/${SVCNAME}.pid \
- --exec /usr/sbin/ser2net -- ${SER2NET_OPTS} -P /var/run/${SVCNAME}.pid
+ ebegin "Starting ${description}"
+ start-stop-daemon --start --quiet --pidfile "${pidfile}" \
+ --exec "${command}" -- ${command_args} -P "${pidfile}"
eend ${?}
}
stop() {
- ebegin "Stopping Serial to network proxy (${SVCNAME})"
- start-stop-daemon --stop --quiet --pidfile /var/run/${SVCNAME}.pid
+ ebegin "Stopping ${description}"
+ start-stop-daemon --stop --quiet --pidfile "${pidfile}"
+ eend ${?}
+}
+
+reload() {
+ ebegin "Reloading ${description}"
+ start-stop-daemon --stop --signal HUP --oknodo --pidfile "${pidfile}"
eend ${?}
}