• 微信公众号:美女很有趣。 工作之余,放松一下,关注即送10G+美女照片!

redis和nginx配置systemctl

开发技术 开发技术 6天前 4次浏览

REDIS6.x:

[Unit]
Description=Redis Database
After=network.target
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/redis-6.2.1/src/redis-server /usr/local/redis/redis-6.2.1/redis.conf  --supervised systemd
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/usr/local/redis/redis-6.2.1/src/redis-cli shutdown
#ExecStop=/usr/local/redis/redis-6.2.1/src/redis-cli -a password shutdown 2>/dev/null
PrivateTmp=true

[Install]
WantedBy=multi-user.target

 

NGINX:

[Unit]
Description=The nginx HTTP and reverse proxy server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/usr/local/apps/nginx/logs/nginx.pid
ExecStartPre=/usr/bin/rm -f /usr/local/apps/nginx/logs/nginx.pid
ExecStartPre=/usr/local/apps/nginx/sbin/nginx -t
ExecStart=/usr/local/apps/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true

[Install]
WantedBy=multi-user.target

 


程序员灯塔
转载请注明原文链接:redis和nginx配置systemctl
喜欢 (0)