Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lifanov opened this issue Aug 28, 2020 · 4 comments
Open

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

lifanov opened this issue Aug 28, 2020 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior info-needed waiting for more info
Milestone

Comments

@lifanov
Copy link

lifanov commented Aug 28, 2020

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.

@lifanov lifanov added the Bug broken, incorrect, or confusing behavior label Aug 28, 2020
@DmitryKuzmenko
Copy link
Contributor

@lifanov thank you for the report. By quick look I've found no correlation between stderr and retcode that is used by salt to identify the proc run result. But it could be a timeout or something else. Could you please provide the minion debug log related to the issue?

@sagetherage sagetherage added the info-needed waiting for more info label Sep 29, 2020
@sagetherage sagetherage added this to the Blocked milestone Sep 29, 2020
@sagetherage
Copy link
Contributor

@lifanov can you please provide the the minion debug log?

@garethgreenaway
Copy link
Contributor

@weswhet @sheagcraig Any thoughts on this one? I believe we were talking about the service module not long ago.

@weswhet
Copy link
Contributor

weswhet commented Nov 3, 2020

Well, there a few things. System Daemons are protected by System Integrity Protection. So if SIP is disabled then you may be able to use Salt to modify them.

Second, if SIP is disabled then this looks like a similar issue that is resolved in 3002.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior info-needed waiting for more info
Projects
None yet
Development

No branches or pull requests

5 participants