[FEATURE REQUEST] master/minion should accept a SIGHUP and reload config #67303
Replies: 52 comments
-
this might be trickier than just that, at the least salt should reload the modules on the minion |
Beta Was this translation helpful? Give feedback.
-
+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). |
Beta Was this translation helpful? Give feedback.
-
I will slate this for the next release then and investigate how viable it will be |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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
|
Beta Was this translation helpful? Give feedback.
-
Ooh, thanks for the report -- even if we don't properly reload, we need to handle SIGHUP more gracefully than that. |
Beta Was this translation helpful? Give feedback.
-
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 :) |
Beta Was this translation helpful? Give feedback.
-
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 ;) |
Beta Was this translation helpful? Give feedback.
-
Thr reason this does not work is that catching signals in python inturupts On Sun, Jan 4, 2015, 22:12 Thomas Jackson [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
-
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 ;) |
Beta Was this translation helpful? Give feedback.
-
Good point. But just keep that in mind. And generally we are only catching On Sun, Jan 4, 2015, 22:28 Thomas Jackson [email protected] wrote:
|
Beta Was this translation helpful? Give feedback.
-
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 :) |
Beta Was this translation helpful? Give feedback.
-
+1: I'm looking for a way to reload the nodegroups configuration only, without restarting the whole salt-master |
Beta Was this translation helpful? Give feedback.
-
@bbinet Pretty sure that currently works. At least, last time I tried. Nodegroups don't require master restart. |
Beta Was this translation helpful? Give feedback.
-
It does not work for me:
The strange thing is that in the master logs, I can see that the
But I don't know why we then get the Note that it works correctly when I target a nodegroup that was already existing when the salt-master was started. |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
I know this quote is nearly 5 years old, but this is not correct:
Docs:
https://docs.saltstack.com/en/latest/topics/targeting/nodegroups.html If you are testing on the CLI: I only bring this up because for a long time now we have abandoned nodegroups due to the fact we needed a restart and when I read this comment and tested it I realized maybe we don't need a restart. I started reading the nodegroup docs again before realizing that my initial thought was correct and that a restart is in fact required. The docs don't mention the functionality not available, but I assume top file targeting would not be available as that is where I need this. This is all a moot point anyway because currently there is a bug in 2019.2 that prevents compound matching of NodeGroups. So +1 for a way to reload master/minion configs. I want a way to programatically get a list of minions and assign them roles. This would mean nodegroups would be constantly changing and needing to be restarted multiple times per day. |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Personally, I am working on my custom reactors. The master have about 200 minions, so it is quite a pain int the @ss to restart the whole master just to apply those changes. |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
I think the key could be update the engines opts propagating the values across the process manager. I will try to get something like this to work. It's better to relay in pillarenvs and pillars or grains for this kind of config changes that need to be reloaded or set in a more dynamic way. |
Beta Was this translation helpful? Give feedback.
-
I found that there is a dynamic way to load the reactors from an external file without the need to have it statically defined in the master config. Lines 87 to 96 in 38341cb |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
+1 What if only certain config values could be modified during reload and it was carefully documented which ones could? I think it would be very difficult to do everything but some things, such as "timeout", could be pretty straightforward to hot reload. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions