一、nginx

1
vi /lib/systemd/system/nginx.service
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
[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

1
2
3
cd /data/install/haproxy-1.8.13/contrib/systemd/
make PREFIX=/usr/local/haproxy
sudo cp haproxy.service /lib/systemd/system/haproxy.service

五、keepalived

六、命令

1
2
3
4
5
6
7
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

七、参考