rc-inetd: rc-inetd - commit SOURCES/rc-inetd-noservices.patch
glen
glen at pld-linux.org
Thu Nov 1 20:33:21 CET 2007
Author: glen Date: Thu Nov 1 19:33:21 2007 GMT
Module: rc-inetd Tag: HEAD
---- Log message:
- commit SOURCES/rc-inetd-noservices.patch
---- Files affected:
rc-inetd:
rc-inetd (1.39 -> 1.40)
---- Diffs:
================================================================
Index: rc-inetd/rc-inetd
diff -u rc-inetd/rc-inetd:1.39 rc-inetd/rc-inetd:1.40
--- rc-inetd/rc-inetd:1.39 Fri Sep 26 14:58:02 2003
+++ rc-inetd/rc-inetd Thu Nov 1 20:33:15 2007
@@ -30,6 +30,8 @@
exit 5
fi
+SERVICES="`ls /etc/sysconfig/rc-inetd/* 2>/dev/null | grep -v '.*\(\.rpm\(save\|new\)\|~\)'`"
+
gen_config_file()
{
# initialize empty config file
@@ -44,35 +46,33 @@
umask $CURRENT_UMASK
DID_PARSE=0
- for i in /etc/sysconfig/rc-inetd/*; do
- if echo "$i" | grep -qv '.*\(\.rpm\(save\|new\)\|~\)' ; then
- # unset everything
- unset SERVICE_NAME SOCK_TYPE PROTOCOL PORT USER
- unset DAEMON DAEMONARGS MAX_CONNECTIONS GROUP NICE
- unset FAMILY INTERFACE CHROOT RPCNAME RPCVERSION
- unset INITGROUPS BANNER ECHO FILTER ENV FLAGS
- unset SERVER MAX_CONNECTIONS_PER_SOURCE
- unset CONNECTIONS_PER_SECOND RPCNUMBER
- unset BANNER_SUCCESS BANNER_FAILURE PASSENV
- unset SERVICE_TYPE ACCESS_TIMES LOG_TYPE
- unset LOG_SUCCESS LOG_FAILURE REDIRECT MAX_LOAD
- # Read defaults...
- . /etc/sysconfig/rc-inetd.conf
- # ...and then config of *this* service.
- . $i
- CURRENT_SERVICE=`basename $i`
- DONT_PARSE=0
- # check if service is in deny list ?
- for i in $DENY_SERVICES ; do
- if [ $i = $CURRENT_SERVICE ] ; then
- DONT_PARSE=1
- fi
- done
-
- if [ $DONT_PARSE -eq 0 ] ; then
- DID_PARSE=1
- parse_one_service >> $CONFIG_FILE
+ for i in $SERVICES; do
+ # unset everything
+ unset SERVICE_NAME SOCK_TYPE PROTOCOL PORT USER
+ unset DAEMON DAEMONARGS MAX_CONNECTIONS GROUP NICE
+ unset FAMILY INTERFACE CHROOT RPCNAME RPCVERSION
+ unset INITGROUPS BANNER ECHO FILTER ENV FLAGS
+ unset SERVER MAX_CONNECTIONS_PER_SOURCE
+ unset CONNECTIONS_PER_SECOND RPCNUMBER
+ unset BANNER_SUCCESS BANNER_FAILURE PASSENV
+ unset SERVICE_TYPE ACCESS_TIMES LOG_TYPE
+ unset LOG_SUCCESS LOG_FAILURE REDIRECT MAX_LOAD
+ # Read defaults...
+ . /etc/sysconfig/rc-inetd.conf
+ # ...and then config of *this* service.
+ . $i
+ CURRENT_SERVICE=`basename $i`
+ DONT_PARSE=0
+ # check if service is in deny list ?
+ for i in $DENY_SERVICES ; do
+ if [ $i = $CURRENT_SERVICE ] ; then
+ DONT_PARSE=1
fi
+ done
+
+ if [ $DONT_PARSE -eq 0 ] ; then
+ DID_PARSE=1
+ parse_one_service >> $CONFIG_FILE
fi
done
# unset everything
@@ -92,55 +92,51 @@
pre_start_services()
{
DID_PARSE=0
- for i in /etc/sysconfig/rc-inetd/*; do
+ for i in $SERVICES; do
pre_start_service()
{
:
}
- if echo "$i" | grep -qv '.*\(\.rpm\(save\|new\)\|~\)' ; then
- . $i
- CURRENT_SERVICE=`basename $i`
- DONT_PARSE=0
- # check if service is in deny list ?
- for i in $DENY_SERVICES ; do
- if [ $i = $CURRENT_SERVICE ] ; then
- DONT_PARSE=1
- fi
- done
-
- if [ $DONT_PARSE -eq 0 ] ; then
-# if [ $( set | grep "^pre_start_service\(\)" ) ] ; then
- pre_start_service
-# fi
+ . $i
+ CURRENT_SERVICE=`basename $i`
+ DONT_PARSE=0
+ # check if service is in deny list ?
+ for i in $DENY_SERVICES ; do
+ if [ $i = $CURRENT_SERVICE ] ; then
+ DONT_PARSE=1
fi
- fi
+ done
+
+ if [ $DONT_PARSE -eq 0 ] ; then
+# if [ $( set | grep "^pre_start_service\(\)" ) ] ; then
+ pre_start_service
+# fi
+ fi
done
}
pre_stop_services()
{
DID_PARSE=0
- for i in /etc/sysconfig/rc-inetd/*; do
+ for i in $SERVICES; do
pre_stop_service ()
{
:
}
- if echo "$i" | grep -qv '.*\(\.rpm\(save\|new\)\|~\)' ; then
- . $i
- CURRENT_SERVICE=`basename $i`
- DONT_PARSE=0
- # check if service is in deny list ?
- for i in $DENY_SERVICES ; do
- if [ $i = $CURRENT_SERVICE ] ; then
- DONT_PARSE=1
- fi
- done
-
- if [ $DONT_PARSE -eq 0 ] ; then
-# if [ $(set | grep "^pre_stop_service" ) ] ; then
- pre_stop_service
-# fi
+ . $i
+ CURRENT_SERVICE=`basename $i`
+ DONT_PARSE=0
+ # check if service is in deny list ?
+ for i in $DENY_SERVICES ; do
+ if [ $i = $CURRENT_SERVICE ] ; then
+ DONT_PARSE=1
fi
+ done
+
+ if [ $DONT_PARSE -eq 0 ] ; then
+# if [ $(set | grep "^pre_stop_service" ) ] ; then
+ pre_stop_service
+# fi
fi
done
}
@@ -154,19 +150,13 @@
show "$(nls "Generating %s for %s" "$CONFIG_FILE" "$PROCESS_NAME")"
busy
pre_start_services
- if [ "`echo /etc/sysconfig/rc-inetd/*`" = "/etc/sysconfig/rc-inetd/*" ] ; then
- deltext
- fail
- exit 1
- else
- gen_config_file
- DIDPARSE=$?
- deltext;ok
- if [ "$DIDPARSE" -gt 0 ]; then
- msg_starting "$PROCESS_NAME"
- daemon $INETDAEMON $INETDAEMON_ARGS
- touch /var/lock/subsys/rc-inetd
- fi
+ gen_config_file
+ DIDPARSE=$?
+ deltext;ok
+ if [ "$DIDPARSE" -gt 0 ]; then
+ msg_starting "$PROCESS_NAME"
+ daemon $INETDAEMON $INETDAEMON_ARGS
+ touch /var/lock/subsys/rc-inetd
fi
;;
stop)
@@ -192,18 +182,12 @@
show "$(nls "Generating %s for %s" "$CONFIG_FILE" "$PROCESS_NAME")"
busy
- if [ "`echo /etc/sysconfig/rc-inetd/*`" = "/etc/sysconfig/rc-inetd/*" ] ; then
- deltext
- fail
- exit 1
- else
- gen_config_file
- deltext; ok
- show "$(nls "Reload %s service configuration" "$PROCESS_NAME")"
- busy
- reload_config
- deltext; ok
- fi
+ gen_config_file
+ deltext; ok
+ show "$(nls "Reload %s service configuration" "$PROCESS_NAME")"
+ busy
+ reload_config
+ deltext; ok
;;
status)
status rc-inetd `basename $INETDAEMON`
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/rc-inetd/rc-inetd?r1=1.39&r2=1.40&f=u
More information about the pld-cvs-commit
mailing list