The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

duplicate apache logs

Discussion in 'EasyApache' started by forlinuxsupport, May 10, 2007.

  1. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hi

    I have just noticed on my servers there seem to be duplicate apache logs.

    E.g.
    cd /usr/local/domlogs/
    drwxr-x--- 2 root camp 4096 May 3 05:56 camp/
    -rw-r----- 2 root camp 632781 May 10 12:13 campxxxx.co.uk
    -rw-r--r-- 1 root root 102311 May 10 12:13 campxxxx.co.uk-bytes_log
    -rw-r--r-- 1 root root 6 May 10 06:52 campxxxx.co.uk-bytes_log.offset

    Whats the directory "camp/" doing there ?
    Its dated 3 May on all the servers - what happened on the 3 may ?

    Looking in that directory I see :
    -rw-r----- 2 root camp 632876 May 10 12:14 campxxxx.co.uk

    If you see file campxxxx.co.uk is the same in the domlogs dir and in the camp/ dir.
    I also see they share the same INODE number (hardlink ??).

    Why is there this sudden duplication of logs ?

    Regards
    Andy
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I don't know why they're doing this in v11, but since they share the same inode they're not duplicating anything as they're both the same file and using the same physical space.
     
  3. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    It is weird...

    I was hoping cpanel would tell me why they have done it :)
     
  4. yapluka

    yapluka Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    cPanel Access Level:
    Root Administrator
    They probably did this so cpanel users get access to their domlog. If you log into ftp, you'll notice a new /logs/ folder in the ftp root, which is a link to /usr/local/apache/domlogs/username/ :)
     
  5. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    excellent - that sounds quite a reasonable answer.

    Well done :)
     
  6. yapluka

    yapluka Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Well, they do duplicate the files : the /usr/ partition on a customer's server ran out of space this morning because of this...
     
  7. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    They are hard links.. You may have deleted one but didn't remove the other one so the linkage was broken.

    We will release an update to restore the linkage automatically before RELEASE if someone should manually break it.
     
  8. yapluka

    yapluka Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Well, they were actually using the same inode. However, deleting /domlogs/username/domain.com did free up the space :confused:
     
  9. yapluka

    yapluka Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    cPanel Access Level:
    Root Administrator
    I deleted some /domlogs/username/files then recreated the hard linking and this seems to fix the space issue.
    A script for rebuilding the hard linking would be greatly appreciated :)
     
  10. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    The latest current (released about 20 min ago) will unlink and relink them if the inode doesn't match.
     
  11. yapluka

    yapluka Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    301
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    France
    cPanel Access Level:
    Root Administrator
    Thank you so much, Nick ! :)
     
Loading...

Share This Page