Restarting init without rebooting

Nathan Kinkade nkinkade at dsl-only.net
Mon Apr 21 10:16:39 PDT 2003


On Mon, Apr 21, 2003 at 08:22:47AM -0700, Joseph Maxwell wrote:
> Hello,
> 
> There is supposed to be a way of restarting init, after modifications of
> say an rc.* file, by sending a SIGHUP, I think avoiding the need to
> reboot.
> Could someone say how it is done.
> Thanks
> 
> --  Joe  --

It is not necessary to reboot in every case, but you will have to drop
to single user mode and then go back to multi-user mode.  However, you
can get init to re-read the /etc/ttys files by simply sending it a HUP
signal in multi-user mode.  For a number of things, simply dropping to
single user mode and then going back to multi user mode will suffice.
You can drop to single user mode with `shutdown now` or `init 1`.  Once
in single user mode simply `exit` and the machine will resume multi user
mode, thereby relaunching most daemons and re-reading rc.conf.  However, 
this will not affect every change you make, notably kernel related
changes and the like.  For example, I just tested this by altering the
hostname directive in rc.conf and turning off linux binary
compatibility.  When I resumed multi-user operation these were
unaffected i.e. the hostname was not reset and the linux.ko module was
not unloaded.

Nathan

-- 
GPG Public Key ID: 0x4250A04C
gpg --keyserver pgp.mit.edu --recv-keys 4250A04C
http://63.105.21.156/gpg_nkinkade_4250A04C.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030421/5f352c86/attachment.bin


More information about the freebsd-questions mailing list