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

fix(macos): fix brew packaging handling #426

Merged
merged 2 commits into from
Aug 1, 2019

Conversation

noelmcloughlin
Copy link
Member

@noelmcloughlin noelmcloughlin commented Jul 31, 2019

This PR fixes various package handling errors on MacOS when homebrew is used.

This PR also is workaround for saltstack/salt#49348

And brew should be run as non-root user.

@noelmcloughlin
Copy link
Member Author

One Travis CI failure is unrelated.

@noelmcloughlin noelmcloughlin force-pushed the macos branch 4 times, most recently from ad89cb9 to 8ecaf79 Compare July 31, 2019 19:33
@aboe76
Copy link
Member

aboe76 commented Jul 31, 2019

@noelmcloughlin I don't know where to start with merging some of this stuff..can you help figure out the order?

@noelmcloughlin noelmcloughlin force-pushed the macos branch 2 times, most recently from e6939bd to 70866d4 Compare July 31, 2019 20:38
@noelmcloughlin
Copy link
Member Author

Verified salt.minion state on MacOS

        ID: salt-minion-brew-workaround
    Function: cmd.run
        Name: /usr/local/bin/brew install salt
      Result: True
     Comment: Command "/usr/local/bin/brew install salt" run
     Started: 21:40:38.248548
    Duration: 3380.916 ms
     Changes:   
              ----------
              pid:
                  83804
              retcode:
                  0
              stderr:
                  Warning: salt 2019.2.0_1 is already installed and up-to-date
                  To reinstall 2019.2.0_1, run `brew reinstall salt`
              stdout:
----------
          ID: salt-minion
    Function: file.recurse
        Name: /private/etc/salt/minion.d
      Result: True
     Comment: The directory /private/etc/salt/minion.d is in the correct state
     Started: 21:40:41.631728
    Duration: 246.998 ms
     Changes:   
----------
          ID: salt-minion
    Function: service.running
        Name: com.saltstack.salt.minion
      Result: False
     Comment: The named service com.saltstack.salt.minion is not available
     Started: 21:40:41.882143
    Duration: 367.579 ms
     Changes:   
----------
          ID: remove-old-minion-conf-file
    Function: file.absent
        Name: /private/etc/salt/minion.d/_defaults.conf
      Result: True
     Comment: File /private/etc/salt/minion.d/_defaults.conf is not present
     Started: 21:40:42.250326
    Duration: 0.341 ms
     Changes:   
----------
          ID: salt-minion
    Function: cmd.run
        Name: exec 0>&- # close stdin
exec 1>&- # close stdout
exec 2>&- # close stderr
nohup salt-call --local service.restart com.saltstack.salt.minion --out-file /dev/null &
      Result: True
     Comment: Command "exec 0>&- # close stdin
              exec 1>&- # close stdout
              exec 2>&- # close stderr
              nohup salt-call --local service.restart com.saltstack.salt.minion --out-file /dev/null &" run
     Started: 21:40:42.250834
    Duration: 5.476 ms
     Changes:   
              ----------
              pid:
                  84417
              retcode:
                  0
              stderr:
              stdout:

Summary for local
------------
Succeeded: 4 (changed=2)
Failed:    1
------------

@noelmcloughlin
Copy link
Member Author

I don't know where to start with merging some of this stuff..can you help figure out the order?

Hi @aboe76 I think PR's are not conflicting.
This package handling issue was discussed in Slack but I got hit by saltstack/salt#49348 too - seems to be working now on MacOS.

I guess service.running needs to be addressed too in future PR.

@noelmcloughlin noelmcloughlin changed the title fix(macos): fix package name for homebrew fix(macos): fix brew packaging handling Jul 31, 2019
@noelmcloughlin noelmcloughlin force-pushed the macos branch 5 times, most recently from d2544a7 to bc7167d Compare August 1, 2019 00:28
@noelmcloughlin
Copy link
Member Author

Retested on MacOS.

          ID: download-salt-minion
    Function: cmd.run
        Name: /usr/local/bin/brew install salt
      Result: True
     Comment: Command "/usr/local/bin/brew install salt" run
     Started: 01:32:02.552883
    Duration: 3396.716 ms
     Changes:   
              ----------
              pid:
                  12207
              retcode:
                  0
              stderr:
                  Warning: salt 2019.2.0_1 is already installed and up-to-date
                  To reinstall 2019.2.0_1, run `brew reinstall salt`
              stdout:
----------
          ID: salt-minion
    Function: file.recurse
        Name: /private/etc/salt/minion.d
      Result: True
     Comment: The directory /private/etc/salt/minion.d is in the correct state
     Started: 01:32:05.952743
    Duration: 262.306 ms
     Changes:   
----------
          ID: salt-minion
    Function: service.running
        Name: com.saltstack.salt.minion
      Result: False
     Comment: The named service com.saltstack.salt.minion is not available
     Started: 01:32:06.218350
    Duration: 414.51 ms
     Changes:   
----------
          ID: remove-old-minion-conf-file
    Function: file.absent
        Name: /private/etc/salt/minion.d/_defaults.conf
      Result: True
     Comment: File /private/etc/salt/minion.d/_defaults.conf is not present
     Started: 01:32:06.633470
    Duration: 0.344 ms
     Changes:   
----------
          ID: salt-minion
    Function: cmd.run
        Name: exec 0>&- # close stdin
exec 1>&- # close stdout
exec 2>&- # close stderr
nohup salt-call --local service.restart com.saltstack.salt.minion --out-file /dev/null &
      Result: True
     Comment: Command "exec 0>&- # close stdin
              exec 1>&- # close stdout
              exec 2>&- # close stderr
              nohup salt-call --local service.restart com.saltstack.salt.minion --out-file /dev/null &" run
     Started: 01:32:06.633996
    Duration: 5.385 ms
     Changes:   
              ----------
              pid:
                  12808
              retcode:
                  0
              stderr:
              stdout:
----------
          ID: remove-macpackage-salt
    Function: file.absent
        Name: /tmp/salt.pkg
      Result: True
     Comment: File /tmp/salt.pkg is not present
     Started: 01:32:06.639697
    Duration: 0.572 ms
     Changes:   

Summary for local
------------
Succeeded: 5 (changed=2)
Failed:    1
------------
Total states run:     6
Total run time:   4.080 s

@noelmcloughlin
Copy link
Member Author

noelmcloughlin commented Aug 1, 2019

This PR does not fix #352 because macpackage handling is completely broken and untestable , but does (at least) make macpackage use case testable.

This PR addresses homebrew (not macpackage issues in #352).

@noelmcloughlin noelmcloughlin force-pushed the macos branch 3 times, most recently from 41d819a to 319e077 Compare August 1, 2019 12:10
@noelmcloughlin
Copy link
Member Author

Added commit to fix formulas.sls state on MacOS/FreeBSD. Verified on MacOS.

@aboe76 aboe76 merged commit 190998d into saltstack-formulas:master Aug 1, 2019
@saltstack-formulas-travis

🎉 This PR is included in version 0.58.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants