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

  • 1
    Using loginctl I realized I had several sessions that were not cleared up after logout... Interesting.
    – rdbisme
    Apr 29 '18 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 '18 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 '18 at 14:30
  • 1
    It seems by the way to be a bug: bugs.centos.org/view.php?id=14278
    – rdbisme
    Apr 30 '18 at 2:09

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.