[5524] in RedHat Linux List

home help back first fref pref prev next nref lref last post

"restart" option in /etc/rc.d/init.d/* ???

daemon@ATHENA.MIT.EDU (Joerg Mertin)
Thu Nov 21 21:40:30 1996

Date: Thu, 21 Nov 96 21:25 MET
From: smurphy@stardust.bln.sub.org (Joerg Mertin)
To: redhat-list@redhat.com
Reply-To: Joerg Mertin <smurphy@antares.zrz.TU-Berlin.DE>
Resent-From: redhat-list@redhat.com



Hi Folks,

I was wondering, since when making some adminstrative work on many machines, I 
came to the point that sometimes I have to restart some services. What I did was 
to add some statements, in fact, the restart Option.

By example, for the portmapper:

#! /bin/sh
#
# /etc/rc.d/init.d/portmap.init:  Start/Restart/Stop RPC portmapper
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Modified for RHS Linux by Donnie Barnes
#		Modified for stardust by Joerg Mertin 
#                                        <smurphy@antares.zrz.tu-berlin.de>
#

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
	exit 0
fi

[ -f /usr/sbin/portmap ] || exit 0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting portmapper: "
	daemon portmap

	echo
	touch /var/lock/subsys/portmap
	;;
  restart)
	echo "Saving portmap process informations"
	pmap_dump > /tmp/portmap_dump
	echo -n "Stopping portmapper "
	killproc portmap
	echo
	rm -f /var/lock/subsys/portmap
	# Stopped
	echo -n "Starting portmapper: "
	daemon portmap
	echo
	sleep 1
	echo "Restoring portmap process informations"
	pmap_set < /tmp/portmap_dump
	touch /var/lock/subsys/portmap
	rm -f /tmp/portmap_dump
	;;
  stop)
	echo -n "Stopping INET services: "
	killproc portmap

	echo
	rm -f /var/lock/subsys/portmap
	;;	
  *)
	echo "Usage: portmap.init {start|restart|stop}"
	exit 1
esac

exit 0


This would b.e. have the advantage of restarting services after changes made to 
some configuration files using "portmap.init restart". Maybe somday the 
/etc/hosts.allow|deny will be configurable from something like the netconfig 
tcl/tk script ? Would be easy to restart the service, since it would only take a 
statement restart :)

I admit, getting the error level to analyse wether the process is still running 
or not would have to be implemented, but I bet there are some good guys out 
there who would implement this...

If some people are interested, I might send in some patches ?

Eric, Donnie ??? What about this idea ? Is it worth the trouble ???

cu
--
`*** Fatal Error: Found [MS-Windows] -> Repartitioning Disk for LiNUX...'
------------------------------------------------------------------------
| Joerg Mertin              :   smurphy@linux.de             (Home)    |  
| in Berlin Spandau at      :   joerg@pc50.zrz.tu-berlin.de            |
| Stardust's LiNUX System   :   Data, Fax & Voice 49 30 3627345        |
| PGP 2.6.2i Key on Demand  :   ZyXEL Link                             |
------------------------------------------------------------------------
PGP Key fingerprint =  C6 3F A3 12 D7 EE 60 27  88 A0 01 E6 0B 11 45 67


--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post