# [TIP] Fast FreeBSD reboot/reload.



## francis (Aug 1, 2011)

Hi, probably most of you know this tip, and it is nothing special or new, but because it is really useful, I decided to write about it. Sometimes we need to reboot/reload system, because of various causes. There is a possibility to do it much faster than typical restarting. 

I think, that this command is suitable better for use with non-graphical FreeBSD instalations (please refer to the WARNING! notice. It is very important). It also can be used for various others operations; with jail(8) or _auto-reboot and daemon startup_ etc. But if you use a desktop environment, you could use combinations of *Ctrl + Alt + Backspace* keys to return from various graphical environment to the console. Of course we can use these keys if /etc/X11/xorg.conf file is properly configured. So for example it may look this way;

`$ Ctrl + Alt + Backspace`
`$ sudo /bin/sh /etc/rc`

Now system will return to the moment of starting various daemons, clearing /tmp directory, setting *hostuid*, starting network, setting additional routing and *TCP/IP* options, and so on.

```
[color="DarkBlue"]Setting hostuid: various numbers
Setting hostid: 0x3...
Entropy harvesting: interrupts ethernet point_to_point kickstarts.
Fast boot: skipping disk checks.
Mounting local file systems:
nfe0 no link...... giving up
Starting network: lo0, nfe0
lo0: flags... [/color] (informations about lo0)
[color="DarkBlue"]nfe0: flags...[/color] (informations about nfe0)
[color="DarkBlue"]...
Additional routing options:
devd already running? (pid=667)
Additional TCP/IP options: log_in_vain=1
Creating and/or trimming log files.
Starting syslogd.
Clearing /tmp (X related).
Starting cron.
Starting denyhosts.
Configuring syscons: keymap blanktime

Starting background file system check in 60 seconds.

FreeBSD/i386 (Abaddon) (ttyv0)


[B][color="Green"][Abaddon][/home/francis][/color][/B] startx[/color]
```
After reload the system we can start/return to the graphical environment by running startx command.

*>>>* *WARNING!* I noticed that when this command is execute under a graphical environment, there appears some problems with applications (e.g. when clicking on the Firefox icon, there is no response). There is possibility, that it affected only me. Interesting is that when executing this command under "clear, black console" (immediately after logging to the system with no login manager) and after start environment with *startx* command, all applications seems to operate correctly.*<<<*


----------



## SirDice (Aug 1, 2011)

francis said:
			
		

> *WARNING!* I noticed that when this command is execute under a graphical environment, there appears some problems with applications (e.g. when clicking on the Firefox icon, there is no response). There is possibility, that it affected only me. Interesting is that when executing this command under "clear, black console" (immediately after logging to the system with no login manager) and after start environment with *startx* command, all applications seems to operate correctly. That's the reason for why I mentioned about better using this command in production use (where often there is not graphical environment).


The reason this happens is probably because hald and dbus get restarted, losing all current sessions.

A better way would be to do *init 1* to go to single user mode and just exiting it (thereby going to multi-user again). But this does require console access (because all daemons, including sshd, would be stopped when going to single user mode).


----------



## francis (Aug 7, 2011)

Thanks *SirDice* for response. Maybe you are right, but I don't use HAL and Dbus. I have attained this by editing the /etc/X11/xorg.conf file and adding a few options. Anyway, thanks for suggestions. Best regards!


----------

