systemd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SystemdAdapter

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

SystemdAdapter systemd 适配器

func NewSystemdAdapter

func NewSystemdAdapter(isUserUnit bool) *SystemdAdapter

NewSystemdAdapter 创建 systemd 适配器

func (*SystemdAdapter) IsActive

func (s *SystemdAdapter) IsActive(serviceName string) (bool, error)

IsActive 检查服务是否激活

func (*SystemdAdapter) Restart

func (s *SystemdAdapter) Restart(serviceName string) error

Restart 重启服务

func (*SystemdAdapter) Start

func (s *SystemdAdapter) Start(serviceName string) error

Start 启动服务

func (*SystemdAdapter) Status

func (s *SystemdAdapter) Status(serviceName string) (string, error)

Status 获取服务状态

func (*SystemdAdapter) Stop

func (s *SystemdAdapter) Stop(serviceName string) error

Stop 停止服务

Jump to

Keyboard shortcuts

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