centos7使用systemctl start nginx 时报错No such file or directory
这是由于缺少服务导致,可以使用下面方法来创建服务即可使用systemd来启动了
[root@zabbix ~]# vim /lib/systemd/system/nginx.service
[Unit] Description=nginx After=network.target [Service] Type=forking ExecStart=/usr/local/nginx/sbin/nginx ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/usr/local/nginx/sbin/nginx -s quit PrivateTmp=true [Install] WantedBy=multi-user.target