restart-services - Tool to manage OpenRC services that need to be restarted

Copyright (c) 2014-2019 by Marc Schiffbauer <mschiff at g.o>, released under the GPLv3

Current README:


This tool currently only supports OpenRC, no systemd support (yet?)

What is this?

On Gentoo systems after upgrading packages there will be services that
need to be restarted most of the time.

You have different choices now:
* reboot your system (you don't want that)
* manually search for upgraded services and restart all of them one by one
* use something like the 'lib_users' tool to find processes using deleted 
  files and try to spot which of them are services that need to be restarted.

I found all of the above options to be too timeconsuming or inconvenient.
So i created another option:


This tool depends on 'lib_users' and will find out which services need to 
be restarted and restarts them if you want.

And as there are services which you can restart all day and night without any
service disruption there are other services which you only want to see restarted
at night when nobody is using them.

So 'restart-services' can be configured in a way so that it will know which services
can be restarted always, never, or only if you tell it to do so explicitely.

Getting started

* $EDITOR /etc/restart-services.conf
* restart-services --help

Using restart-services

After upgrading your system, just run 'restart-services' and it will restart
everything that must be restarted and is configured as "can always be restarted"

Then, at night, you can restart the rest using 'restart-services --critical'

Another option might be to configure it as a hook for emerge, e.g. something like that:

 if [ "${EBUILD_PHASE}" == "postinst" ]; then

Or maybe if you just want them listed:

 if [ "${EBUILD_PHASE}" == "postinst" ]; then
   echo "Services that need to be restarted:"
   restart-services -l

Advanced configuration

You can use any of the long command line options as configuration parameters in
the config file. Just write them in UPPER case and replace dashes by underscores.

Example: If you want to make "--no-countdown" the default, just add "NO_COUNTDOWN=1"
to the configuration file.


Page was last updated on Mon Mar 11 11:02:58 UTC 2019