Linux initctl命令:控制和管理init守护进程。
Linux initctl命令 功能描述
使用initctl命令可以控制和管理init守护进程。
Linux initctl命令 语法
initctl [选项] [命令] [选项] [ARG]
命令中各选项的含义如表所示。
initctl命令的命令部分描述如表所示。
Linux initctl命令 示例
列出所有作业
[root@rhel ~]# initctl list
rc stop/waiting
tty (/dev/tty3) start/running, process 1904
tty (/dev/tty2) start/running, process 1902
tty (/dev/tty6) start/running, process 1914
tty (/dev/tty5) start/running, process 1912
tty (/dev/tty4) start/running, process 1906
plymouth-shutdown stop/waiting
control-alt-delete stop/waiting
rcS-emergency stop/waiting
readahead-collector stop/waiting
kexec-disable stop/waiting
quit-plymouth stop/waiting
rcS stop/waiting
prefdm start/running, process 1895
init-system-dbus stop/waiting
readahead stop/waiting
splash-manager stop/waiting
start-ttys stop/waiting
readahead-disable-services stop/waiting
rcS-sulogin stop/waiting
serial stop/waiting
启动作业control-alt-delete
[root@rhel ~]# initctl start control-alt-delete
control-alt-delete start/running, process 3648
[root@rhel ~]#
Broadcast message from root@rhel
(unknown) at 3:34 ...
The system is going down for reboot NOW!
Control-Alt-Delete pressed
//这个时候系统开始重启
查看作业/dev/tty6的状态
[root@rhel ~]# initctl status tty TTY=/dev/tty6 tty (/dev/tty6) start/running, process 1914
停止作业/dev/tty6
[root@rhel ~]# initctl stop tty TTY=/dev/tty6
tty stop/waiting
[root@rhel ~]# initctl status tty TTY=/dev/tty6
initctl: Unknown instance: /dev/tty6
//此时已经不能使用tty6终端了
启动作业/dev/tty6
[root@rhel ~]# initctl start tty TTY=/dev/tty6
tty (/dev/tty6) start/running, process 2638
重新启动作业/dev/tty6
[root@rhel ~]# initctl restart tty TTY=/dev/tty6
tty (/dev/tty6) start/running, process 2650
重新加载/dev/tty6配置
[root@rhel ~]# initctl reload tty TTY=/dev/tty6