summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonny Davies <woodchip@gentoo.org>2001-09-03 02:17:56 +0000
committerDonny Davies <woodchip@gentoo.org>2001-09-03 02:17:56 +0000
commitf52554d053a76712bd2ae7652da4783347c756e6 (patch)
treee265618bdb8dfd33933449d0df438a5f9ffa20f3 /sys-apps/xinetd/files
parenthallski was crying about having to deal with this, (diff)
downloadhistorical-f52554d053a76712bd2ae7652da4783347c756e6.tar.gz
historical-f52554d053a76712bd2ae7652da4783347c756e6.tar.bz2
historical-f52554d053a76712bd2ae7652da4783347c756e6.zip
Couple of fixes in the logic, and added some more comments.
I an unable to "break" this script now, in any way, shape form or fashion. It is pretty darn robust. The only real excellent change that could be made at this point, is to have a look at why xinetd returns an successful status code when it reads a "defaults only" config file. While that might make sense to programmers, to an administrator it would be more helpful to return an error because then start-stop-daemon would actually be useful. Instead it just makes things difficult. Please see those comments, and *do* take a look at the xinetd source if you feel like it! Otherwise we should be rock solid on this package now, except for security issues and such ;-)
Diffstat (limited to 'sys-apps/xinetd/files')
-rw-r--r--sys-apps/xinetd/files/xinetd.rc644
1 files changed, 30 insertions, 14 deletions
diff --git a/sys-apps/xinetd/files/xinetd.rc6 b/sys-apps/xinetd/files/xinetd.rc6
index 01c2d80ebfd3..0b612dffbd0d 100644
--- a/sys-apps/xinetd/files/xinetd.rc6
+++ b/sys-apps/xinetd/files/xinetd.rc6
@@ -5,18 +5,19 @@ depend() {
}
autoconfig() {
- if [ ! -e /etc/xinetd.conf ] ; then
- if [ ! -e /etc/inetd.conf ] ; then
- eerror "You need an /etc/xinetd.conf file to run xinetd"
- eerror "There are samples in docs/xinetd, docs/netkit-base"
- return 1
- else
- einfo "Auto-creating xinetd.conf from your inetd.conf.."
- /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf
-
- fi
+if [ ! -e /etc/xinetd.conf ] ; then
+ if [ ! -e /etc/inetd.conf ] ; then
+ eerror "You need an /etc/xinetd.conf file to run xinetd"
+ eerror "There are samples in docs/xinetd, docs/netkit-base"
+ return 1
+ else
+ einfo "Auto-creating xinetd.conf from your inetd.conf.."
+ /usr/sbin/xconv.pl < /etc/inetd.conf > /etc/xinetd.conf
+ return 0
fi
- return # sneaky?
+else
+ return 0
+fi
}
start() {
@@ -48,12 +49,27 @@ stop() {
# is run against it (see autoconfig() above)
# 2. if xinetd is terminated behind the dependency engines
# back. ie, killall xinetd.
- # ~woodchip
#
- if [ $? -eq 1 ] ; then
+ # It might be better to just patch xinetd so that it exits
+ # with a specific error code when starting with an "only
+ # defaults section" config file. Then we can check that and
+ # delete the mess in here. It might already do this, but I
+ # havn't actually checked ;) ~woodchip
+ #
+ if [ $? -ne 0 ] ; then
if [ -e /dev/shm/.init.d/started/xinetd ] ; then
+ # this will basically reset the depencency engine
+ # into a working state. i am doing this in order
+ # to maintain some sanity. if you are finding the
+ # need to change this initscript, i would like to
+ # know about it, and will incorporate your fixes.
eend 0
+ else
+ # im not sure how we can arrive here, so keep an
+ # eye out and report if you discover such a case
+ eend 1
fi
+ else
+ eend 0
fi
- eend $?
}