Skip to content

Simple library for helping with turning executable into system service

Notifications You must be signed in to change notification settings

hubertat/servicemaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

service-maker

Simple library for helping with turning executable into system service

usage

Example usage with install flag:

install = flag.Bool("install", false, "install service in os")

flag.Parse()

if *install {
		service := servicemaker.ServiceMaker{
			User:               "runasuser",
			ServicePath:        "/etc/systemd/system/servicename.service",
			ServiceDescription: "service description here",
			ExecDir:            "/srv/servicedir",
			ExecName:           "serviceexec",
		}
		err := service.InstallService()
		if err != nil {
			panic(err)
		} else {
			fmt.Println("service installed!")
			return
		}
	}

About

Simple library for helping with turning executable into system service

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages