Hello,
I have the latest firmware of ipFire, 182. I added a QoS category, which forgot to create the corresponding rrd file. I did a touch on the file name, but this was not a good way to fix this. Now I’m trying to delete that file to copy from another one, but ipFire does not let me delete it. I stopped collectd service, still cannot delete any files in /var/log/rrd directory.
How to delete the files in that directory?
You should be able to delete it.
What command did you enter and what error do you see? A copy & paste, or a screenshot (or a camera pic) would be great!
Hello,
If you are logged into a terminal as root then you should be able to delete any file. I suspect there might be unusual permissions on the file you created manually. If the permissions on the file you are trying to delete are not -rw-r–r-- root root (which allow root to read/write) then try chmod 777 on the file to reset the permissions then delete it.
Below is a successful test of create and delete in the folder (v182 with collectd still running):
[root@ipfire1 ~]# touch /var/log/rrd/testfile.txt
[root@ipfire1 ~]# ls -al /var/log/rrd/
total 152
drwxr-xr-x 4 root root 4096 Jan 4 16:00 .
drwxr-xr-x 19 root root 12288 Jan 3 14:14 …
drwxr-xr-x 3 root root 4096 Jan 4 15:56 collectd
-rw-r–r-- 1 root root 28728 Jan 4 16:00 hddshutdown-sda.rrd
-rw-r–r-- 1 root root 28728 Jan 4 16:00 hddtemp-sda.rrd
-rw-r–r-- 1 root root 0 Jan 4 16:00 testfile.txt
drwxr-xr-x 2 root root 4096 Dec 19 19:40 wio
[root@ipfire1 ~]# rm /var/log/rrd/testfile.txt
rm: remove regular empty file ‘/var/log/rrd/testfile.txt’? y
[root@ipfire1 ~]# ls -al /var/log/rrd/
total 152
drwxr-xr-x 4 root root 4096 Jan 4 16:01 .
drwxr-xr-x 19 root root 12288 Jan 3 14:14 …
drwxr-xr-x 3 root root 4096 Jan 4 15:56 collectd
-rw-r–r-- 1 root root 28728 Jan 4 16:00 hddshutdown-sda.rrd
-rw-r–r-- 1 root root 28728 Jan 4 16:00 hddtemp-sda.rrd
drwxr-xr-x 2 root root 4096 Dec 19 19:40 wio
[root@ipfire1 ~]#
EDIT: made into quote
Yes I am as root and none of the files in that directory can be deleted. There is no error messages. I type “rm file”, it does not matter which file, the prompt comes back like it worked, but an ls shows that the file is still there. I even created a dummy file and now I am unable to delete it.
Usually, if root can’t delete a file then the file attributes have been made either append only or immutable.
What results do you get if you run the command
lsattr /var/log/rrd
You should just see the e attribute. If there are either i or a attributes then the files have been made immutable or append-only.
What is making that happen is another question but lets see first what the file attributes of the files you can’t delete are.
[root@ipfire-vertika rrd]# lsattr
--------------e------- ./class_1-1_red0.rrd
--------------e------- ./class_2-210_imq0.rrd
--------------e------- ./class_2-220_imq0.rrd
--------------e------- ./class_2-204_imq0.rrd
--------------e------- ./class_1-101_red0.rrd
--------------e------- ./class_test
--------------e------- ./class_1-105_red0.rrd
--------------e------- ./hddtemp-sda.rrd
--------------e------- ./class_2-200_imq0.rrd
--------------e------- ./class_2-1_imq0.rrd
--------------e------- ./class_1-120_red0.rrd
--------------e------- ./class_1-104_red0.rrd
--------------e------- ./class_1-110_red0.rrd
--------------e------- ./hddshutdown-sda.rrd
--------------e------- ./class_1-103_red0.rrd
--------------e------- ./collectd
--------------e------- ./class_2-203_imq0.rrd
--------------e------- ./class_1-102_red0.rrd
class_1-105_red0.rrd and class_test are the files I would like to delete, but I tried on every files for “fun” and none can be deleted.
So far those three services I tried to stop to no avail : collectd, vnstat and sysklogd.
Ok, I found the culprit, a bad french habit of mine… Instead of pressing “y” to accept the deletion, I was pressing “o” (for oui, yes in french), and of course, the file would not get deleted…
Oh well. At least you have solved the problem and can concentrate on the qos configuration again.