centos7 service

git:https://github.com/jnan88/jnan88.github.io/tree/master/centos7_service

redis

[Unit]
Description=redis
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/redis-server /etc/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
PrivateTmp=true

[Install]
WantedBy=multi-user.target

nginx

[Unit]
Description=nginx
After=network.target

[Service]
Type=forking
ExecStart=/www/server/openresty/nginx/sbin/nginx
ExecReload=/www/server/openresty/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Comments