salt icon indicating copy to clipboard operation
salt copied to clipboard

Minion Restart - ZD-329

Open rickh563 opened this issue 11 years ago • 12 comments

One is restarting the minion automatically, which should probably be the job of the init system. It mostly depends on whether the minion completely dies as a result of an error, or freezes. Either way, if the minion is dead, it's hard for it to restart itself. But we can probably implement this in the init system.

rickh563 avatar Jul 13 '15 19:07 rickh563

One is restarting the minion automatically, which should probably be the job of the init system. It mostly depends on whether the minion completely dies as a result of an error, or freezes. Either way, if the minion is dead, it's hard for it to restart itself. But we can probably implement this in the init system.

basepi avatar Jul 16 '15 17:07 basepi

ZD-329

meggiebot avatar Aug 03 '15 23:08 meggiebot

Committed to customer for Boron release

meggiebot avatar Aug 07 '15 19:08 meggiebot

Do we know what OS this is on? We need to make sure we're controlling packaging before we commit to what amounts to a packaging fix.

cachedout avatar Aug 07 '15 19:08 cachedout

We control the init scripts for the most common distros in our own repo, so this isn't super dependent on packaging.

Distro still needed, though.

basepi avatar Aug 07 '15 19:08 basepi

An inquiry is in process. I will report.

rickh563 avatar Aug 07 '15 20:08 rickh563

OS' used by the given user -- RHEL – 5/6 and future 7

rickh563 avatar Aug 12 '15 21:08 rickh563

Discussed with basepi again on 9/21, we are committed for Boron

meggiebot avatar Sep 21 '15 17:09 meggiebot

I'm sorry, but I have no idea what is going on here.

terminalmage avatar Jan 07 '16 21:01 terminalmage

OK, @basepi caught me up on this.

Doing this in the initscript is an awful idea. Initscripts have to exit, and the only way to make the script keep the process running is for the initscript to never exit. Which is not how init systems are supposed to work.

They'd be better off starting the master or minion using a watchdog service like monit.

http://www.tecmint.com/how-to-install-and-setup-monit-linux-process-and-services-monitoring-program/

I can investigate example monit configurations that will run the master/minion for us. Doing it through monit would actually bypass the initscript altogether and monit would keep the service running. To stop the service, you'd bring it down using monit rather than the normal means.

terminalmage avatar Jan 07 '16 22:01 terminalmage

@basepi and I were talking and systemd (the init system for RHEL7, Debian 8, and the upcoming Ubuntu 16.04 LTS) does have a mechanism to automatically restart a service.

We can even make this configurable using an EnvironmentFile param to let the user provide the value.

This would be pretty easy to do, and we should do it.

terminalmage avatar Jan 07 '16 22:01 terminalmage

Environment file support added to the RHEL7 spec file in https://github.com/saltstack/salt-pack/pull/12.

terminalmage avatar Jan 14 '16 21:01 terminalmage