Just did the zypper dup for tumbleweed 20181110 and made a check with zypper ps -s after a reboot and came up with this.
How can you restart a deleted processes? Should haveged be reinstalled?
zypper ps -s
The following running processes use deleted files:
PID | PPID | UID | User | Command | Service
----+------+-----+------+-------------------+--------
387 | 1 | 0 | root | haveged (deleted) | haveged
You may wish to restart these processes.
> Just did the zypper dup for tumbleweed 20181110 and made a check with
> zypper ps -s after a reboot and came up with this.
>
> How can you restart a deleted processes? Should haveged be reinstalled?
>
>
>
>
> Code:
> --------------------
> zypper ps -s
> The following running processes use deleted files:
>
> PID | PPID | UID | User | Command | Service
> ----±-----±----±-----±------------------±-------
> 387 | 1 | 0 | root | haveged (deleted) | haveged
>
> You may wish to restart these processes.
> --------------------
For this service, you can just run:
sudo systemctl restart haveged
No need to reinstall the service - Linux keeps the existing process
running (and doesn’t free up the file inodes) until the service restarts.
There are a few services that may continue to hold files open after a
restart that zypper ps -s will incorrectly report. I see that on one of
my Leap systems on occasion - nothing really to worry about.
Edit:
I spoke too soon. It does start the service but on either a reboot or shutdown the service isn’t started and needs to be started again.
Where can I make this change to start haveged permanent?
erlangen:~ # journalctl -b -u haveged.service
-- Logs begin at Sun 2018-08-26 08:48:18 CEST, end at Tue 2018-11-13 06:50:10 CET. --
Nov 12 19:19:32 erlangen haveged[214]: haveged: listening socket at 3
Nov 12 19:19:33 erlangen haveged[214]: haveged: restart in new root: /sysroot
Nov 12 19:19:33 erlangen haveged[214]: haveged: listening socket at 3
Nov 12 19:19:33 erlangen haveged[214]: haveged: Fail:set_watermark()!
Nov 12 19:19:33 erlangen haveged[214]: haveged starting up
Nov 12 19:19:33 erlangen systemd[1]: haveged.service: Main process exited, code=exited, status=1/FAILURE
Nov 12 19:19:33 erlangen systemd[1]: haveged.service: Failed with result 'exit-code'.
Nov 12 19:19:33 erlangen systemd[1]: haveged.service: Service RestartSec=100ms expired, scheduling restart.
Nov 12 19:19:33 erlangen systemd[1]: haveged.service: Scheduled restart job, restart counter is at 1.
Nov 12 19:19:33 erlangen systemd[1]: Stopped Entropy Daemon based on the HAVEGE algorithm.
Nov 12 19:19:33 erlangen systemd[1]: Started Entropy Daemon based on the HAVEGE algorithm.
Nov 12 19:19:33 erlangen haveged[410]: haveged: listening socket at 3
Nov 12 19:19:34 erlangen systemd[1]: haveged.service: Service RestartSec=100ms expired, scheduling restart.
Nov 12 19:19:34 erlangen systemd[1]: haveged.service: Scheduled restart job, restart counter is at 2.
Nov 12 19:19:34 erlangen systemd[1]: Stopped Entropy Daemon based on the HAVEGE algorithm.
Nov 12 19:19:34 erlangen systemd[1]: Started Entropy Daemon based on the HAVEGE algorithm.
Nov 12 19:19:34 erlangen haveged[567]: haveged: listening socket at 3
erlangen:~ #
According to what you just posted, your haveged service is running fine although after a few restarts in the beginning.
As I described in my post previous to this one, you need to run the following to return current status of the service
systemctl status haveged
To further verify that your system has no related issues, you can check the result of the following command which reads the size of your entropy cache, which should be larger than 1024
erlangen:~ # journalctl --since today -u haveged.service
-- Logs begin at Sun 2018-08-26 08:48:18 CEST, end at Tue 2018-11-13 22:15:18 CET. --
Nov 13 22:14:27 erlangen haveged[567]: haveged: Stopping due to signal 15
Nov 13 22:14:27 erlangen systemd[1]: Stopping Entropy Daemon based on the HAVEGE algorithm...
Nov 13 22:14:27 erlangen haveged[567]: haveged starting up
Nov 13 22:14:27 erlangen systemd[1]: Stopped Entropy Daemon based on the HAVEGE algorithm.
Nov 13 22:14:27 erlangen systemd[1]: Started Entropy Daemon based on the HAVEGE algorithm.
Nov 13 22:14:27 erlangen haveged[29491]: haveged: listening socket at 3
erlangen:~ # cat /proc/sys/kernel/random/entropy_avail
3755
erlangen:~ #
Looking at a couple of my machines,
It looks like it’s not unusual for haveged to have to undergo at least one restart although none of mine had to restart more than once after the initial start.
I don’t think that restarts are anything to be concerned about,
The only real test of consequence is the entropy cache test I posted…
If that’s good, then your system is healthy.
**●** haveged.service - Entropy Daemon based on the HAVEGE algorithm
Loaded: loaded (/usr/lib/systemd/system/haveged.service; enabled; vendor preset: enabled)
Active: **active (running)** since Sun 2020-10-11 07:40:33 EEST; 2h 22min ago
Docs: man:haveged(8)
http://www.issihosts.com/haveged/
Main PID: 180 (haveged)
Tasks: 1 (limit: 4915)
Memory: 5.0M
CGroup: /system.slice/haveged.service
└─180 @usr/sbin/haveged -w 1024 -v 0 -F
[FONT=monospace]
sudo journalctl -b -u haveged.service
-- Logs begin at Sun 2020-10-11 04:40:35 EEST, end at Sun 2020-10-11 10:04:05 EEST. --
Οκτ 11 07:40:33 FOSTW haveged[180]: haveged: command socket is listening at fd 3
cat /proc/sys/kernel/random/entropy_avail
3682
[/FONT]
[FONT=monospace][FONT=monospace][FONT=monospace][FONT=monospace][FONT=monospace]ls -l
-rwxr-xr-x 1 root root 31496 Aug 25 15:57 /usr/sbin/haveged*
[/FONT][/FONT]$ file /usr/sbin/haveged
/usr/sbin/haveged: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=0a6fd315a7ba8238afed7f83ac3ede20b1f0eae2, for GNU/Linux 3.2.0, stripped[/FONT][/FONT][/FONT]
[/FONT][/FONT][/FONT][/FONT]after restarting the service
[FONT=monospace][FONT=monospace][FONT=monospace][FONT=monospace][FONT=monospace]
sudo journalctl -b -u haveged.service
-- Logs begin at Sun 2020-10-11 04:40:35 EEST, end at Sun 2020-10-11 10:18:19 EEST. --
Οκτ 11 07:40:33 FOSTW haveged[180]: haveged: command socket is listening at fd 3
Οκτ 11 10:17:37 FOSTW haveged[180]: haveged: Stopping due to signal 15
Οκτ 11 10:17:37 FOSTW haveged[180]: haveged starting up
Οκτ 11 10:17:37 FOSTW systemd[1]: Stopping Entropy Daemon based on the HAVEGE algorithm...
Οκτ 11 10:17:37 FOSTW systemd[1]: haveged.service: Succeeded.
Οκτ 11 10:17:37 FOSTW systemd[1]: Stopped Entropy Daemon based on the HAVEGE algorithm.
Οκτ 11 10:17:37 FOSTW systemd[1]: Started Entropy Daemon based on the HAVEGE algorithm.
Οκτ 11 10:17:37 FOSTW haveged[683]: haveged: command socket is listening at fd 3
I’m not sure what is really happening. It is probably some system data structures being change to make it appear as if “/usr/sbin/haveged” is being deleted.
When I reboot:
The timestamp on “/usr/sbin” is not changed;
the inode number for “/usr/sbin/haveged” is not changed.
So I don’t think it is really being deleted. But “lsof” does agree with “zypper ps” that it has been deleted.
I expect it has something to do with the way that “haveged” works.
On a system where I am not using any encrypted partition, but I am using an ecryptfs private directory, I do not see this happening with “haveged”. That is, it does not show up in the output of “zypper ps” on that system. And “lsof -p pid-of-process” does not show a “deleted”. I’m only seeing this strange behaviour where I am using an encrypted partition.
Added note: it may be that “haveged” is started from the “initrd”, and that will look to be deleted after the switch over to the normal root.
I am comparing two Tumbleweed systems (runningn in VMs). On one of them “haveged” does not show as deleted. On the other, it does show as deleted.
On the system where it shows as deleted, “haveged” is started at around 1.69 seconds from boot – I am using the output from “dmesg” to determine this. And the switch over from the temporary root (based on the initramfs) to the final root as at around 22 seconds into the boot.
On the other system, where it does not show as deleted, the switch to the permanent root is much earlier and “haveged” is started after that switch. So I think that’s the real cause of the issue.
If I remember correctly, until recently “haveged” was restarted after the switch to the permanent root. And now that restart is not happening. I’m not sure whether that should be considered a bug – or maybe we should just ignore it.
I should perhaps mention the difference between the two systems. The one where “haveged” shows as deleted is using an encrypted LVM, and the root file system is part of that LVM. So “haveged” is possibly required for the crypto before the permanent root can be mounted.
haveged.service has ‘Restart=always’. What is its status?
erlangen:~ # systemctl status haveged.service
● haveged.service - Entropy Daemon based on the HAVEGE algorithm
Loaded: loaded (/usr/lib/systemd/system/haveged.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-10-12 18:21:28 CEST; 2h 40min ago
Docs: man:haveged(8)
http://www.issihosts.com/haveged/
Main PID: 220 (haveged)
Tasks: 1 (limit: 4915)
Memory: 3.7M
CGroup: /system.slice/haveged.service
└─220 @usr/sbin/haveged -w 1024 -v 0 -F
Oct 12 18:21:28 erlangen haveged[220]: haveged: command socket is listening at fd 3
Warning: journal has been rotated since unit was started, output may be incomplete.
erlangen:~ #