FreeBSD > Init to reboot or shutdown system

FreeBSD init works different ways. In BSD style, it specifies the kernel security level as follows:
-1: Permanently insecure mode.
0: Insecure mode
1: Secure mode
2: Highly secure mode
3: Network secure mode

ADVERTISEMENTS

You can get current security level (FreeBSD runlevel) using sysctl command:
# sysctl –a | grep kern.securelevel

You can setup new security level in /etc/rc.conf file:
1) Open file in text editor
# vi /etc/rc.conf

2) Add or modify following:
kern_securelevel_enable=”YES” # kernel security level
kern_securelevel=”2″ # range: -1..3 as above

3) Save the changes. Exit and restart FreeBSD.

If init used from command line i.e as a user process, init will emulate AT&T System V UNIX behavior as follows:

0: Halt and turn the power off
1: Go to single-user mode
6: Reboot the machine
c: Block further logins
q: Rescan the /etc/ttys file

1) To halt and turn the power off type:
# init 0

2) You can also use normal halt or shutdown command to shutdown system.

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
0 comments… add one

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.