procd scripts and systemd unit minor edits
This commit is contained in:
parent
f23e0c93ec
commit
726e8a74b3
@ -5,7 +5,6 @@
|
|||||||
START=50
|
START=50
|
||||||
STOP=50
|
STOP=50
|
||||||
|
|
||||||
|
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
PROG=/usr/bin/frpc
|
PROG=/usr/bin/frpc
|
||||||
CONFFILE=/etc/frp/frpc.ini
|
CONFFILE=/etc/frp/frpc.ini
|
||||||
@ -14,8 +13,7 @@ start_service(){
|
|||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command "${PROG}" -c "${CONFFILE}"
|
procd_set_param command "${PROG}" -c "${CONFFILE}"
|
||||||
procd_set_param file "${CONFFILE}"
|
procd_set_param file "${CONFFILE}"
|
||||||
procd_set_param user nobody # 无法绑定前 1024 端口
|
procd_set_param user nobody
|
||||||
#procd_set_param user root # 使用 root 可能会导致安全问题,不过可以使用前 1024 端口
|
|
||||||
procd_set_param respawn
|
procd_set_param respawn
|
||||||
|
|
||||||
procd_set_param watch network.interface
|
procd_set_param watch network.interface
|
||||||
@ -26,9 +24,5 @@ start_service(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
reload_service(){
|
reload_service(){
|
||||||
# 比较懒,所以没用重载
|
|
||||||
# 一部分原因是要查配置文件,然后不太会
|
|
||||||
# "${PROG}" reload -c "${CONFFILE}"
|
|
||||||
# 对了,这个函数有必要吗?
|
|
||||||
restart
|
restart
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
START=50
|
START=50
|
||||||
STOP=50
|
STOP=50
|
||||||
|
|
||||||
|
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
PROG=/usr/bin/frps
|
PROG=/usr/bin/frps
|
||||||
CONFFILE=/etc/frp/frps.ini
|
CONFFILE=/etc/frp/frps.ini
|
||||||
@ -14,8 +13,7 @@ start_service(){
|
|||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command "${PROG}" -c "${CONFFILE}"
|
procd_set_param command "${PROG}" -c "${CONFFILE}"
|
||||||
procd_set_param file "${CONFFILE}"
|
procd_set_param file "${CONFFILE}"
|
||||||
procd_set_param user nobody # 无法绑定前 1024 端口
|
procd_set_param user nobody
|
||||||
#procd_set_param user root # 使用 root 可能会导致安全问题,不过可以使用前 1024 端口
|
|
||||||
procd_set_param respawn
|
procd_set_param respawn
|
||||||
|
|
||||||
procd_set_param watch network.interface
|
procd_set_param watch network.interface
|
||||||
@ -26,7 +24,5 @@ start_service(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
reload_service(){
|
reload_service(){
|
||||||
# frps 没有重载
|
|
||||||
# 对了,这个函数有必要吗?
|
|
||||||
restart
|
restart
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
#User=root # 使用 root 可能会导致安全问题,不过可以使用前 1024 端口
|
|
||||||
User=nobody
|
User=nobody
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3s
|
RestartSec=3s
|
||||||
|
@ -6,7 +6,6 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simle
|
Type=simle
|
||||||
#User=root # 使用 root 可能会导致安全问题,不过可以使用前 1024 端口
|
|
||||||
User=nobody
|
User=nobody
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3s
|
RestartSec=3s
|
||||||
@ -14,6 +13,6 @@ ExecStart=/usr/bin/frpc -c /etc/frp/%i.ini
|
|||||||
ExecReload=/usr/bin/frpc reload -c /etc/frp/%i.ini
|
ExecReload=/usr/bin/frpc reload -c /etc/frp/%i.ini
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
Alias=frp.service
|
Alias=frp%i.service
|
||||||
Alias=frp-client.service
|
Alias=frp-client%i.service
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -6,7 +6,6 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
#User=root # 使用 root 可能会导致安全问题,不过可以使用前 1024 端口
|
|
||||||
User=nobody
|
User=nobody
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3s
|
RestartSec=3s
|
||||||
|
@ -6,7 +6,6 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
#User=root # 使用 root 可能会导致安全问题,不过可以使用前 1024 端口
|
|
||||||
User=nobody
|
User=nobody
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3s
|
RestartSec=3s
|
||||||
|
Loading…
Reference in New Issue
Block a user