Before I start working on one, does anyone know if there a reasonably intelligent script available that restarts all services that zypper ps shows as in having been updated or deleted?
On 2013-12-17 23:16, Miuku wrote:
>
> Before I start working on one, does anyone know if there a reasonably
> intelligent script available that restarts all services that zypper ps
> shows as in having been updated or deleted?
zypper does it, when it is reasonably possible to do automatically. What
it doesn’t, is because it is not that easy.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
And it would be very embarrassing for the clients when a service was stopped in the midst while serving them. A system manager will most probably only let this happen when (s)he aalows it.
Yes, some things are best left to human administrators
Unfortunately it doesn’t seem to work for services like Apache at all so I’m left with a mess if there are large changes.
Well it’s somewhat related to it - I have a use-case where I need to update and restart services during the night when there is a minimum of usage on the system itself and I need to automate it to the maximum.
So I was wondering if anyone had already done it but by the looks of it it’s a no, so I’ll start working on one myself.
Cheers gents.
Did you check if
zypper ps
can be of any use in writing a script?
On 2013-12-18 10:56, Miuku wrote:
> So I was wondering if anyone had already done it but by the looks of it
> it’s a no, so I’ll start working on one myself.
It is not “no”.
Again, zypper does restart services that it updates.
It does not reload services affected by a library update somewhere else,
nor applications.
This is done by the post-install scripts in the rpms, I believe.
The only catch all solution is for a human to be present.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
On 2013-12-18 13:53, Carlos E. R. wrote:
> On 2013-12-18 10:56, Miuku wrote:
>
>> So I was wondering if anyone had already done it but by the looks of it
>> it’s a no, so I’ll start working on one myself.
>
> It is not “no”.
>
> Again, zypper does restart services that it updates.
I have an update of rsyslog in the line. Lets see what happens.
…]
Look in the log:
> 2013-12-18T13:59:00.577831+01:00 Eleanor4 systemd[1]: Stopping System Logging Service...
> 2013-12-18T13:59:00.613317+01:00 Eleanor4 rsyslogd: [origin software="rsyslogd" swVersion="7.4.6" x-pid="832" x-info="http://www.rsyslog.com"] exiting on signal 15.
> 2013-12-18T13:59:01.705538+01:00 Eleanor4 rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="59682" x-info="http://www.rsyslog.com"] start
> 2013-12-18T13:59:00.659830+01:00 Eleanor4 systemd[1]: Starting System Logging Service...
> 2013-12-18T13:59:01.706219+01:00 Eleanor4 systemd[1]: Started System Logging Service.
> 2013-12-18T13:59:02.664821+01:00 Eleanor4 systemd[1]: Reloading.
> 2013-12-18T13:59:02.806303+01:00 Eleanor4 systemd[1]: Reloading.
> 2013-12-18T13:59:02.954822+01:00 Eleanor4 systemd[1]: Stopping Name Service Cache Daemon...
> 2013-12-18T13:59:03.138898+01:00 Eleanor4 systemd[1]: Starting Name Service Cache Daemon...
Do you see it? Syslog was restarted; notice the version change, proving
it was updated. And nscd. I stopped looking there. Of course, if you
look at “zypper ps” you see a thousand lines of things that have to be
reloaded (libc was updated).
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
Strictly speaking, it is done in RPM postinstall script. So it is up to each package(r) to implement. Most distributions including openSUSE provide set of macros that are used during RPM build and assist in doing standard tasks in uniform manner.
On 2013-12-18 14:26, arvidjaar wrote:
>
> robin_listas;2609482 Wrote:
>>
>> Again, zypper does restart services that it updates.
>
> Strictly speaking, it is done in RPM postinstall script. So it is up to
> each package(r) to implement. Most distributions including openSUSE
> provide set of macros that are used during RPM build and assist in doing
> standard tasks in uniform manner.
Yes, I did mention it was those scripts, but your explanation is way
more complete
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
Well apparently at least Apache 2 packages from BS do not do this properly (or perhaps it was 12.3 patches) - either way I’m hacking together a script that parses zypper ps output, tries to sanitize it a bit and compare it to a list of “safe services” to restart - I’ll put it up here or BS when I get it done and I’m not too ashamed at how bad my bash scripting has gotten over the years
This will allow me to automate most of the updates - the systems in question mainly need updates for things like nginx, apache2, php, mysql etc. which are rather unlikely to completely blow up when official patches are installed.