Add `StartLimit` to plasma-plasmashell.service.in
On my slowish laptop plasmashell
most of time took around ~4 seconds (but it hugely varies) to start and crash.
This was causing infinite crash-restart loop because it never reached Systemd default limit of 5 times in 10s.
okt 28 19:22:31 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=dumped, status=7/BUS
okt 28 19:22:31 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'core-dump'.
okt 28 19:22:31 Arch systemd[893]: plasma-plasmashell.service: Consumed 1.120s CPU time.
okt 28 19:22:31 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 2.
okt 28 19:22:31 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 28 19:22:31 Arch systemd[893]: plasma-plasmashell.service: Consumed 1.120s CPU time.
okt 28 19:22:31 Arch systemd[893]: Starting KDE Plasma Workspace...
[...]
okt 28 19:22:35 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=dumped, status=7/BUS
okt 28 19:22:35 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'core-dump'.
okt 28 19:22:35 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 28 19:22:36 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 3.
okt 28 19:22:36 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 28 19:22:36 Arch systemd[893]: Starting KDE Plasma Workspace...
[...]
okt 28 19:23:17 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=dumped, status=7/BUS
okt 28 19:23:17 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'timeout'.
okt 28 19:23:17 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 28 19:23:17 Arch systemd[893]: plasma-plasmashell.service: Consumed 13.078s CPU time.
okt 28 19:23:17 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 4.
okt 28 19:23:17 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 28 19:23:17 Arch systemd[893]: plasma-plasmashell.service: Consumed 13.078s CPU time.
okt 28 19:23:17 Arch systemd[893]: Starting KDE Plasma Workspace...
okt 28 19:23:18 Arch systemd[893]: Started KDE Plasma Workspace.
[...]
okt 28 19:24:17 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=dumped, status=7/BUS
okt 28 19:24:17 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'core-dump'.
okt 28 19:24:17 Arch systemd[893]: plasma-plasmashell.service: Consumed 5.320s CPU time.
okt 28 19:24:18 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 5.
okt 28 19:24:18 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 28 19:24:18 Arch systemd[893]: plasma-plasmashell.service: Consumed 5.320s CPU time.
okt 28 19:24:18 Arch systemd[893]: Starting KDE Plasma Workspace...
okt 28 19:24:18 Arch systemd[893]: Started KDE Plasma Workspace.
[...]
okt 29 07:39:44 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=killed, status=14/ALRM
okt 29 07:39:44 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'signal'.
okt 29 07:39:44 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:39:44 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1014.
okt 29 07:39:44 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:39:44 Arch systemd[893]: Starting KDE Plasma Workspace...
[...]
okt 29 07:40:00 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=dumped, status=7/BUS
okt 29 07:40:00 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'core-dump'.
okt 29 07:40:00 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:40:00 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1015.
okt 29 07:40:00 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:40:00 Arch systemd[893]: Starting KDE Plasma Workspace...
[...]
okt 29 07:40:38 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=dumped, status=7/BUS
okt 29 07:40:38 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'core-dump'.
okt 29 07:40:38 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:40:38 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1016.
okt 29 07:40:38 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:40:38 Arch systemd[893]: Starting KDE Plasma Workspace...
[...]
okt 29 07:41:05 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=dumped, status=7/BUS
okt 29 07:41:05 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'core-dump'.
okt 29 07:41:05 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:41:05 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1017.
okt 29 07:41:05 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:41:05 Arch systemd[893]: Starting KDE Plasma Workspace...
[...]
okt 29 07:41:40 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=killed, status=14/ALRM
okt 29 07:41:40 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'signal'.
okt 29 07:41:40 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:41:41 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1018.
okt 29 07:41:41 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:41:41 Arch systemd[893]: Starting KDE Plasma Workspace...
[...]
okt 29 07:42:22 Arch systemd[893]: plasma-plasmashell.service: Main process exited, code=dumped, status=7/BUS
okt 29 07:42:22 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'timeout'.
okt 29 07:42:22 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:42:22 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1019.
okt 29 07:42:22 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:42:22 Arch systemd[893]: Starting KDE Plasma Workspace...
[...]
okt 29 07:43:43 Arch systemd[893]: plasma-plasmashell.service: start operation timed out. Terminating.
okt 29 07:43:43 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'timeout'.
okt 29 07:43:43 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:43:43 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1021.
okt 29 07:43:43 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:43:43 Arch systemd[893]: Starting KDE Plasma Workspace...
okt 29 07:45:04 Arch systemd[893]: plasma-plasmashell.service: start operation timed out. Terminating.
okt 29 07:45:04 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'timeout'.
okt 29 07:45:04 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:45:04 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1023.
okt 29 07:45:04 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:45:04 Arch systemd[893]: Starting KDE Plasma Workspace...
okt 29 07:45:45 Arch systemd[893]: plasma-plasmashell.service: start operation timed out. Terminating.
okt 29 07:45:45 Arch systemd[893]: plasma-plasmashell.service: Failed with result 'timeout'.
okt 29 07:45:45 Arch systemd[893]: Failed to start KDE Plasma Workspace.
okt 29 07:45:45 Arch systemd[893]: plasma-plasmashell.service: Scheduled restart job, restart counter is at 1024.
okt 29 07:45:45 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 29 07:45:45 Arch systemd[893]: Starting KDE Plasma Workspace...
Here I plotted seconds between Systemd's restarts for plasmashell
(note it's in logarithmic scale)
Most of time it was ~4secs but varied a lot and often it didn't crash but timed out at ~40secs. Not sure why I guess some deadlock.
With this MR StartLimit
will be 3 times in 60s which while not ideal in case of timeouts still should eventually stop.
Here's a chart how it would look like for my case:
Basically sometimes it would stop even in a less than minute but other times it could take almost 3h because of timeouts rather than crashes.
There's also similar issue with kwin_x11
but it's more complicated because it was rarer for Systemd to restart it and most of time it timed out while trying to start. Result still same infinite restart loop but I think if plasmashell
wouldn't restart, maybe KWin wouldn't either?
okt 28 23:54:05 Arch systemd[893]: plasma-kwin_x11.service: Main process exited, code=dumped, status=7/BUS
okt 28 23:55:35 Arch systemd[893]: plasma-kwin_x11.service: State 'final-sigterm' timed out. Killing.
okt 28 23:55:35 Arch systemd[893]: plasma-kwin_x11.service: Killing process 28882 (kwin_x11) with signal SIGKILL.
okt 28 23:55:35 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'core-dump'.
okt 28 23:55:35 Arch systemd[893]: plasma-kwin_x11.service: Consumed 2min 5.900s CPU time.
okt 28 23:55:35 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 3.
okt 28 23:55:35 Arch systemd[893]: Stopped KDE Window Manager.
okt 28 23:55:35 Arch systemd[893]: plasma-kwin_x11.service: Consumed 2min 5.900s CPU time.
okt 28 23:55:35 Arch systemd[893]: Starting KDE Window Manager...
okt 28 23:55:36 Arch systemd[893]: Started KDE Window Manager.
[...]
okt 28 23:55:40 Arch systemd[893]: plasma-kwin_x11.service: Main process exited, code=killed, status=14/ALRM
okt 28 23:57:10 Arch systemd[893]: plasma-kwin_x11.service: State 'stop-sigterm' timed out. Killing.
okt 28 23:57:10 Arch systemd[893]: plasma-kwin_x11.service: Killing process 30841 (kwin_x11) with signal SIGKILL.
okt 28 23:57:10 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'signal'.
okt 28 23:57:10 Arch systemd[893]: plasma-kwin_x11.service: Consumed 2min 35.286s CPU time.
okt 28 23:57:10 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 4.
okt 28 23:57:10 Arch systemd[893]: Stopped KDE Window Manager.
okt 28 23:57:10 Arch systemd[893]: plasma-kwin_x11.service: Consumed 2min 35.286s CPU time.
okt 28 23:57:10 Arch systemd[893]: Starting KDE Window Manager...
okt 28 23:57:14 Arch systemd[893]: plasma-kwin_x11.service: Main process exited, code=killed, status=14/ALRM
okt 28 23:58:44 Arch systemd[893]: plasma-kwin_x11.service: State 'stop-sigterm' timed out. Killing.
okt 28 23:58:44 Arch systemd[893]: plasma-kwin_x11.service: Killing process 31882 (kwin_x11) with signal SIGKILL.
okt 28 23:58:44 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'signal'.
okt 28 23:58:44 Arch systemd[893]: Failed to start KDE Window Manager.
okt 28 23:58:44 Arch systemd[893]: plasma-kwin_x11.service: Consumed 1min 36.350s CPU time.
okt 28 23:58:44 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 5.
okt 28 23:58:44 Arch systemd[893]: Stopped KDE Window Manager.
okt 28 23:58:44 Arch systemd[893]: plasma-kwin_x11.service: Consumed 1min 36.350s CPU time.
okt 28 23:58:44 Arch systemd[893]: Starting KDE Window Manager...
okt 28 23:58:52 Arch systemd[893]: plasma-kwin_x11.service: Main process exited, code=dumped, status=7/BUS
okt 28 23:58:57 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'core-dump'.
okt 28 23:58:57 Arch systemd[893]: Failed to start KDE Window Manager.
okt 28 23:58:57 Arch systemd[893]: plasma-kwin_x11.service: Consumed 3.711s CPU time.
okt 28 23:58:57 Arch systemd[893]: Stopped KDE Plasma Workspace.
okt 28 23:58:57 Arch systemd[893]: Starting KDE Plasma Workspace...
okt 28 23:58:57 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 6.
okt 28 23:58:57 Arch systemd[893]: Stopped KDE Window Manager.
okt 28 23:58:57 Arch systemd[893]: plasma-kwin_x11.service: Consumed 3.711s CPU time.
okt 28 23:58:57 Arch systemd[893]: Starting KDE Window Manager...
okt 28 23:59:03 Arch systemd[893]: plasma-kwin_x11.service: Main process exited, code=dumped, status=7/BUS
okt 29 00:00:34 Arch systemd[893]: plasma-kwin_x11.service: State 'stop-sigterm' timed out. Killing.
okt 29 00:00:34 Arch systemd[893]: plasma-kwin_x11.service: Killing process 34288 (kwin_x11) with signal SIGKILL.
okt 29 00:00:34 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'core-dump'.
okt 29 00:00:34 Arch systemd[893]: Failed to start KDE Window Manager.
okt 29 00:00:34 Arch systemd[893]: plasma-kwin_x11.service: Consumed 44.195s CPU time.
okt 29 00:00:34 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 7.
okt 29 00:00:34 Arch systemd[893]: Stopped KDE Window Manager.
okt 29 00:00:34 Arch systemd[893]: plasma-kwin_x11.service: Consumed 44.195s CPU time.
okt 29 00:00:34 Arch systemd[893]: Starting KDE Window Manager...
okt 29 00:00:41 Arch systemd[893]: plasma-kwin_x11.service: Main process exited, code=dumped, status=7/BUS
okt 29 00:02:11 Arch systemd[893]: plasma-kwin_x11.service: State 'stop-sigterm' timed out. Killing.
okt 29 00:02:11 Arch systemd[893]: plasma-kwin_x11.service: Killing process 36035 (kwin_x11) with signal SIGKILL.
okt 29 00:02:11 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'core-dump'.
okt 29 00:02:11 Arch systemd[893]: Failed to start KDE Window Manager.
okt 29 00:02:11 Arch systemd[893]: plasma-kwin_x11.service: Consumed 28.481s CPU time.
okt 29 00:02:11 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 8.
okt 29 00:02:11 Arch systemd[893]: Stopped KDE Window Manager.
okt 29 00:02:11 Arch systemd[893]: plasma-kwin_x11.service: Consumed 28.481s CPU time.
okt 29 00:02:11 Arch systemd[893]: Starting KDE Window Manager...
[...]
okt 29 06:57:06 Arch systemd[893]: plasma-kwin_x11.service: Main process exited, code=dumped, status=7/BUS
okt 29 06:58:36 Arch systemd[893]: plasma-kwin_x11.service: State 'stop-sigterm' timed out. Killing.
okt 29 06:58:36 Arch systemd[893]: plasma-kwin_x11.service: Killing process 94504 (kwin_x11) with signal SIGKILL.
okt 29 06:58:36 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'core-dump'.
okt 29 06:58:36 Arch systemd[893]: Failed to start KDE Window Manager.
okt 29 06:58:36 Arch systemd[893]: plasma-kwin_x11.service: Consumed 4.288s CPU time.
okt 29 06:58:36 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 275.
okt 29 06:58:36 Arch systemd[893]: Stopped KDE Window Manager.
okt 29 06:58:36 Arch systemd[893]: plasma-kwin_x11.service: Consumed 4.288s CPU time.
okt 29 06:58:36 Arch systemd[893]: Starting KDE Window Manager...
[...]
okt 29 07:03:07 Arch systemd[893]: plasma-kwin_x11.service: start operation timed out. Terminating.
okt 29 07:03:07 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'timeout'.
okt 29 07:03:07 Arch systemd[893]: Failed to start KDE Window Manager.
okt 29 07:03:08 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 278.
okt 29 07:03:08 Arch systemd[893]: Stopped KDE Window Manager.
okt 29 07:03:08 Arch systemd[893]: Starting KDE Window Manager...
okt 29 07:04:38 Arch systemd[893]: plasma-kwin_x11.service: start operation timed out. Terminating.
okt 29 07:04:38 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'timeout'.
okt 29 07:04:38 Arch systemd[893]: Failed to start KDE Window Manager.
okt 29 07:04:38 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 279.
okt 29 07:04:38 Arch systemd[893]: Stopped KDE Window Manager.
okt 29 07:04:38 Arch systemd[893]: Starting KDE Window Manager...
okt 29 07:06:08 Arch systemd[893]: plasma-kwin_x11.service: start operation timed out. Terminating.
okt 29 07:06:08 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'timeout'.
okt 29 07:06:08 Arch systemd[893]: Failed to start KDE Window Manager.
okt 29 07:06:09 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 280.
okt 29 07:06:09 Arch systemd[893]: Stopped KDE Window Manager.
okt 29 07:06:09 Arch systemd[893]: Starting KDE Window Manager...
okt 29 07:07:39 Arch systemd[893]: plasma-kwin_x11.service: start operation timed out. Terminating.
okt 29 07:07:39 Arch systemd[893]: plasma-kwin_x11.service: Failed with result 'timeout'.
okt 29 07:07:39 Arch systemd[893]: Failed to start KDE Window Manager.
okt 29 07:07:39 Arch systemd[893]: plasma-kwin_x11.service: Scheduled restart job, restart counter is at 281.