Duplicate domlogs
We've been using cPanel for many years, and I thought that the two copies of the domlogs (/var/log/apache2/domlogs/example.com and /var/log/apache2/domlogs/username/example.com) were hard links and were actually the same file. However, on a newer server that was set up a few months ago, these files now have different inodes and even different file sizes. Are they no longer supposed to be hard links? Or if they are, is it possible to repair this somehow? We are using piped logs and the NGINX reverse proxy, if that has any relevance to the discussion.
-
Hey there! On my personal server, which is AlmaLinux 8 with cPanel 124, I still see them as hard links as they share an inode.
[root@host /]# stat /var/log/apache2/domlogs/domain.com | grep Inode
Device: 800h/2048d Inode: 269270 Links: 2
[root@host /]# stat /var/log/apache2/domlogs/username/domain.com | grep Inode
Device: 800h/2048d Inode: 269270 Links: 2Were you able to run the "stat" command on each file to check and confirm that they are sharing an inode?
0 -
Thank you for your reply. One of the Apache logs is linked with NGINX, but the other one is a separate inode:
# stat /var/log/apache2/domlogs/example.com | grep Inode
Device: 804h/2052d Inode: 787123 Links: 1
# stat /var/log/apache2/domlogs/username/example.com | grep Inode
Device: 804h/2052d Inode: 15519231 Links: 2
# stat /var/log/nginx/domains/example.com | grep Inode
Device: 804h/2052d Inode: 15519231 Links: 2Is there a way to fix this so they all point to the same place? Should we just delete them and allow them to be recreated?
0 -
I never recommend deleting anything, but you could rename the outlier to example.com.bak and then the system would recreate it. Once you're sure you no longer need it, you can come back and delete it.
0
Please sign in to leave a comment.
Comments
3 comments