Categorygithub.com/codemodify/systemkit-service
modulepackage
1.9.3
Repository: https://github.com/codemodify/systemkit-service.git
Documentation: pkg.go.dev

# README

Service

What

Robust cross platform CREATE / DELETE / START / STOP / QUERY system service for Go

This repo is a cross platform reference implementation of the SERVICE spec

References

  
Spec for portable SERVICEhttps://github.com/codemodify/systemkit-service-spec
Command line toolhttps://github.com/codemodify/systemkit-service-cli
Samples & Testshttps://github.com/codemodify/systemkit-service-tests
Init Frameworkshttps://github.com/codemodify/systemkit-service-encoders-rc_d
 https://github.com/codemodify/systemkit-service-encoders-launchd
 https://github.com/codemodify/systemkit-service-encoders-systemd
 https://github.com/codemodify/systemkit-service-encoders-systemv
 https://github.com/codemodify/systemkit-service-encoders-upstart

How

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 definition
NewServiceFromName()Service by finding in the system using its name
NewServiceFromPlatformTemplate()Service from a platform dependent template

Support

   100% in progress
systemd
rc.d
procd
sysvinit
launchd
Service Control Manager
cygserver
OpenRC
Shepherd
Mudur
init
cinit
runit
minit
InitngBerry Linux
Android Init
UpStart
Service Management Facility

# Packages

No description provided by the author

# Functions

NewServiceFromName -.
NewServiceFromPlatformTemplate -.
NewServiceFromSERVICE -.

# Variables

ErrServiceConfigError -.
ErrServiceDoesNotExist -.
ErrServiceUnsupportedRequest -.

# Structs

Info -.

# Interfaces

Controller - starts and stops a service.
Describer - gets info about a service.
Installer - installs and removes a service.
Service -.