Module Expr Str ImportFrom alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias identifier Import alias identifier Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore NameLoad FunctionDef arguments args defaults body Expr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body Return TupleLoad NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr Str body Return TupleLoad NameLoad Str If CompareGtE Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad Str body Return TupleLoad NameLoad Str If CompareGtE Call NameLoad SubscriptLoad NameLoad Index Str Call NameLoad Str body Global identifier Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Return ListLoad Str Str Str Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad For NameStore Call NameLoad body For TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Continue TryExcept body With Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore SubscriptLoad Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad Index Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad Index Call AttributeLoad AttributeLoad NameLoad attr attr Dict Str Str Str NameLoad NameLoad NameLoad Return NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareIn NameLoad NameLoad body Return SubscriptLoad NameLoad Index NameLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareEq Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad body Return NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str If CompareEq Call AttributeLoad NameLoad attr NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad Call SubscriptLoad NameLoad Index Str NameLoad attr UnaryOpNot Call AttributeLoad NameLoad attr Str Assign NameStore ListComp SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num comprehension NameStore NameLoad Assign NameStore Call NameLoad Call AttributeLoad Call NameLoad attr Return Call NameLoad Call NameLoad BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body If NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad orelse Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad keyword NameLoad If SubscriptLoad NameLoad Index Str body Return NameLoad Return SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return IfExp Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return IfExp Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore IfExp NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad If NameLoad body If NameLoad body Return CompareIn Str Call NameLoad Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Str Return IfExp Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad If NameLoad body Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str keyword NameLoad Return UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad If NameLoad body Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str keyword NameLoad Return UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad keyword NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Expr Call NameLoad NameLoad keyword NameLoad Return Call NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str If Call AttributeLoad NameLoad attr NameLoad NameLoad body If SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str body Return NameLoad orelse Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str If Call AttributeLoad NameLoad attr NameLoad NameLoad body If SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index Str body Return NameLoad orelse Return NameLoad orelse Return NameLoad decorator_list
N/A N/A 
Module for the management of MacOS systems that use launchd/launchctl

.. important::
    If you feel that Salt should be using this module to manage services on a
    minion, and it is using a different module (or gives an error similar to
    *'service.start' is not available*), see :ref:`here
    <module-provider-override>`.

:depends:   - plistlib Python module
 __future__ absolute_import distutils.version LooseVersion N/A logging N/A os N/A plistlib N/A re N/A salt.utils N/A salt.utils.decorators decorators N/A salt.ext.six six N/A log N/A N/A logging getLogger __name__ N/A __virtualname__ service N/A BEFORE_YOSEMITE True __virtual__ N/A N/A N/A N/A N/A 
    Only work on MacOS
     N/A N/A N/A N/A N/A salt utils is_darwin N/A N/A N/A False Failed to load the mac_service module:
Only available on Mac OS X systems. N/A N/A N/A N/A N/A os path exists /bin/launchctl N/A N/A N/A False Failed to load the mac_service module:
Required binary not found: "/bin/launchctl" N/A N/A N/A LooseVersion N/A __grains__ N/A osrelease N/A LooseVersion 10.11 N/A N/A N/A False Failed to load the mac_service module:
Not available on El Capitan, uses mac_service.py N/A N/A N/A LooseVersion N/A __grains__ N/A osrelease N/A LooseVersion 10.10 N/A N/A BEFORE_YOSEMITE N/A BEFORE_YOSEMITE False N/A __virtualname__ N/A _launchd_paths N/A N/A N/A N/A N/A 
    Paths where launchd services can be found
     N/A N/A /Library/LaunchAgents /Library/LaunchDaemons /System/Library/LaunchAgents /System/Library/LaunchDaemons N/A _available_services N/A N/A N/A N/A N/A 
    Return a dictionary of all available services on the system
     N/A available_services N/A dict N/A launch_dir N/A _launchd_paths N/A N/A N/A root dirs files N/A N/A os walk launch_dir N/A N/A filename files N/A N/A file_path N/A N/A N/A os path join root filename N/A true_path N/A N/A N/A os path realpath file_path N/A N/A N/A N/A N/A os path exists true_path N/A N/A N/A N/A N/A N/A N/A N/A salt utils fopen file_path N/A N/A plist N/A N/A plistlib readPlist true_path N/A N/A N/A Exception N/A N/A cmd N/A N/A /usr/bin/plutil -convert xml1 -o - -- "{0}" format true_path N/A plist_xml N/A N/A N/A __salt__ N/A cmd.run_all cmd python_shell False N/A stdout N/A N/A six PY2 N/A N/A plist N/A N/A plistlib readPlistFromString plist_xml N/A N/A plist N/A N/A plistlib readPlistFromBytes N/A N/A N/A salt utils to_bytes plist_xml N/A N/A available_services N/A N/A N/A N/A plist Label lower N/A filename file_path plist filename true_path plist N/A available_services N/A N/A decorators memoize _service_by_name N/A N/A name N/A N/A N/A 
    Return the service info for a service by label, filename or path
     N/A services N/A _available_services N/A name N/A N/A name lower N/A N/A name services N/A N/A N/A services N/A name N/A service N/A N/A six itervalues services N/A N/A N/A N/A N/A N/A service N/A file_path lower name N/A N/A service N/A N/A basename ext N/A N/A N/A os path splitext N/A service N/A filename N/A N/A N/A N/A basename lower name N/A N/A service N/A False N/A get_all N/A N/A N/A N/A N/A 
    Return all installed services

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_all
     N/A cmd launchctl list N/A service_lines N/A line N/A line N/A N/A N/A N/A __salt__ N/A cmd.run cmd splitlines N/A N/A N/A line startswith PID N/A service_labels_from_list N/A N/A N/A N/A line split N/A 2 N/A line service_lines N/A service_labels_from_services N/A list N/A N/A N/A _available_services keys N/A N/A sorted N/A set N/A service_labels_from_list service_labels_from_services N/A _get_launchctl_data N/A N/A job_label runas N/A None N/A N/A BEFORE_YOSEMITE N/A N/A cmd N/A N/A launchctl list -x {0} format job_label N/A N/A cmd N/A N/A launchctl list {0} format job_label N/A launchctl_data N/A N/A __salt__ N/A cmd.run_all cmd python_shell False runas runas N/A N/A launchctl_data N/A stderr N/A N/A None N/A N/A launchctl_data N/A stdout N/A available N/A N/A job_label N/A N/A N/A 
    Check that the given service is available.

    CLI Example:

    .. code-block:: bash

        salt '*' service.available com.openssh.sshd
     N/A N/A N/A _service_by_name job_label True False N/A missing N/A N/A job_label N/A N/A N/A 
    The inverse of service.available
    Check that the given service is not available.

    CLI Example:

    .. code-block:: bash

        salt '*' service.missing com.openssh.sshd
     N/A N/A N/A _service_by_name job_label False True N/A status N/A N/A job_label runas N/A None N/A N/A 
    Return the status for a service, returns a bool whether the service is
    running.

    CLI Example:

    .. code-block:: bash

        salt '*' service.status <service label>
     N/A service N/A _service_by_name job_label N/A lookup_name N/A service N/A N/A service N/A plist N/A Label job_label N/A launchctl_data N/A _get_launchctl_data lookup_name runas runas N/A launchctl_data N/A N/A BEFORE_YOSEMITE N/A N/A N/A PID N/A dict N/A N/A plistlib readPlistFromString launchctl_data N/A N/A pattern "PID" = [0-9]+; N/A N/A N/A N/A re search pattern launchctl_data True False N/A N/A False N/A stop N/A N/A job_label runas N/A None N/A N/A 
    Stop the specified service

    CLI Example:

    .. code-block:: bash

        salt '*' service.stop <service label>
        salt '*' service.stop org.ntp.ntpd
        salt '*' service.stop /System/Library/LaunchDaemons/org.ntp.ntpd.plist
     N/A service N/A _service_by_name job_label N/A service N/A N/A cmd N/A N/A launchctl unload -w {0} format N/A service N/A file_path runas runas N/A N/A N/A N/A __salt__ N/A cmd.retcode cmd runas runas python_shell False N/A False N/A start N/A N/A job_label runas N/A None N/A N/A 
    Start the specified service

    CLI Example:

    .. code-block:: bash

        salt '*' service.start <service label>
        salt '*' service.start org.ntp.ntpd
        salt '*' service.start /System/Library/LaunchDaemons/org.ntp.ntpd.plist
     N/A service N/A _service_by_name job_label N/A service N/A N/A cmd N/A N/A launchctl load -w {0} format N/A service N/A file_path runas runas N/A N/A N/A N/A __salt__ N/A cmd.retcode cmd runas runas python_shell False N/A False N/A restart N/A N/A job_label runas N/A None N/A N/A 
    Restart the named service

    CLI Example:

    .. code-block:: bash

        salt '*' service.restart <service label>
     N/A N/A stop job_label runas runas N/A N/A start job_label runas runas N/A enabled N/A N/A job_label runas N/A None N/A N/A 
    Return True if the named service is enabled, false otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.enabled <service label>
     N/A overrides_data N/A dict N/A N/A plistlib readPlist /var/db/launchd.db/com.apple.launchd/overrides.plist N/A N/A N/A overrides_data get job_label False N/A N/A N/A N/A overrides_data N/A job_label N/A Disabled N/A N/A False N/A N/A True N/A N/A False N/A disabled N/A N/A job_label runas N/A None N/A N/A 
    Return True if the named service is disabled, false otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.disabled <service label>
     N/A overrides_data N/A dict N/A N/A plistlib readPlist /var/db/launchd.db/com.apple.launchd/overrides.plist N/A N/A N/A overrides_data get job_label False N/A N/A N/A N/A overrides_data N/A job_label N/A Disabled N/A N/A True N/A N/A False N/A N/A True N/A