Thursday, August 22, 2013

Linux Nginx Systemd(Systemctl) Service Daemon Registration

1. Create service script

Create file /etc/systemd/system/nginx.service with the content:
[Unit]
Description=Nginx
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload

[Install]
WantedBy=multi-user.target
http://stackoverflow.com/questions/9782895/passenger-with-nginx-not-registered-as-service-in-fedora


2. Reload daemon

systemctl daemon-reload

3. Enable & Start Service

systemctl enable nginx

systemctl start nginx

No comments:

Post a Comment