3

I'm running on a quite small server (2GB RAM) where the /var/run mount is 950MB and a quite long uptime (~600 days).

I realized that /var/run is full now:

Filesystem      Size  Used Avail Use% Mounted on
/dev/root        20G  9.9G  8.3G  55% /
devtmpfs        985M     0  985M   0% /dev
tmpfs           985M     0  985M   0% /dev/shm
tmpfs           985M  985M     0 100% /run

And investigating more with ncdu I realized that basically 95% of the occupied space is from systemd sessions.

Can I clean up without requiring a reboot? How did this happen? Is there something misconfigured somewhere?

I'm on Centos 7.4

4
  • 1
    Using loginctl I realized I had several sessions that were not cleared up after logout... Interesting.
    – rdbisme
    Apr 29, 2018 at 14:15
  • 3
    600 days uptime and CentOS 7.4? That means you forgot to reboot, at least several times. You should do that as soon as possible. Apr 29, 2018 at 14:24
  • 2
    @MichaelHampton thanks for your comment. I rebooted, that clearly cleant up all the sessions. I will work on setting up a reboot schedule and check why it was not doing it.
    – rdbisme
    Apr 29, 2018 at 14:30
  • 1
    It seems by the way to be a bug: bugs.centos.org/view.php?id=14278
    – rdbisme
    Apr 30, 2018 at 2:09

1 Answer 1

2

hope this help:

this command may be kill the processes under the session scope, so be careful to use this command

systemctl | grep "abandoned" | grep -e "-[[:digit:]]" | sed "s/.scope.*/.scope/" | xargs -r systemctl stop

ref: https://github.com/systemd/systemd/issues/1961#issuecomment-309335320

1
  • That didn't work for me, but this did: systemctl | grep "abandoned" | cut -f3 -d ' ' | xargs systemtctl stop
    – zie
    Jul 21, 2023 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .