mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
feat(proxy): add sd_notify support
This commit is contained in:
parent
70974640ab
commit
fa5be44b69
4 changed files with 43 additions and 0 deletions
23
proxy/lib/systemd.go
Normal file
23
proxy/lib/systemd.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package snowflake_proxy
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
sdnotify "github.com/coreos/go-systemd/v22/daemon"
|
||||
)
|
||||
|
||||
func sdnotifyReady() {
|
||||
sdnotify.SdNotify(false, sdnotify.SdNotifyReady)
|
||||
}
|
||||
|
||||
func sdnotifyStopping() {
|
||||
sdnotify.SdNotify(false, sdnotify.SdNotifyStopping)
|
||||
}
|
||||
|
||||
func sdnotifyStatus(status string) {
|
||||
sdnotify.SdNotify(false, fmt.Sprintf("STATUS=%s", status))
|
||||
}
|
||||
|
||||
func sdnotifyWatchdog() {
|
||||
sdnotify.SdNotify(false, sdnotify.SdNotifyWatchdog)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue