FAQ

Page Discussion History

Difference between revisions of "FedoraSystemdServiceFile"

(Created page with "= 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 <geshi lan...")
 
m
Line 5: Line 5:
  
 
<geshi lang="bash">
 
<geshi lang="bash">
#!/bin/sh
 
 
[Unit]
 
[Unit]
 
Description=A high performance web server and reverse proxy server
 
Description=A high performance web server and reverse proxy server
Line 15: Line 14:
 
ExecStartPre=/usr/sbin/nginx -t
 
ExecStartPre=/usr/sbin/nginx -t
 
ExecStart=/usr/sbin/nginx
 
ExecStart=/usr/sbin/nginx
ExecReload=/usr/sbin/nginx -s reload
+
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/usr/sbin/nginx -s quit
+
ExecStop=/bin/kill -s QUIT $MAINPID
 
PrivateTmp=true
 
PrivateTmp=true
  

Revision as of 19:56, 16 May 2012

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

[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=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target