saltstack / saltstack/salt

[BUG] service.dead fails on system services on macOS

Open
#58,323 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-more-info
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
When unloading some services, launchd prints "Operation in progress." to stderr before
the unload completes. Salt interprets output on stderr as a failure even if return code is 0.
This is new behavior on macOS 10.15 and is not exhibited on 10.14 or previous versions.

Setup
Grab a mac with macOS 10.15 or newer.

Steps to Reproduce the behavior
Put below stanza into a state and run the state:

watchdog_service:
  service.dead:
    - name: /System/Library/LaunchDaemons/com.apple.watchdogd.plist

Expected behavior
Service is unloaded, state is successful.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
           Salt: 3000.2
 
Dependency Versions:
           cffi: 1.12.2
       cherrypy: unknown
       dateutil: 2.8.0
      docker-py: Not Installed
          gitdb: 2.0.6
      gitpython: 2.1.15
         Jinja2: 2.10.1
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: 3.8.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.5.4 (default, Apr 16 2020, 20:07:06)
   python-gnupg: 0.4.4
         PyYAML: 5.1.2
          PyZMQ: 18.0.1
          smmap: 3.0.2
        timelib: 0.2.4
        Tornado: 4.5.3
            ZMQ: 4.3.1
 
System Versions:
           dist:   
         locale: US-ASCII
        machine: x86_64
        release: 19.6.0
         system: Darwin
        version: 10.15.6 x86_64

Additional context
Even though the state correctly unloads the service, dependent states fail to execute because salt state is a failure.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Salt's service.dead handling for macOS launchd services and trace how stderr and the command return code determine state success. Reproduce with the com.apple.watchdogd.plist example on macOS 10.15 or newer; done means the service unloads successfully and dependent states continue executing.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, python
Domain
devops, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.