Bug 1317 - systemd occupies 100% utilization of CPU
: systemd occupies 100% utilization of CPU
Status: RESOLVED FIXED
Product: Desktop Bugs
Classification: ROSA Desktop
Component: Main Packages
: Fresh
: All Linux
: High major
: ---
Assigned To: ROSA Linux Bugs
: ROSA Linux Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-24 14:50 MSK by FirstLevel
Modified: 2013-03-01 14:01 MSK (History)
10 users (show)

See Also:
RPM Package: systemd-194-10-rosa2012.1.i586
ISO-related:
Bad POT generating:
Upstream: known


Attachments
systemctl-a.txt (20.08 KB, text/plain)
2012-12-24 14:50 MSK, FirstLevel
Details
journalctl -n --lines=100 (7.97 KB, text/plain)
2012-12-25 08:59 MSK, FirstLevel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FirstLevel 2012-12-24 14:50:29 MSK
Created attachment 960 [details]
systemctl-a.txt

Description of problem:
systemd occupies 100% utilization of CPU

I have such information of the top output

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      20   0  5876 3416 2000 R   97  0.2  55:12.21 systemd 
 2875 root      20   0 2226m  33m  32m R   88  1.6  45:58.23 systemd-journal


# uname -r
3.6.10-nrj-desktop-1rosa

I have attached the output of systemctl -a



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
Comment 1 Alexander Burmashev 2012-12-24 14:51:37 MSK
run please journalctl and check what is spammed in the last part of it.
Comment 2 FirstLevel 2012-12-25 08:59:56 MSK
Created attachment 969 [details]
journalctl -n --lines=100
Comment 3 FirstLevel 2012-12-25 09:00:15 MSK
(In reply to comment #1)
> run please journalctl and check what is spammed in the last part of it.

I have attached the output of
journalctl -n --lines=100
Comment 4 Aleksandr Kazantcev 2012-12-25 09:06:47 MSK
Try 

  systemctl enable avahi-dnsconfd.service

If this help stop systemctl spam?
Comment 5 FirstLevel 2012-12-25 13:07:56 MSK
(In reply to comment #4)
> Try 
> 
>   systemctl enable avahi-dnsconfd.service
> 
> If this help stop systemctl spam?

# systemctl enable avahi-dnsconfd.service
ln -s '/lib/systemd/system/avahi-dnsconfd.service' '/etc/systemd/system/multi-user.target.wants/avahi-dnsconfd.service'


I have no any CPU utilization after that
Comment 6 Alexander Burmashev 2012-12-25 15:21:37 MSK
I also added avahi-dnsconf to the default pacakge list, so next time service should be enabled out of the box.
Comment 7 FirstLevel 2012-12-28 09:19:18 MSK
User has critical CPU utilization again.
Загрузка повторилась. 
    1 root      20   0  5876 3732 2172 R   95  0.2   4:43.74 systemd                  
  414 root      20   0 2135m  39m  38m R   80  2.6   4:06.65 systemd-journal          
 1264 root      20   0 31112 1504 1184 S   18  0.1   0:49.65 rsyslogd  

And he has such error in logs:
В логах куча вот таких записей.

Dec 28 13:53:37 localhost systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack.
Dec 28 13:53:37 localhost systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack.
Dec 28 13:53:37 localhost systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack.
Dec 28 13:53:37 localhost systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack.
Dec 28 13:53:37 localhost systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack.
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Dec 28 13:53:37 localhost systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack.
Dec 28 13:53:37 localhost systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack.
Comment 8 FirstLevel 2012-12-29 09:33:50 MSK
I have such problem on my laptop HP probook 6465b too. All updates are installed.
Comment 9 FirstLevel 2012-12-29 09:34:23 MSK
I have 64bit system.
Comment 10 Aleksandr Kazantcev 2012-12-29 10:18:16 MSK
First - what output for

systemctl | grep failed

Second - (from root)

systemctl mask avahi-daemon.service
systemctl mask avahi-daemon.socket 
systemctl avahi-dnsconfd.service

Is bug appear after that ?


P.S. What reason up importance of bug? It's non-resolved upstream bug. We may only workaround it not resolved anymore in upstream...
Comment 11 Denis Koryavov 2012-12-29 12:59:46 MSK
Btw, I have this problem on the my laptop too. As a rule it appears after some time I'm working and after I close laptop lid several times (so, the system "sleeps" several times).
Comment 12 Alexander Burmashev 2012-12-29 13:29:11 MSK
As i previously wrote somewhere, the problem is that sometimes avahi-daemon process dies and leaves /var/run/avahi-daemon/pid. Afterwards systemd tries to start avahi-daemon but since pid from previous crashed process is still on it's place it can't be started.
Comment 13 FirstLevel 2012-12-29 15:25:49 MSK
(In reply to comment #10)
> First - what output for
> 
> systemctl | grep failed
> 
> Second - (from root)
> 
> systemctl mask avahi-daemon.service
> systemctl mask avahi-daemon.socket 
> systemctl avahi-dnsconfd.service
> 
> Is bug appear after that ?
> 
> 
> P.S. What reason up importance of bug? It's non-resolved upstream bug. We
> may only workaround it not resolved anymore in upstream...

[root@freshx32 ~]# systemctl | grep failed
atd.service               loaded failed failed        Job spooling tools
atieventsd.service        loaded failed failed        LSB: ATI Events Daemon
cpupower.service          loaded failed failed        Configure CPU power related settings
networkmanager.service    loaded failed failed        LSB: Daemon for automatically switching to best network connection.
systemd-sysctl.service    loaded failed failed        Apply Kernel Variables
systemd-...-setup.service loaded failed failed        Recreate Volatile Files and Directories
winbind.service           loaded failed failed        LSB: Winbind naming service (winbindd)
[root@freshx32 ~]# 

[root@freshx32 ~]# systemctl mask avahi-daemon.service
ln -s '/dev/null' '/etc/systemd/system/avahi-daemon.service'
[root@freshx32 ~]# systemctl mask avahi-daemon.socket 
ln -s '/dev/null' '/etc/systemd/system/avahi-daemon.socket'
[root@freshx32 ~]# systemctl mask avahi-dnsconfd.service
ln -s '/dev/null' '/etc/systemd/system/avahi-dnsconfd.service'

Results I'll see later.

Reason is simple. It is very critical for laptop energy consumption and for all desktop it causes other applications trying to utilize CPU.
Comment 14 FirstLevel 2012-12-29 15:28:58 MSK
My output was written when I have no CPU utilization
systemctl | grep failed
Comment 15 FirstLevel 2012-12-30 19:43:35 MSK
(In reply to comment #10)
> First - what output for
> 
> systemctl | grep failed
> 
> Second - (from root)
> 
> systemctl mask avahi-daemon.service
> systemctl mask avahi-daemon.socket 
> systemctl avahi-dnsconfd.service
> 
> Is bug appear after that ?
> 
> 
> P.S. What reason up importance of bug? It's non-resolved upstream bug. We
> may only workaround it not resolved anymore in upstream...
User has said that problem is present but in does not appear every time.
Comment 16 Denis Koryavov 2013-01-03 21:12:32 MSK
As for me, the problem is solved by this trick but I had small of the time to check this. If the problem will appear again I'll let you know.
Comment 17 Denis Koryavov 2013-01-03 21:14:28 MSK
*** Bug 1389 has been marked as a duplicate of this bug. ***
Comment 18 Denis Koryavov 2013-01-03 21:15:20 MSK
*** Bug 1360 has been marked as a duplicate of this bug. ***
Comment 19 Alexander Burmashev 2013-01-09 14:33:56 MSK
If someone will notice how to reproduce the bug - please do not hesitate to share the experience :)
For now i can suppose that 
ExecStartPre=/bin/rm -f /var/run/avahi-daemon/pid
may help
Comment 20 mtzseb 2013-01-10 18:21:12 MSK
I suspect that cupsd is the origin of the explosion process systemd and systemd-journald. I'm not sure, but when I turned off my printer, the problem is solved itself instantly!
Comment 21 Alexander Burmashev 2013-01-10 18:24:50 MSK
Actually this helps a lot, because there is indeed such a bug.
Comment 22 Vladimir Potapov 2013-01-14 15:44:07 MSK
On my x586 test system the bug is now (after last updates) shown at every second reboot.
You can do experiments :-)
Comment 23 Alexander Burmashev 2013-01-14 17:58:02 MSK
Ok. I applied a test patch that may help you.

1) Please remove /var/run/avahi-daemon/pid file

2) Check that systemd still consumes much CPU. It should stop doing it after removing /var/run/avahi-daemon/pid

3) Add one this containers to your system ( so that is corresponds to you system arch )
i586
http://abf.rosalinux.ru/downloads/grendizer_personal/container/avahi-897588/RPMS/
x86_64
http://abf.rosalinux.ru/downloads/grendizer_personal/container/avahi-897589/RPMS/

4) Update from it, reboot and then try to reproduce the error one more time.
Comment 24 Vladimir Potapov 2013-01-15 17:00:33 MSK
One workday, four reboot: OK.
Comment 25 Alexander Burmashev 2013-01-16 14:01:39 MSK
OK, i am waiting for feedback until the evening and then i'll push the update to the main.
Comment 26 Vladimir Potapov 2013-01-16 14:23:54 MSK
6 Reboot: - bug appeared again :-(
Comment 27 Konstantin 2013-01-25 14:07:10 MSK
I also have this problem. If I start Rosalinux without network spot awailable, Systemd starts eating CPU, so I must switch to console and stop avahi service and avahi-daemon.service and avahi-daemon.socket.
Comment 28 Alexander Burmashev 2013-01-25 14:21:42 MSK
Did you try patched avahi,  i linked above ?
Comment 29 Konstantin 2013-01-25 14:25:43 MSK
The link is broken (i586).
Comment 30 Eugene Budanov 2013-01-26 02:08:24 MSK
Unfortunaly, same situation with patched Avahi from container.
Comment 31 mtzseb 2013-01-31 00:16:16 MSK
same problem for me :
Jan 30 21:13:45 localhost systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Jan 30 21:13:45 localhost systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack.
Comment 32 Alexander Burmashev 2013-01-31 14:16:12 MSK
Does anybody notice that it may happen due to cups ? Do you have cups started on your machine ? Does this happen if you restart cups.service on your PC ?
Comment 33 Alexander 2013-02-10 13:25:29 MSK
It is not related to CUPS. I have not cups installed, but I have the issue.
Comment 34 Konstantin 2013-02-10 13:36:51 MSK
I masked Cups from starting but still have this issue. When it happens only 'systemctl stop avahi-daemon.socket' helps.
Comment 35 Alexander Burmashev 2013-03-01 14:01:40 MSK
fixed by avahi workaround, already published to the repo