how to restart minions?

13,423 views
Skip to first unread message

Sean Channel

unread,
Aug 22, 2012, 5:55:28 PM8/22/12
to salt-...@googlegroups.com
There doesn't seem to be any way to restart a minion. E.g. I added
python-psutil and can't access those funcs until the minion restarts.

service.reload, service.restart, and cmd.run '/etc/init.... ' all resulted in no
minion running.

Do I have to ssh to the minion when I want to restart it?

_S

Sean Channel

unread,
Aug 22, 2012, 7:29:17 PM8/22/12
to salt-...@googlegroups.com
also tried saltutil.sync_all, which did not kill the minion, but also did not have any effect (minion still does not have access to newly installed python--psutil).
_S

Mike Chesnut

unread,
Aug 22, 2012, 7:40:22 PM8/22/12
to salt-...@googlegroups.com
We had some discussion about this a few weeks ago [1], the gist was
that "service.restart salt-minion" works exactly how you'd expect/want
(at least on RH-type platforms). Sounds like maybe that's not the
case for you though... which distro are you on?

1 - https://groups.google.com/forum/?fromgroups=#!msg/salt-users/9FTpqAH9x0M/hhkPu84cxJ0J

Sean Channel

unread,
Aug 22, 2012, 7:44:18 PM8/22/12
to salt-...@googlegroups.com
Thanks Mike! This is Ubuntu, so I'll check again and verify.

[ P.S. are you going to LSPE tomorrow for performance tuning? ]

Ben Hosmer

unread,
Aug 22, 2012, 8:00:49 PM8/22/12
to salt-...@googlegroups.com
I use SALT with Ubuntu and here is what I do:

service salt-minion restart
--
Ben Hosmer

Brevard Tech - Brevard County Florida's Tech User Group

Sean Channel

unread,
Aug 22, 2012, 10:02:42 PM8/22/12
to salt-...@googlegroups.com
Confirmed: the minions do not restart; no process is leftover. This is on
Ubuntu, tested with both with 0.10.2 from the PPA and from develop installed in
/usr/local. I purged the PPA pkgs and copied in the init scripts to test
develop, and my config files were still in place under /etc/salt.

_S

On 08/22/2012 04:40 PM, Mike Chesnut wrote:

Sean

unread,
Aug 23, 2012, 2:11:44 PM8/23/12
to salt-...@googlegroups.com
I should clarify this is just using service.restart from the command line, not
in an SLS.

Thomas S Hatch

unread,
Aug 25, 2012, 1:20:58 PM8/25/12
to salt-...@googlegroups.com
I don't think that we have the daemonization happening to allow for "salt \* service.restart salt-minion" to run cleanly.

David Ward

unread,
Feb 12, 2013, 10:41:23 PM2/12/13
to salt-...@googlegroups.com
Are there any updates on this one? I am keen for an elegant solution (I'd take a hack tbh haha)

Purpose for restarting...change in minion config. Also, previously I have found if a new version of salt is installed I needed to manually go to each box and restart salt-minion.

Thanks.

Ubuntu: 12.04
Salt: 11.0

Thomas S Hatch

unread,
Feb 12, 2013, 10:52:09 PM2/12/13
to salt-...@googlegroups.com
Yes, as this was added about 5 months ago

Thomas S. Hatch  |  Founder, CTO


5272 South College Drive, Suite 301 | Murray, UT 84123


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Andrii Senkovych

unread,
Feb 13, 2013, 12:21:24 PM2/13/13
to salt-...@googlegroups.com
Hello, David,

Although Tomas has answered, I had a good solution when the issue was in place.

Here's my hack (using at daemon) I wrote while dealing with problems
with salt restarts:

https://github.com/jollyroger/salt-states/blob/master/salt/minion/init.sls

Hope this won't be needed.

--
WBR, Andrii Senkovych


2013/2/13 David Ward <dav...@gmail.com>:

David Ward

unread,
Feb 13, 2013, 4:14:26 PM2/13/13
to salt-...@googlegroups.com
Andrii,

Thanks. Nice solution. I like it.

Thomas,
So service.restart salt-minion is meant to work now? I tried that (once) and it left the target machine without a salt-minion running.

Or is there another way to achieve this? 

Running version 11.0

Regards
David Ward

David Dyball

unread,
Feb 14, 2013, 3:09:41 AM2/14/13
to salt-...@googlegroups.com, David Ward
Hi All,

Just wanted to report that `salt 'minion' service.restart salt-minion` on my Ubuntu setup running 0.13.0 also fails to restart the minion. The minion just stops dead and I have to restart it manually.

Let me know if there is any debugging I can do to assist.

Cheers,
David,

Thomas S Hatch

unread,
Feb 14, 2013, 12:18:22 PM2/14/13
to salt-...@googlegroups.com, David Ward
Thanks for the heads up here, we have an open issue on this and will look into it for 0.13.1

Thomas S. Hatch  |  Founder, CTO


5272 South College Drive, Suite 301 | Murray, UT 84123


David Ward

unread,
Feb 17, 2013, 10:03:28 PM2/17/13
to salt-...@googlegroups.com
Thanks Andrii.

I will give this idea of using at a go. Sounds like a feasible workaround for now.

Thanks.

Corey Quinn

unread,
Mar 9, 2013, 5:26:55 PM3/9/13
to salt-...@googlegroups.com
Dredging this one up from the mists of antiquity, so sorry for that, but:

cquinn@virt2 ~ % ps aux |grep salt-minion          0 164 14:25:53 Sat 03-9-2013
root      6334  0.0  0.0 673796 37928 ?        Sl   Mar08   0:01 /usr/bin/python /usr/bin/salt-minion -d

cquinn@salt ~ % sudo salt 'virt2' service.restart "salt-minion"
cquinn@salt ~ %                                  

cquinn@virt2 ~ % ps aux |grep salt-minion          0 165 14:25:58 Sat 03-9-2013
root      6334  0.0  0.0 673796 37928 ?        Sl   Mar08   0:01 /usr/bin/python /usr/bin/salt-minion -d


This is on CentOS after updating both master and minion to 13.1, and hoping to avoid walking through all of my minions by hand to run the latest salt service.  Master has already been restarted.

-- Corey

Erik Johnson

unread,
Mar 9, 2013, 7:52:29 PM3/9/13
to salt-...@googlegroups.com
On Sat, Mar 9, 2013 at 4:26 PM, Corey Quinn <co...@sequestered.net> wrote:
Dredging this one up from the mists of antiquity, so sorry for that, but:

cquinn@virt2 ~ % ps aux |grep salt-minion          0 164 14:25:53 Sat 03-9-2013
root      6334  0.0  0.0 673796 37928 ?        Sl   Mar08   0:01 /usr/bin/python /usr/bin/salt-minion -d

cquinn@salt ~ % sudo salt 'virt2' service.restart "salt-minion"
cquinn@salt ~ %                                  

cquinn@virt2 ~ % ps aux |grep salt-minion          0 165 14:25:58 Sat 03-9-2013
root      6334  0.0  0.0 673796 37928 ?        Sl   Mar08   0:01 /usr/bin/python /usr/bin/salt-minion -d


This is on CentOS after updating both master and minion to 13.1, and hoping to avoid walking through all of my minions by hand to run the latest salt service.  Master has already been restarted.

-- Corey



Does it still fail to restart if you run the following?

sudo salt 'virt2' cmd.run 'service salt-minion restart'


If not, perhaps the minion log may yield some insight, though you've probably already checked it.

 
-Erik

"For me, it is far better to grasp the universe as it really is than to persist in delusion, however satisfying and reassuring."  -- Carl Sagan
Reply all
Reply to author
Forward
0 new messages