Linux Fedora virtual hosting Removing Dir?

I am running Fedora 36 in my Linodes account.

/proc is the problem.

Now I want to delete the bulk of the process logging files that have built up since this was installed.
Each process in this virtual host volume adds another entry to this /proc directory and they are now massive.

I see I have process directories ranging from 1 to 6-digit values! But no combination of rm this and that with all kinds of flags works because the permissions refuse the remove execute.

Even when I ask for all deleted recursively through all sub-directories and files the permissions tell me “denied”

i log in with user root privileges. Used sudo just in case. Completely ran chmod through every directory and sub-directory to give write & execute permissions.
Still get same permissions denied.

Has someone a reliable clean-up tool to override system root permissions for removing excess baggage in the directories of a linux installation in a virtual host?

I have spent hours trying top-to-bottom configurations to let me have permission as a root user to delete files and directories.

Thank you, thank you to anyone who does this task routinely!

@NewMedia

1 Like

You can’t delete files in /proc as they aren’t actually files, it’s a virtual filesystem, therefore, you can’t delete anything in this directory. The /proc folder doesn’t take up any space on your system. Any files still here are still loaded in memory.

1 Like

Thank you for that reassurance, guys!

I knew they were virtual, only existing while my instance was booted up, and I suppose used for monitoring tools, but it was when I wanted to download files to my localhost that I saw how much time was being spent on drilling into each of them that I got concerned.

I will be more selective about sftp sessions from now on!

Yet, I have one more question. These files are not completely “virtual” in my account, obviously. The information about each process that generates these files will be stored accumulatively, expanding with each day the disk space I rent monthly.

Though people will tell me that disk space is inconsequential these days.

When I ssh to see my root each “virtual” /proc is using up cpu resources and taking more & more time to load up the totality of files when the system boots. In fact, boot up time must increase each day as more /proc entries are stored, read, written to my running instance.

There ought to be some command to clear out what is increasingly “junk” baggage before the /proc source is tapped to spit out files that date back to the day I started this new volume.

But I’m glad to know this is out of my hands for now.

Maybe you’re worrying about the wrong directory

Did you perhaps meant /var/log where logs are stored?

Otherwise, rebooting the VPS should clean /proc if you insist

I’ve done multiple reboots of my fedora instance and those processes just get added to /proc – the following list a few minutes ago with sftp login after another reboot – this list scrolls & scrolls screen after screen down. ? marks because I haven’t directed it to load the inner directories. Every session, every hour of use adds more and more.

Because of these each day it takes longer and longer to restart my website test instance.

I have hundreds of these directories loading in /proc when the system boots – and here I open just one – 10 – and just open up one sub-directory under 10 –
hundreds and hundreds of now useless directory entries in /proc is adding to the load process for my virtual server which is often rebooted for maintenance reasons overnight.

The folder 10 in this screenshot only shows 48 files and 4 directories, which definitely isn’t abnormal and is expected. If I were to guess, your website restarts have nothing to do with how many folders are here. You should take a look at your system resources when restarting the website.

The number of the folder in /proc/ is the PID, so you can check what the process is by running ps -p [pid] (or the equivalent for Fedora).

P.S: You shouldn’t need to restart your server every night. The uptime on some of my machines is 2+ years, though those have KernelCare.

And Linodes gives me almost daily notices that my machine has been REbooted by the “Lassie Watchdog Service”.

But I will learn more about them… :eyes:
Thank you everyone for chipping in to educate me!

I suppose you could temporarily disable Lassie and whenever the machine hangs you enter into the LISH console (on Linode’s control panel) to see what the heck is going on :grimacing:

Might be a kernel panic