[FEATURE REQUEST] master/minion should accept a SIGHUP and reload config
this might be trickier than just that, at the least salt should reload the modules on the minion
+1 on this issue. I have plans on modifying the salt master's configuration very, very often, and would prefer to reload the config rather than needing to restart the daemon (which would cause salt outages).
I will slate this for the next release then and investigate how viable it will be
I have added some code to help mitigate some issues when restarting the salt master. I am still looking into how to manage this one
I am running into this issue with upstart. When upstart signals a reload it sends SIGHUP to the parent salt-master. It then promptly dies without error or debug, orphaning all of the children salt-masters. Upstart then thinks the process is dead, leaving lots of orphaned children.
subsequent "start saltmaster" immediately dies off as the port is still used by the orphaned children
At the very least, the salt-master should catch the signal and kill off its children such as
salt/master.py:
Master.start() (line 343)
signal.signal(signal.SIGHUP, sigterm_clean)
Ooh, thanks for the report -- even if we don't properly reload, we need to handle SIGHUP more gracefully than that.
I don't want to be just another +1, but I too am planning to modify the configuration files. Mainly I already have an /etc/salt/master.d/nodegroups.conf file where I define my nodegroups (I am still not convinced by the available external node classifiers available). As such, any modification of said file must trigger a salt-master restart which, if I'm in the middle of a highstate call, triggers not-nice things to happen.
I tried to read salt's code to see if it was relatively easy to add this, but alas I did not understand much :)
Actually I've been digging around the daemons quite a bit recently and although I don't think this will be easy, it should be possible. I'll add this to my list of things to hack on ;)
Thr reason this does not work is that catching signals in python inturupts the zmq threads and we get crashes of lost packets. We hope to get this working with salt raet once we have implimented more of the major components
On Sun, Jan 4, 2015, 22:12 Thomas Jackson [email protected] wrote:
Actually I've been digging around the daemons quite a bit recently and although I don't think this will be easy, it should be possible. I'll add this to my list of things to hack on ;)
Reply to this email directly or view it on GitHub https://github.com/saltstack/salt/issues/570#issuecomment-68669161.
We already catch quite a few signals in the daemons and IIRC we don't have stuff exploding all over... I think the larger problem is going to be the varying classes that keep copies of the opts dict all over creation ;)
Good point. But just keep that in mind. And generally we are only catching sigint and sigterm which do not care if there are zmq issues. Just making sure you know the issues we have already seen here. But this is one reason why we daemonize child procs instead of using sigchld. Which will also cause isses with propogating the sighup
On Sun, Jan 4, 2015, 22:28 Thomas Jackson [email protected] wrote:
We already catch quite a few signals in the daemons and IIRC we don't have stuff exploding all over... I think the larger problem is the varying classes that keep copies of the opts dict all over creation ;)
Reply to this email directly or view it on GitHub https://github.com/saltstack/salt/issues/570#issuecomment-68669808.
Yea, I'm thinking we'll want the parent to catch the sighup and coordinate the reload amongst the children. I have some ideas, but I'll need to make some time to mess with it :)
+1: I'm looking for a way to reload the nodegroups configuration only, without restarting the whole salt-master
@bbinet Pretty sure that currently works. At least, last time I tried. Nodegroups don't require master restart.
It does not work for me:
$ salt -c /config -N a test.ping
No minions matched the target. No command was sent, no jid was assigned.
The strange thing is that in the master logs, I can see that the a nodegroup had actually matched the correct list of minions:
2015-07-03 12:16:48,382 [salt.master ][INFO ][178] Clear payload received with command publish
2015-07-03 12:16:48,384 [salt.utils.minions][DEBUG ][178] Evaluating final compound matching expr: ( ( set(['hl-lxc-1-dev', 'hl-mc-9999-dev', 'hl-mc-3-dev', 'hl-mc-8888-dev', 'hl-mc-4-dev', 'hl-mc-5-dev']) ) & ( set(['cm-mc-1-dev']) ) )
But I don't know why we then get the No minions matched the target message.
Note that it works correctly when I target a nodegroup that was already existing when the salt-master was started. Should I create a new issue specifically for that?
If you look at that log line, that expression will evaluate to an empty set. It's &ing two sets, which have no strings in common. This is why it says no minions were matched. Are you certain your new nodegroup actually does match minions?
You're right, so this is working as expected. Thanks and sorry for the noise.
No problem, just wanted to make sure we fixed a bug if there was one! ;)
Is it possible today to refresh just the gitfs_remotes or the file roots without restarting the salt-master?
@sametimesolutions No, not yet.