1 1
Rafael C

/tmp gets eventually full. How to purge it?

Recommended Posts

Hello everyone.

  

 We have checked the forum extensively but have not found a good answer to our problem.

 

Our system is based on a Orange Pi Zero Plus (512 MB), and it is running nicely.

However, after some time, (10 - 15 days from the last boot) or /tmp directory gets full and most of the system is not operational. Only solution we have found for the moment is rebooting the system.

 

This is the output of df -h in one of our systems which only shows 7% usage. This usage figure increases day by day.

 

Filesystem      Size  Used Avail Use% Mounted on

udev            174M     0  174M   0% /dev

tmpfs            49M  5.4M   43M  12% /run

/dev/mmcblk0p1  2.0G  1.6G  333M  83% /

tmpfs           241M   12K  241M   1% /dev/shm

tmpfs           5.0M     0  5.0M   0% /run/lock

tmpfs           241M     0  241M   0% /sys/fs/cgroup

tmpfs           241M   16M  226M   7% /tmp

tmpfs            10M     0   10M   0% /home/iawot/ficheros_ftp

/dev/zram0       49M   27M   19M  60% /var/log

tmpfs            49M     0   49M   0% /run/user/0

 

The contents of the /tmp directory is:

ls -la /tmp

total 8

drwxrwxrwt  8 root root  180 Jul 18 13:28 .

drwxrwxrwt 22 root root 4096 Jan 17 02:04 ..

-rw-------  1 root root   31 Jul 16 11:08 armbian-hardware-optimization.hhlnrd

drwxrwxrwt  2 root root   40 Jul 16 11:08 .font-unix

drwxrwxrwt  2 root root   40 Jul 16 11:08 .ICE-unix

drwx------  3 root root   60 Jul 16 11:08 systemd-private-98788f87752540c4a5cf054115c5741a-haveged.service-6uUDLd

drwxrwxrwt  2 root root   40 Jul 16 11:08 .Test-unix

drwxrwxrwt  2 root root   40 Jul 16 11:08 .X11-unix

drwxrwxrwt  2 root root   40 Jul 16 11:08 .XIM-unix

 

and inside systemd-private-98788f87752540c4a5cf054115c5741a-haveged.service-6uUDLd there is only an empty directory named tmp.

 

So my question is:

 

What is the proper way of clearing de /tmp directory?

We have tried to simply erase everything inside it with

rm /tmp/* -r

but it seems that something (invisible) is still there since df -h still reports the /tmp is using 241 MB

 

Thanks!

Share this post


Link to post
Share on other sites
48 minutes ago, Rafael C said:

and inside systemd-private-98788f87752540c4a5cf054115c5741a-haveged.service-6uUDLd there is only an empty directory named tmp.

 

So my question is:

 

What is the proper way of clearing de /tmp directory?

We have tried to simply erase everything inside it with

rm /tmp/* -r

but it seems that something (invisible) is still there since df -h still reports the /tmp is using 241 MB

 

The file handles are probably still being held open by the service.  try systemctl restart havegd and see if that releases them

 

also whats output of systemctl status systemd-tmpfiles-setup.service 

Share this post


Link to post
Share on other sites

Thanks for the response.

 

I will need to wait a few days until tmp is more filled and will try systemctl restart havegd

 

 This is the outpout of  systemctl status systemd-tmpfiles-setup.service :

 

● systemd-tmpfiles-setup.service - Create Volatile Files and Directories

   Loaded: loaded (/lib/systemd/system/systemd-tmpfiles-setup.service; static; vendor preset: enabled)

   Active: active (exited) since Thu 2019-07-18 15:32:17 CEST; 2h 13min ago

     Docs: man:tmpfiles.d(5)

           man:systemd-tmpfiles(8)

  Process: 335 ExecStart=/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=0/SUCCESS)

 Main PID: 335 (code=exited, status=0/SUCCESS)

    Tasks: 0 (limit: 4915)

   CGroup: /system.slice/systemd-tmpfiles-setup.service

 

Jul 18 15:32:17 CESINEL_PACOM_Z0003 systemd[1]: Starting Create Volatile Files and Directories...

Jul 18 15:32:17 CESINEL_PACOM_Z0003 systemd[1]: Started Create Volatile Files and Directories.

Share this post


Link to post
Share on other sites
On 7/18/2019 at 5:06 AM, Rafael C said:

We have checked the forum extensively but have not found a good answer to our problem.

 

logrotate is one item to look at to close out logs and age them out.

 

FWIW -  There's armbian specific services in systemd that you might want to actually disable - armbian-ramlog for example, as when it runs out of space it gets ugly.

systemctl list-unit-files | grep armbian
armbian-firstrun-config.service            enabled        
armbian-firstrun.service                   disabled       
armbian-hardware-monitor.service           enabled        
armbian-hardware-optimize.service          enabled       
armbian-ramlog.service                     disabled       
armbian-resize-filesystem.service          disabled       
armbian-zram-config.service                disabled 

Anyways - the ram logging and ZRAM stuff tend to be problematic for some that come into Armbian from other platforms...

 

The two services I would disable from SystemD are below:

armbian-ramlog.service
armbian-zram-config.service

 

I know folks might be offended here - but disabling this results in expected behavior.

 

 

Share this post


Link to post
Share on other sites
On 7/18/2019 at 5:06 AM, Rafael C said:

Our system is based on a Orange Pi Zero Plus (512 MB), and it is running nicely.

However, after some time, (10 - 15 days from the last boot) or /tmp directory gets full and most of the system is not operational. Only solution we have found for the moment is rebooting the system.

 

This is the output of df -h in one of our systems which only shows 7% usage. This usage figure increases day by day.

 

That's odd in any case - current Armbian tweaked a little bit...  two weeks uptime one NanoPI Neo2

 

I'm mainly using it as a NTP time source (with GPSD and Chrony), as well as a ssh jump box 

 

$ uname -a
Linux nano2 4.19.63-sunxi64 #5.92 SMP Fri Aug 2 00:18:27 CEST 2019 aarch64 aarch64 aarch64 GNU/Linux

$ uptime
 16:15:54 up 14 days,  6:45,  1 user,  load average: 0.00, 0.05, 0.06

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            428M     0  428M   0% /dev
tmpfs           100M   14M   86M  14% /run
/dev/mmcblk0p1   15G  6.4G  8.0G  45% /
tmpfs           497M     0  497M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           497M     0  497M   0% /sys/fs/cgroup
tmpfs           497M  8.0K  497M   1% /tmp
tmpfs           100M     0  100M   0% /run/user/1000

$ ls -la /tmp
total 12
drwxrwxrwt 11 root root  280 Sep 28 16:11 .
drwxr-xr-x 22 root root 4096 Oct 26  2018 ..
-rw-------  1 root root   31 Sep 14 09:30 armbian-hardware-optimization.r0SxiO
drwxrwxrwt  2 root root   40 Sep 14 09:30 .font-unix
drwxrwxrwt  2 root root   40 Sep 14 09:30 .ICE-unix
-rw-rw-rw-  1 root root  387 Sep 23 21:03 nanohat-oled.log
-rw-rw-rw-  1 root root    0 Sep 14 09:30 nanoled-python.log
drwx------  3 root root   60 Sep 14 09:32 systemd-private-43a0a10b262541e4bbf35bf5370fcd35-chrony.service-5M7ZYn
drwx------  3 root root   60 Sep 14 09:30 systemd-private-43a0a10b262541e4bbf35bf5370fcd35-haveged.service-xAs0dT
drwx------  3 root root   60 Sep 14 09:30 systemd-private-43a0a10b262541e4bbf35bf5370fcd35-ModemManager.service-GdBGMf
drwx------  3 root root   60 Sep 14 09:30 systemd-private-43a0a10b262541e4bbf35bf5370fcd35-systemd-resolved.service-H04TSn
drwxrwxrwt  2 root root   40 Sep 14 09:30 .Test-unix
drwxrwxrwt  2 root root   40 Sep 14 09:30 .X11-unix
drwxrwxrwt  2 root root   40 Sep 14 09:30 .XIM-unix

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1