系统脚本可以放在/lib/systemd/system/下 ,管理员编写的脚本一般可放在/etc/systemd/system/下
[Unit]
Description=nginx
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/webdata/opt/local/tengine/logs/nginx.pid
ExecStart=/webdata/opt/local/tengine/sbin/nginx -c /webdata/opt/local/tengine/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target