shadowsocks-rust
shadowsocks-rust copied to clipboard
希望能接收信号以重载配置
举个例子: 我启动 ssserver 的时候加载了插件,我的启动命令是
ssserver \
--server-addr 0.0.0.0:1 \
--password password \
--encrypt-method chacha20-ietf-poly1305 \
--timeout 3600 \
--udp-timeout 300 \
--udp-max-associations 1024 \
--nofile 1048576 \
--tcp-keep-alive 300 \
--tcp-fast-open \
--tcp-no-delay \
-U \
--plugin "xray-plugin" \
--plugin-opts "server;tls;fast-open;mode=grpc;host=xxx.domain.com"
这个插件加载了 SSL 证书,假设是免费的证书,有效期只有 3 个月,虽然我设置了 acme.sh 自动续期证书,但是要重启 ssserver 的进程才能让证书生效。
所以想问下 ssserver 能否增加接收某个信号来重启自身进程这个功能?就像 kill -SIGUSR1 <pid of ssserver>
I am using process managers to fulfill the exact same goal. OpenWRT: procd, Linux: systemd.
请问 docker 有类似的功能吗?:grinning:
Well, you can always package any process managers you flavored in Dockerfile.
Well, you can always package any process managers you flavored in Dockerfile.
意思是把 systemd 也打包进容器吗?好像有点大...
How about supervisord, which should be relatively smaller.
Oh BTW, since you have set a crontab to call acme.sh
, why not just kill the ssserver
process and restart it after calling acme.sh
?
Oh BTW, since you have set a crontab to call
acme.sh
, why not just kill thessserver
process and restart it after callingacme.sh
?
acme.sh 的 docker 镜像是这里提供的,它应该是自带了一个 Cron 来自动更新证书的,不是我自己设置的。
目前打算使用 Systemd 的定时器来定时重启 docker 容器来解决此问题了😀
@zonyitoo 请问 ssservice 能否增加类似于 nginx -s reload
的功能?
因为根据 acme.sh 的文档,可以通过配置 DEPLOY_DOCKER_CONTAINER_RELOAD_CMD
来达到更加优雅地重载证书
What behavior do you expect for this reload
feature?
What behavior do you expect for this
reload
feature?
- 发送
SIGUSR1
信号来重启 SS 本身和插件 - 发送
SIGUSR2
信号来重启插件
如果可以的话,并希望信号能传递到插件里面
已通过 restart-container.sh 解决了