salt.modules.systemd

Provide the service module for systemd

0.10.0 新版功能.

salt.modules.systemd.available(name)

0.10.4 新版功能.

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

CLI 范例:

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

Disable the named service to not start when the system boots

CLI 范例:

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

Return if the named service is disabled from starting on boot

CLI 范例:

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

Enable the named service to start when the system boots

CLI 范例:

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

Return if the named service is enabled to start on boot

CLI 范例:

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

2014.7.0 新版功能.

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

CLI 范例:

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

0.12.0 新版功能.

Force-reload the specified service with systemd

CLI 范例:

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

Return a list of all available services

CLI 范例:

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

Return a list of all disabled services

CLI 范例:

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

Return a list of all enabled services

CLI 范例:

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

2015.8.5 新版功能.

Return a list of all static services

CLI 范例:

salt '*' service.get_static
salt.modules.systemd.mask(name, runtime=False)

2015.5.0 新版功能.

Mask the specified service with systemd

runtime : False

Set to True to mask this service only until the next reboot

2015.8.5 新版功能.

CLI 范例:

salt '*' service.mask <service name>
salt.modules.systemd.masked(name)

2015.8.0 新版功能.

在 2015.8.5 版更改: The return data for this function has changed. If the service is masked, the return value will now be the output of the systemctl is-enabled command (so that a persistent mask can be distinguished from a runtime mask). If the service is not masked, then False will be returned.

Check whether or not a service is masked

CLI 范例:

salt '*' service.masked <service name>
salt.modules.systemd.missing(name)

2014.1.0 新版功能.

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

CLI 范例:

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

Reload the specified service with systemd

CLI 范例:

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

Restart the specified service with systemd

CLI 范例:

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

2014.7.0 新版功能.

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

CLI 范例:

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

Start the specified service with systemd

CLI 范例:

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

Return the status for a service via systemd, returns True if the service is running and False if it is not.

CLI 范例:

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

Stop the specified service with systemd

CLI 范例:

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

0.15.0 新版功能.

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

CLI 范例:

salt '*' service.systemctl_reload
salt.modules.systemd.unmask(name)

2015.5.0 新版功能.

Unmask the specified service with systemd

CLI 范例:

salt '*' service.unmask <service name>