salt.modules.freebsdservice

The service module for FreeBSD

salt.modules.freebsdservice.available(name)

Check that the given service is available.

CLI 范例:

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

Disable the named service to start at boot

Arguments the same as for enable()

CLI 范例:

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

Return True if the named service is enabled, false otherwise

CLI 范例:

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

Enable the named service to start at boot

name
service name
config : /etc/rc.conf

Config file for managing service. If config value is empty string, then /etc/rc.conf.d/<service> used. See man rc.conf(5) for details.

Also service.config variable can be used to change default.

CLI 范例:

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

Return True if the named service is enabled, false otherwise

name
Service name

CLI 范例:

salt '*' service.enabled <service name>
salt.modules.freebsdservice.get_all()

Return a list of all available services

CLI 范例:

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

Return what services are available but not enabled to start at boot

CLI 范例:

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

Return what services are set to run on boot

CLI 范例:

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

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

CLI 范例:

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

Restart the named service

CLI 范例:

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

Restart the named service

CLI 范例:

salt '*' service.restart <service name>
salt.modules.freebsdservice.start(name)

Start the specified service

CLI 范例:

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

Return the status for a service (True or False).

name
Name of service

CLI 范例:

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

Stop the specified service

CLI 范例:

salt '*' service.stop <service name>