I have Slackware 9.1 installed on two machines: my laptop, which has had heavy use and much software added. It now runs linux kernel 2.6.8.1. The startup scripts have not been significantly altered- YET (when I get round to it I'm gonna clean them all up so it does exactly what i want and nothing else).
I also have a server running a reasonably fresh install of 9.1, i haven't got round to upgrading the kernel yet (so it's still running 2.4.22), and apart from some config files not much has changed.
I am having similar problems on both machines- some of the scripts/services just don't bother to start/run. On the server, it's currently sshd- every few boots (the server has to go down every night at the moment) I find that sshd hasn't started. Currently i have a monitor and keyboard attached, but I will soon be moving it into a cupboard so there will be no local access. As you can imagine, sshd failing to start will be even more annoying in this situation. That's all the info I have- it just doesn't bother starting. If I login locally as root and type 'sshd' it starts fine- no messages at all. The only modifications done to the startup scripts have been to add the following to rc.local:
rm /etc/dhcpc/dhcpcd-eth2.pid
dhcpcd eth2
/root/firewall/iptables.server natonly
this all executes fine.
The rc.sshd file is the default installed with slack 9.1:
Code:
#!/bin/sh
# Start/stop/restart the secure shell server:
sshd_start() {
# Create host keys if needed.
if [ ! -r /etc/ssh/ssh_host_key ]; then
/usr/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ''
fi
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
/usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
fi
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
/usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
fi
/usr/sbin/sshd
}
sshd_stop() {
killall sshd
}
sshd_restart() {
if [ -r /var/run/sshd.pid ]; then
echo "WARNING: killing listener process only. To kill every sshd process, you must"
echo " use 'rc.sshd stop'. 'rc.sshd restart' kills only the parent sshd to"
echo " allow an admin logged in through sshd to use 'rc.sshd restart' without"
echo " being cut off. If sshd has been upgraded, new connections will now"
echo " use the new version, which should be a safe enough approach."
kill `cat /var/run/sshd.pid`
else
killall sshd
fi
sleep 1
sshd_start
}
case "$1" in
'start')
sshd_start
;;
'stop')
sshd_stop
;;
'restart')
sshd_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
On my laptop I have added the following commands to rc.local, but it doesn't bother with any of them:
Code:
echo "Attempting to mount 'm'..."
/sbin/mount /mnt/m
echo Done
echo "Setting up WiFi for Z..."
/etc/rc.d/rc.zwifi start
echo "Adding default route..."
route add default gw 192.168.38.1
I have created my own rc.irda script, this executes fine (i have even added some of the other commands to it so that they get executed! and yes, they work fine here so it's not init rejecting the commands or anything):
Code:
#!/bin/sh
#
# irda
#
IRTTY=/dev/ttyS1
IRDEV=/dev/irnet
PCIP=192.168.40.1
ZIP=192.168.40.2
PPPPARAMS="passive noauth local"
[ -f /usr/sbin/irattach ] || exit 0
case "$1" in
start)
echo -n "Starting IrDA... "
/usr/sbin/irattach $IRTTY -s
touch /var/lock/subsys/irda
echo -n "Done"
echo
echo -n "Listening for Zaurus... "
/usr/sbin/pppd $IRDEV $PCIP:$ZIP $PPPPARAMS
echo -n "Ready"
echo
echo "Starting Z WiFi..."
/etc/rc.d/rc.zwifi start
;;
stop)
echo -n "Stopping Zaurus Connection... "
killall -9 pppd
echo -n "Done"
echo
echo -n "Shutting down IrDA... "
killall irattach
rm -f /var/lock/subsys/irda
echo -n "Done"
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: irda {start|stop|restart}"
exit 1
;;
esac
exit 0
This is another custom script, but I didn't hear anything from it until I told the rc.irda script to execute it:
Code:
#!/bin/sh
function wifion()
{
ifconfig wlan0 192.168.40.1
iwconfig wlan0 essid "TPT20"
iwconfig wlan0 mode Ad-Hoc
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.40.0/24 -d 192.168.38.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.40.0/24 -d ! 192.168.40.0/24 -j MASQUERADE
echo "WiFi setup for Zaurus."
}
case "$1" in
start)
wifion
;;
stop)
;;
restart)
;;
*)
echo "Usage: start|stop|restart"
exit 1
;;
esac
exit 0
I have checked that all the above scripts are executable, and I have added bits in rc.M so that the custom scripts get executed (it worked for one anyway). I really can't figure out what's going on here.
Thanks in advance
Simon