更新systemd.service示例
This commit is contained in:
committed by
cloud-init created default user
parent
1ffa3da357
commit
170ea1e86a
@@ -1,15 +1,16 @@
|
||||
[Unit]
|
||||
Description=nginx
|
||||
After=network.target
|
||||
Description=Nginx
|
||||
Documentation=https://nginx.org
|
||||
After=network-online.target firewalld.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Group=root
|
||||
User=root
|
||||
ExecStart=/opt/nginx/1.26.0/sbin/nginx
|
||||
ExecReload=/opt/nginx/1.26.0/sbin/nginx -s reload
|
||||
ExecStop=/opt/nginx/1.26.0/sbin/nginx -s stop
|
||||
PrivateTmp=true
|
||||
Restart=always
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -6,10 +6,12 @@ Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Group=root
|
||||
User=root
|
||||
ExecStart=/opt/rclone/rclone mount onedrive:/demo /onedrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --vfs-cache-mode writes
|
||||
ExecReload=/bin/kill -SIGHUP $MAINPID
|
||||
ExecStop=umount /onedrive
|
||||
Restart=always
|
||||
PrivateTmp=true
|
||||
TimeoutStartSec=infinity
|
||||
|
||||
[Install]
|
||||
|
||||
@@ -6,10 +6,11 @@ Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Group=root
|
||||
User=root
|
||||
ExecStart=/opt/redis/bin/redis-server /opt/redis/redis.conf
|
||||
ExecReload=kill -9 $(ps aux | grep /opt/redis/bin/redis-server | grep -v grep | awk '{print $2}' | tr -d ' ') & /opt/redis/bin/redis-server /opt/redis/redis.conf
|
||||
ExecStop=kill -9 $(ps aux | grep /opt/redis/bin/redis-server | grep -v grep | awk '{print $2}' | tr -d ' ')
|
||||
Restart=always
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -6,10 +6,11 @@ Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
Group=root
|
||||
User=root
|
||||
ExecStart=/opt/tomcat/apache-tomcat-9.0.89/bin/startup.sh
|
||||
ExecReload=/opt/tomcat/apache-tomcat-9.0.89/bin/shutdown.sh & kill -9 $(ps aux | grep /opt/toomcat/apache-tomcat-9.0.89 | grep -v grep | awk '{print $2}' | tr -d ' ') & /opt/tomcat/apache-tomcat-9.0.89/bin/startup.sh
|
||||
ExecStop=/opt/tomcat/apache-tomcat-9.0.89/bin/shutdown.sh
|
||||
Restart=always
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user