Robust cross platform
CREATE
/DELETE
/START
/STOP
/QUERY
system service for GoThis repo is a cross platform reference implementation of the SERVICE spec
go get github.com/codemodify/systemkit-service ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ ~~~~ func main() { mySrevice := service.NewServiceFromConfig(service.Config{ Name: "test-service", Description: "Test Service", Executable: "/bin/sleep", Args: []string{"40"}, WorkingDirectory: "/tmp", Restart: true, DelayBeforeRestart: 10, StdOut: service.LogConfig{ Disable: true, }, StdErr: service.LogConfig{ Disable: true, }, }) err := mySrevice.Install() if err != nil { fmt.Println(err.String()) } }
API Install()
Installs the service Uninstall()
Deletes the service Start()
Starts the service Stop()
Stops the service Info()
Queries the service ___ ___ NewServiceFromSERVICE()
Service from portable SERVICE
definitionNewServiceFromName()
Service by finding in the system using its name NewServiceFromPlatformTemplate()
Service from a platform dependent template
100% in progress | ||
---|---|---|
systemd | ||
rc.d | ||
procd | ||
sysvinit | ||
launchd | ||
Service Control Manager | ||
cygserver | ||
OpenRC | ||
Shepherd | ||
Mudur | ||
init | ||
cinit | ||
runit | ||
minit | ||
Initng | Berry Linux | |
Android Init | ||
UpStart | ||
Service Management Facility |