systemd
文章目录
一、nginx
vi /lib/systemd/system/nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
#After=syslog.target network.target remote-fs.target nss-lookup.target
After=syslog.target network.target
[Service]
Type=forking
PIDFile=/data/nginx/logs/nginx.pid
ExecStartPre=/data/nginx/sbin/nginx -t
ExecStart=/data/nginx/sbin/nginx
ExecReload=/data/nginx/sbin/nginx -s reload
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
二、dockerd
三、mysqld
四、haproxy
cd /data/install/haproxy-1.8.13/contrib/systemd/
make PREFIX=/usr/local/haproxy
sudo cp haproxy.service /lib/systemd/system/haproxy.service
五、keepalived
六、命令
systemctl daemon-reload
systemctl enable nginx.service
systemctl start nginx.service
systemctl stop nginx.service
systemctl reload nginx.service
systemctl restart nginx.service
systemctl status nginx.service
七、参考
上次更新 2019-01-04
原始文档 查看本文 Markdown 版本 »