在Linux6中查看及设置开机自启信息是使用chkconfig命令,Linux7中此命令已经被替代,接下来我们就来研究下Linux7中的区别所在. chkconfig --list Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd config
本文要记述的是最简单的Ubuntu下开机自启 nginx的脚本 这里将nginx装在了/usr/local/nginx目录下,nginx本身没有注册成服务,所以直接使用服务开机自启是不行的,除非自己写nginx.service脚本,这不在本文范畴内. 创建脚本文件 $ sudo vim /etc/init.d/nginx.sh 脚本内容,注意替换root密码.nginx执行文件目录和配置文件目录 #!/bin/bash #auto run nginx when system startup su
ubuntu-16.10 开始不再使用initd管理系统,改用systemd systemd is now used for user sessions. System sessions had already been provided by systemd in previous Ubuntu releases. 快速看了 systemd 的使用方法,发现改动有点大, 包括用 systemctl 命令来替换了 service 和 chkconfig 的功能. 比如以前启动 mysql 服务用