rsyslog

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigPath is the live rsyslog drop-in the agent manages. Exported so the
	// reconcile loop can read it to detect drift/deletion.
	ConfigPath = "/etc/rsyslog.d/50-elchi.conf"
)

Variables

This section is empty.

Functions

func GetCurrentConfig

func GetCurrentConfig(logger *logger.Logger) (*client.RequestRsyslog, error)

GetCurrentConfig reads the current rsyslog configuration

func GetServiceStatus

func GetServiceStatus(ctx context.Context, logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)

GetServiceStatus returns the current rsyslog service status using systemd package

func RenderConfig added in v1.6.1

func RenderConfig(config *client.RequestRsyslog) (string, error)

RenderConfig validates the request and returns the exact 50-elchi.conf content that UpdateConfig writes. It is the single source of truth for the rendered file, shared by UpdateConfig and the reconcile loop (which compares it against the live file to detect drift), so the two can never diverge.

func RestartService

func RestartService(ctx context.Context, logger *logger.Logger, runner *cmdrunner.CommandsRunner) error

RestartService restarts the rsyslog service and syslog.socket

func ServiceControl

func ServiceControl(ctx context.Context, serviceName string, action client.SubCommandType, logger *logger.Logger, runner *cmdrunner.CommandsRunner) (*client.ServiceStatus, error)

ServiceControl performs service control operations (start/stop/restart/status) For rsyslog, we need to control both rsyslog.service and syslog.socket

func UpdateConfig

func UpdateConfig(ctx context.Context, config *client.RequestRsyslog, logger *logger.Logger, runner *cmdrunner.CommandsRunner) error

UpdateConfig writes new rsyslog configuration

Types

This section is empty.

Jump to

Keyboard shortcuts

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