Re: Bug#2524: problems with base package
Miquel> It isn't ;). I have asked it on debian-user and debian-devel, and
Miquel> the general consensus seems to be that an /etc/rc.local is not
Miquel> wanted.
Michael> Could anyone please tell me why not? Where do you guys start
Michael> programs like hdparm or any other local configuration?
Well, I used to add local modifications into the existing files which isn't
the right thing.
An approach that might be more sound is to use Debian's fine tools --- so I
wrote myself a little /etc/init.d/local_network. It includes an "install"
target for the update-rc.d call. The "purge" doesn't work yet, but I don't
really care about that. FWIW, I include the script below.
Otherwise, I feel sympathetic both with keeping and with nuking rc.local ---
I never sys admin'ed on either BSD or SYSV apart from Linux so I don't feel
particularly brainwashed.
#! /bin/sh
# edd 11 Mar 96 regroup commands for serial link and modem here
PATH=/bin:/usr/bin:/sbin:/usr/sbin
case "$1" in
start)
echo -n "Starting local network services: "
#
echo -n "dummy "
ifconfig dummy0 miles
route add miles
#
echo "serial_link "
stty crtscts 38400 < /dev/cua1
start-stop-daemon --start --quiet --exec /usr/sbin/slattach -- -l -L -s 38400 /dev/cua1 &
sleep 1
ifconfig sl0 miles pointopoint bird
route add bird
#
;;
stop)
echo -n "Stopping local network services: "
#
echo -n "serial_link "
route del bird
ifconfig sl0 down
start-stop-daemon --stop --quiet --exec /usr/sbin/slattach
#
echo -n "dummy "
route del miles
ifconfig dummy0 down
echo
;;
install)
echo "Install local_network"
update-rc.d local_network defaults 66
;;
purge)
echo "Remove local_network"
echo "... have to remove local_network from /etc/init.d first ..."
echo "... better save it though ..."
update-rc.d local_network remove
;;
*)
echo "Usage: /etc/init.d/local_network {start|stop}"
echo "Installation: /etc/init.d/local_network {install|purge}"
exit 1
esac
exit 0
--
Dirk Eddelb"uttel http://qed.econ.queensu.ca/~edd
Reply to: