编译安装nginx,并制作管理脚本 nginx服务管理脚本
问题
在制作脚本管理之前用nginx命令开启了服务,制作脚本,添加服务到系统管理之后,用systemctl命令stop服务,发现关闭失败,服务仍在启动。
解决
用systemctl命令再次启动服务,systemctl start nginx,再关闭服务,systemctl stop nginx,才可关闭成功,因为nginx命令直接启动服务之后,systemctl的stop、restart命令无法生效。
编译安装nginx,并制作管理脚本 nginx服务管理脚本
问题
在制作脚本管理之前用nginx命令开启了服务,制作脚本,添加服务到系统管理之后,用systemctl命令stop服务,发现关闭失败,服务仍在启动。
解决
用systemctl命令再次启动服务,systemctl start nginx,再关闭服务,systemctl stop nginx,才可关闭成功,因为nginx命令直接启动服务之后,systemctl的stop、restart命令无法生效。