How to "restart a process" after an update?

Oftentimes, after a zypper up, the system says some processes need to be restarted, and advises to use zypper ps -s to see a list of these processes.
If the process is obvious (say it says firefox in zypper ps -s), I can just restart the application.
But then there are at times entries in zypper ps -s that I don’t know how to restart.
Here’s an example:

sudo zypper ps -s
[sudo] password for root: 

The following running processes use deleted files:

PID  | PPID | UID  | User  | Command          | Service       
-----+------+------+-------+------------------+---------------
1155 | 1    | 0    | root  | cupsd            | cups          
1278 | 1    | 0    | root  | NetworkManager   | NetworkManager
2063 | 1    | 1000 | me | deja-dup-monitor |               
2185 | 1881 | 1000 | me | goa-daemon       |               

You may wish to restart these processes.
See 'man zypper' for information about the meaning of values in the above table.

When a situation like this arises, I restart the computer to make sure these processes are restarted.
Is there a way to restart these processes without restarting the computer?
Thank you.

Although to my eye each of what you listed is associated with a systemd Unit file so can be restarted with a "systemctl restar unit_name " unless you really want to avoid a reboot, rebooting is likely the easiest way to address the issue.

TSU

In general, you can get the systemd unit associated with a given process ID using…

systemctl status <PID>

Rebooting is usually the easiest way to restart everything.

The way that I handle it, is to boot twice per week. And I do updates just before my scheduled boot.

My next scheduled boot is tomorrow evening. I see that there are a couple of updates that have been waiting since yesterday (“firefox” and “vivaldi”). I won’t update those until just before my reboot.

There is no blanket answer. Each process is different. Only small fraction of applications support restarting without losing state which means restarting process may affect your current activity. Trivial example is your login shell; you cannot restart it without throwing yourself out of system. Restarting D-Bus daemon is not supported at all. Rebooting is the most safe way to handle it. It also guarantees that all running process will use updated components.

On Thu, 04 Oct 2018 04:16:03 +0000, arvidjaar wrote:

> Restarting D-Bus daemon is not supported at all.

Restarting dbus is possible, but it’s ugly. You have to basically switch
out of runlevel 5, restart it, and also (as I recall) restart systemd-
logind.

I typically have a look at the services using:

sudo zypper ps -s

And if dbus and/or the display manager aren’t in the list, I just restart
them from a terminal window.

If dbus and/or the display manager are in the list, I switch to text mode
(init 3 or systemctl target multi-user.target), log in as root, and then
restart each service (I usually parse ‘zypper ps -s’ output to grab the
service names), and then restart systemd-logind if dbus needed to restart.

For processes that aren’t services, I just restart the program.

I usually don’t need to reboot, but occasionally I run into a situation
where I can’t get back to graphical.target for some reason, and I end up
rebooting anyways. And naturally, if there’s a kernel update, a reboot
is mandatory (I seem to recall one of the 13.x releases had ksplice or
something similar installed to do live kernel patching, but current
releases don’t).

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C