On my laptop, the Network Manager daemon starts too late for some other network-dependent services, so they fail to run properly, and never recover. My hack to resolve this uses the Network Manager's dispatcher service to restart the daemon whenever the network comes alive (which could be at boot time, or after joining a network). The same hack could be rewritten to restart any other services (like sendmail) which fail to handle starting up without a network, or networks restarting on them.
In my case, it's Fedora 7 that I'm using, and I think this script was gleaned from elsewhere as it's presented below. I don't recall modifying it, or its original source, though it could have been for something other than NTP, originally. I can't remember if it were this script, or another one, that I customised. And it's probably applicable, if suitably modified, to other distributions.
#!/bin/bash if [ -x /usr/bin/logger ]; then LOGGER="/usr/bin/logger -s -p user.notice -t NetworkManagerDispatcher" else LOGGER=echo fi if [ ! -x /etc/init.d/ntpd ]; then $LOGGER "init script /etc/init.d/ntpd missing or not executible" return fi if [ -n $1 ] && [ $2 == "up" ]; then if [ -f /var/run/ntpd.pid ]; then $LOGGER "ntpd is running, restart" /sbin/service ntpd restart else $LOGGER "ntpd is not running, start" /sbin/service ntpd start fi fi if [ -n $1 ] && [ $2 == "down" ] && [ -f /var/run/ntpd.pid ]; then $LOGGER "ntpd is running, stop" /sbin/service ntpd stop fi
logger sections causes entries to be placed
in the messages log (/var/log/messages) using the logger program, if
possible. If it's not available, then results will be echoed back
to whatever runs the script, for it to deal with (or ignore).
The middle if/then sections deal with restarting or starting the NTP daemon. And the last one stops the daemon when the network is down. This mayn't be necessary, the daemon can probably free wheel until a network becomes available. And might be undesirable if anything else wants to make use of a local NTP daemon (likewise for other daemons you might modify the script for).
This script starts and restarts services whenever the network status changes, it doesn't pay any attention to the /etc/rc*.d/ start stop scripts. So you may as well leave NTP unset to start at boot time, and you'll have to remember to change this script if you don't want to start the service.