Date: Thu, 25 Nov 2004 14:54:39 +0900 From: Rob <spamrefuse@yahoo.com> To: FreeBSD <freebsd-questions@freebsd.org> Subject: Re: Restarting rc.conf Message-ID: <41A5739F.50001@yahoo.com> In-Reply-To: <5CB9A43C3CE7C89E8A230981@utd49554.utdallas.edu> References: <41536B85000AC932@ims3e.cp.tin.it> <20041122114050.GL22677@lb.tenfour> <9395922d04112204346673e1ad@mail.gmail.com> <5CB9A43C3CE7C89E8A230981@utd49554.utdallas.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Paul Schmehl wrote:
> --On Monday, November 22, 2004 12:34:58 PM +0000 David Jenkins
> <david.jenkins@gmail.com> wrote:
>
>>
>> I would imagine for convenience - if their reasons are similar to what
>> mine were.
>>
>> i.e if you have made several changes to rc.conf then manually
>> restarting several services via /etc/rc.d or /usr/local/etc/rc.d or
>> running ifconfig is monotonous.
>>
> How monotonous is:
>
> cd /usr/local/etc/rc.d./
> foreach file in .
> do
> $file restart
> done
This does not work if a service has been changed from YES to NO (or has
been removed from rc.conf). Therefore I think this is better:
foreach dir in /etc/rc.d /usr/local/etc/rc.d
do
cd $dir
foreach file in *
do
$file forcestop
$file start
done
done
The "forcestop" will stop the service, no matter what's in the rc.conf file.
The "start" will only start the service, if the service is allowed in rc.conf.
Moreover, I believe this works for 5.X only.
Of course, you'd better sit at the console when you do this!
Rob.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41A5739F.50001>
