FAQ

Page Discussion History

FedoraSystemdServiceFile

Revision as of 19:49, 16 May 2012 by Jamielinux (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Fedora Nginx systemd service file

Should work on Fedora, OpenSUSE, Arch Linux. Tested on Fedora 16 and 17.

Save this file as /lib/systemd/system/nginx.service

#!/bin/sh
[Unit]
Description=A high performance web server and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
 
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
ExecStop=/usr/sbin/nginx -s quit
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target