Skip to content

Feature minion.restart#32593

Merged
cachedout merged 4 commits intosaltstack:developfrom
plastikos:feature-minion.restart
Apr 15, 2016
Merged

Feature minion.restart#32593
cachedout merged 4 commits intosaltstack:developfrom
plastikos:feature-minion.restart

Conversation

@plastikos
Copy link
Copy Markdown
Contributor

@plastikos plastikos commented Apr 14, 2016

What does this PR do?

It restarts the minion (adds minion.restart command)

See #32545 and #32040

What issues does this PR fix or reference?

No easy way to remotely kill/restart minion.

Tests written?

No - will be added once #32025 is merged. New feature won't break existing uses.

Thayne Harbaugh added 4 commits March 22, 2016 03:56
* Improve minion.kill for use by minion.restart

  + Add "retcode" status
  + Wait until the process dies (add timeout value)
  + Provide meaningful "comment" information when appropriate

* Add minion.restart: kills minion with minion.kill and then starts a new minion process

  + Can provide a specific ``minion_restart_command`` arg vector in minion configuration
  + If no ``minion_restart_command`` is available then uses ``argv`` of current process
  + If minion is not daemonized then it will kill but not restart - allows for
    direct management of minion by init, systemd or other direct process
    manager.

* Add EX_TEMPFAIL to exitcodes for timeout situtations (used by minion.kill)

TODO: integration tests
@plastikos
Copy link
Copy Markdown
Contributor Author

@cachedout, here it is - rebased.

@cachedout
Copy link
Copy Markdown
Contributor

This is really solid. Well done, sir!

@cachedout cachedout merged commit 9bb8d1c into saltstack:develop Apr 15, 2016
@plastikos
Copy link
Copy Markdown
Contributor Author

@cachedout, thanks. More solid once it has integration tests. ;-)

@cachedout
Copy link
Copy Markdown
Contributor

@plastikos For sure. This is an excellent start though.

@plastikos plastikos deleted the feature-minion.restart branch April 18, 2016 17:39
@plastikos plastikos restored the feature-minion.restart branch April 18, 2016 17:57
@plastikos plastikos deleted the feature-minion.restart branch April 18, 2016 18:00
@plastikos plastikos restored the feature-minion.restart branch April 18, 2016 18:13
@Talkless
Copy link
Copy Markdown
Contributor

Talkless commented Nov 24, 2016

Will this feature be useful in highstate runs?

Like, if I have some helper state:

salt_minion_restart:
    module.wait:
        - name: minion.restart
        #maybe - order: last ? but there cane be multiple "lasts".

And another one for applying some configuration for minion:

salt_minion_conf:
    file.managed:
        - name: /etc/salt/minion.d/custom.conf
        - source <whatever>
        - watch_in:
            module: salt_minion_restart

Will minion.restart allow to finish current highstate run?

Will it be kinda "atomic", meaning that current execution module (in my case state.highstate/apply) is successfully finished, bet no new execution modules will be started until restart, so nothing will be canceled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants