Linux中用systemctl命令管理服务
systemctl start foo.service 启动服务
systemctl restart foo.service	重启服务
systemctl stop foo.service	停止服务
systemctl reload foo.service	重新加载配置文件(不终止服务)
systemctl status foo.service	查看服务状态
systemctl enable foo.service	开机自启动
systemctl disable foo.service	开机不自启动
systemctl is-enabled foo.service 查看特定服务是否是开机自启动
systemctl list-units 根据unit列出目前所有启动的服务,可通过--type限制类别,加上--all则列出所有服务
systemctl list-unit-files 列出所有服务和其启动与禁用情况,可通过--type限制类别
systemctl mask foo.service 强制注销服务,无法再启动
systemctl unmask foo.service 取消注销服务,恢复正常
注意 服务名foo后的.service可以省略
 
                    
                 
                
            
         
 浙公网安备 33010602011771号
浙公网安备 33010602011771号