systemd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSystemdDir = "/etc/systemd/system"

DefaultSystemdDir ...

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir    string `json:"dir"`    // Configure the supervisor specific configuration path
	Enable bool   `json:"enable"` // Whether to open the open plug-in
}

Config systemd config

func DefaultConfig

func DefaultConfig() Config

DefaultConfig return default config

func StdConfig

func StdConfig(key string) *Config

StdConfig returns standard configuration information

func (*Config) Build

func (s *Config) Build() *Scanner

Build new a instance

type Install

type Install struct {
	WantedBy string
}

Install install

type Program

type Program struct {
	Unit
	Service
	Install
}

Program program

func (Program) String

func (program Program) String() string

type ProgramExt

type ProgramExt struct {
	Manager  string `json:"manager" toml:"manager"`
	*Program `json:"program" toml:"program"`
	Status   string `json:"status" toml:"status"`
	Content  string `json:"content" toml:"content"`
	FileName string `json:"file_name" toml:"file_name"`
	FilePath string `json:"file_path" toml:"file_path"`
	AppName  string `json:"app_name" toml:"app_name"`
}

ProgramExt program ext show the detail info

func (*ProgramExt) Unwrap

func (program *ProgramExt) Unwrap() *structs.ProgramExt

Unwrap ...

type Scanner

type Scanner struct {
	StatusMap sync.Map //Process configuration state
	// contains filtered or unexported fields
}

Scanner systemd scanner

func (*Scanner) C

func (s *Scanner) C() <-chan *ProgramExt

C ...

func (*Scanner) Close

func (s *Scanner) Close() error

Close close ...

func (*Scanner) ListPrograms

func (s *Scanner) ListPrograms() (tasks map[string]*ProgramExt, err error)

ListPrograms show the systemd list

func (*Scanner) ProcessStatus

func (s *Scanner) ProcessStatus() (processList []structs.ProcessStatus, err error)

ProcessStatus ...

func (*Scanner) Start

func (s *Scanner) Start() error

Start start watch

type Service

type Service struct {
	Environments     []string
	User             string
	Group            string
	WorkingDirectory string
	ExecStart        string
	ExecReload       string
	KillMode         string
	LimitNOFILE      int
	LimitNPROC       int
	Restart          string
	RestartSec       string
	Config           string
}

Service systemd service config

type Unit

type Unit struct {
	Description   string
	Documentation string
	After         string
	Wants         string
}

Unit systemd file struct

Jump to

Keyboard shortcuts

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