Contents
binary file の位置が違っていたので直したら、動いている模様。
次の機会に確認する。-- ToshinoriMaeno 2024-03-24 11:43:07
/usr/lib/systemd/system
# cat nginx.service
[Unit] Description=nginx - high performance web server Documentation=https://nginx.org/en/docs/ After=network-online.target remote-fs.target nss-lookup.target Wants=network-online.target [Service] Type=forking PIDFile=/var/run/nginx.pid ExecStart=/usr/local/sbin/nginx -c /etc/nginx/nginx.conf ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/nginx.pid)" ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)" [Install] WantedBy=multi-user.target
# systemctl status nginx.service
● nginx.service - nginx - high performance web server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2024-03-24 20:29:51 JST; 49s ago Docs: https://nginx.org/en/docs/ Process: 5782 ExecStart=/usr/local/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS) Main PID: 5783 (nginx) Tasks: 3 (limit: 1012) Memory: 5.4M CPU: 34ms CGroup: /system.slice/nginx.service ├─5783 "nginx: master process /usr/local/sbin/nginx -c /etc/nginx/nginx.conf" ├─5784 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" └─5785 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" Mar 24 20:29:51 157-7-113-173 systemd[1]: Starting nginx - high performance web server... Mar 24 20:29:51 157-7-113-173 systemd[1]: Started nginx - high performance web server. root@157-7-113-173:/usr/lib/systemd/system# cat /var/run/nginx.pid 5783