Manage systemd services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pyinfra-dev/pyinfra/llms.txt
Use this file to discover all available pages before exploring further.
Powered by Mintlify
Auto-generate your docs
Manage systemd services on Linux systems
Manage systemd services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pyinfra-dev/pyinfra/llms.txt
Use this file to discover all available pages before exploring further.
systemd.daemon_reloadsystemd.daemon_reload(
user_mode=False,
machine=None,
user_name=None,
)
systemd.servicesystemd.service(
service,
running=True,
restarted=False,
reloaded=False,
command=None,
enabled=None,
daemon_reload=False,
user_mode=False,
machine=None,
user_name=None,
)
from pyinfra.operations import systemd
# Restart and enable the dnsmasq service
systemd.service(
name="Restart and enable the dnsmasq service",
service="dnsmasq.service",
running=True,
restarted=True,
enabled=True,
)
# Enable logrotate timer
systemd.service(
name="Enable logrotate timer",
service="logrotate.timer",
running=True,
enabled=True,
)