22.16.206. salt.modules.systemd

Provide the service module for systemd

salt.modules.systemd.available(name)

Check that the given service is available taking into account template units.

CLI Example:

salt '*' service.available sshd
salt.modules.systemd.disable(name, **kwargs)

Disable the named service to not start when the system boots

CLI Example:

salt '*' service.disable <service name>
salt.modules.systemd.disabled(name)

Return if the named service is disabled to start on boot

CLI Example:

salt '*' service.disabled <service name>
salt.modules.systemd.enable(name, **kwargs)

Enable the named service to start when the system boots

CLI Example:

salt '*' service.enable <service name>
salt.modules.systemd.enabled(name)

Return if the named service is enabled to start on boot

CLI Example:

salt '*' service.enabled <service name>
salt.modules.systemd.execs()

Return a list of all files specified as ExecStart for all services.

CLI Example:

salt '*' service.execs
salt.modules.systemd.force_reload(name)

Force-reload the specified service with systemd

CLI Example:

salt '*' service.force_reload <service name>
salt.modules.systemd.get_all()

Return a list of all available services

CLI Example:

salt '*' service.get_all
salt.modules.systemd.get_disabled()

Return a list of all disabled services

CLI Example:

salt '*' service.get_disabled
salt.modules.systemd.get_enabled()

Return a list of all enabled services

CLI Example:

salt '*' service.get_enabled
salt.modules.systemd.missing(name)

The inverse of service.available. Returns True if the specified service is not available, otherwise returns False.

CLI Example:

salt '*' service.missing sshd
salt.modules.systemd.reload(name)

Reload the specified service with systemd

CLI Example:

salt '*' service.reload <service name>
salt.modules.systemd.restart(name)

Restart the specified service with systemd

CLI Example:

salt '*' service.restart <service name>
salt.modules.systemd.show(name)

Show properties of one or more units/jobs or the manager

CLI Example:

salt '*' service.show <service name>
salt.modules.systemd.start(name)

Start the specified service with systemd

CLI Example:

salt '*' service.start <service name>
salt.modules.systemd.status(name, sig=None)

Return the status for a service via systemd, returns a bool whether the service is running.

CLI Example:

salt '*' service.status <service name>
salt.modules.systemd.stop(name)

Stop the specified service with systemd

CLI Example:

salt '*' service.stop <service name>
salt.modules.systemd.systemctl_reload()

Reloads systemctl, an action needed whenever unit files are updated.

CLI Example:

salt '*' service.systemctl_reload

Docs for previous releases are available on salt.rtfd.org.

Latest Salt release: 2014.1.13

Try the shiny new release candidate of Salt, v2014.7.0rc6! More info here.

Previous topic

22.16.205. salt.modules.system

Next topic

22.16.207. salt.modules.test

SaltStack News

Upcoming SaltStack events, webinars and local meet ups and user groups.