Automated salt-minion restart in logrotate starts the salt-minion two or three times - but only on Sundays

221 views
Skip to first unread message

Dominic Hopf

unread,
Aug 10, 2015, 3:33:30 AM8/10/15
to salt-...@googlegroups.com
Greetings,

I'm facing a strange issue here with the salt-minions. Basically the first thing is, that a salt-minion keeps the handle on a log file open after the log file has been rotated. You can point this out by running something like this on your minion:

lsof -n | grep deleted | grep log

To fix or rather work around this issue, I have added a `service-salt-minion restart` to the logrotate, the logrotate config salt-common now looks like this:

/var/log/salt/master
/var/log/salt/minion           
/var/log/salt/*.log          
{          
  weekly
  missingok
  rotate 7
  compress
  notifempty
  postrotate
    service salt-minion restart
  endscript          
}

Now, going through my Cron mails which are sent every day I see the following for the mails on Sunday (yes, this doesn't seem to happen on other days!):

Restarting salt minion control daemon: salt-minion.
Restarting salt minion control daemon: salt-minion.
Restarting salt minion control daemon: salt-minion.

The salt-minion the seems to be running three times, I'm seeing the affected hosts on the salt-master more than one time as well.

Every host as well as the Salt Master is running 2015.5.3+ds-1~bpo70+2 on Debian Wheezy.

Thanks for any ideas on how to solve this & Best Regards,
Dominic

Dmitry Golubenko

unread,
Aug 10, 2015, 4:40:19 AM8/10/15
to salt-...@googlegroups.com
В Пнд, 10/08/2015 в 09:33 +0200, 'Dominic Hopf' via Salt-users пишет:
> Greetings,
>
>
> I'm facing a strange issue here with the salt-minions. Basically the
> first thing is, that a salt-minion keeps the handle on a log file open
> after the log file has been rotated.
I've noticed similar duplicated minion processes when initially
salt-minion started via /etc/init.d/salt-minion, but then service
checked/restarted via service salt-minion command:
http://grokbase.com/t/gg/salt-users/14c38brzew/debian-wheezy-salt-2014-7-salt-minion-duplicate-processess

workaround: remove systemd's config on non-systemd wheezy systems:
/etc/init/salt-minion.conf:
file.absent:
- watch:
- pkg: salt-minion
> --
> 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/d/optout.



Dominic Hopf

unread,
Aug 10, 2015, 5:45:18 AM8/10/15
to salt-...@googlegroups.com
Thanks very much for your quick reply Dmitry, I've added a small state which removes /etc/init/salt-minion.conf. I've applied the state to all affacted hosts and will let you know if this helped as soon as the next logrotate has run (probably my feedback takes until next week, though) :-)

Regards,
Dominic
--
Diese E-Mail ist nicht mit GPG signiert, da ich sie vom Webinterface aus geschrieben habe.

This mail is not signed with GPG because I wrote it from web interface.
Reply all
Reply to author
Forward
0 new messages