daemonsys

package
v3.0.0-beta13 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnitName = "opensvc-server.service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type T

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

T handle dbus.Conn for systemd

func New

func New(ctx context.Context) (*T, error)

New provides a connected object to dbus systemd that implement following interfaces:

Activated(ctx context.Context) (bool, error)
CalledFromManager() bool
Close() error
NotifyWatchdog() (bool, error)
Start(ctx context.Context) error
Stop(ctx context.Context) error

func (*T) Activated

func (t *T) Activated(ctx context.Context) (bool, error)

Activated detects if opensvc unit is activated

func (*T) CalledFromManager

func (t *T) CalledFromManager() bool

CalledFromManager detects if current process as been launched by systemd

func (*T) Close

func (t *T) Close() error

Close closes systemd dbus connection

func (*T) Defined

func (t *T) Defined(ctx context.Context) (loaded bool, err error)

Defined verify if opensvc systemd unit exists and returns true and job type when unit is loaded

func (*T) IsSystemStopping

func (t *T) IsSystemStopping() (bool, error)

func (*T) NotifyReady

func (t *T) NotifyReady() (bool, error)

NotifyReady sends NotifyReady to systemd

func (*T) NotifyStopping

func (t *T) NotifyStopping() (bool, error)

NotifyStopping sends NotifyStopping to systemd

func (*T) NotifyWatchdog

func (t *T) NotifyWatchdog() (bool, error)

NotifyWatchdog sends watch dog notify to systemd

func (*T) Restart

func (t *T) Restart() error

Restart restarts the opensvc systemd unit

restart calls systemd-run systemctl restart opensvc-agent. This allows the command to be attached on another control group and prevent systemd warnings during 'om daemon restart' such as:

systemd[1]: Stopping OpenSVC server...
systemd[1]: opensvc-server.service: Succeeded.
systemd[1]: Stopped OpenSVC server.
systemd[1]: opensvc-server.service: Found left-over process 2899690 (om) in control group while starting unit. Ignoring.
systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
systemd[1]: opensvc-server.service: Found left-over process 2899697 (systemctl) in control group while starting unit. Ignoring.
systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
systemd[1]: Starting OpenSVC server...
systemd[1]: Started OpenSVC server.

func (*T) Start

func (t *T) Start(ctx context.Context) error

Start starts the opensvc systemd unit

func (*T) Stop

func (t *T) Stop(ctx context.Context) error

Stop stops the opensvc systemd unit

Jump to

Keyboard shortcuts

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