systemdinstaller

package
v0.0.0-...-a5f7211 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 5

Documentation

Overview

Util for programmatically writing systemd unit file so your service can be autostarted

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableAndStartCommandHints

func EnableAndStartCommandHints(sf ServiceDefinition) string

gives, among others, command hints for how to start the installed service

func Install

func Install(sf ServiceDefinition) error

installs the service

Types

type Option

type Option func(*ServiceDefinition)

func Args

func Args(args ...string) Option

FIXME(security): args are not shell escaped - DO NOT TAKE THIS FROM USER INPUT

func Docs

func Docs(docs ...string) Option

func Env

func Env(key string, value string) Option

func WaitNetworkInterface

func WaitNetworkInterface(interfaceName string) Option

systemd automatically dynamically generates units for network devices, so we can wait + bind to them. you can find interesting units by invoking $ systemctl list-unit

type ServiceDefinition

type ServiceDefinition struct {
	// contains filtered or unexported fields
}

func Service

func Service(serviceName string, description string, opts ...Option) ServiceDefinition

func UserService

func UserService(serviceName string, description string, opts ...Option) ServiceDefinition

user-level service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL