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.

SOLVED The system failed to lock the file

Discussion in 'E-mail Discussions' started by WorkinOnIt, Feb 20, 2017.

  1. WorkinOnIt

    WorkinOnIt Well-Known Member

    Joined:
    Aug 3, 2016
    Messages:
    94
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi

    Can someone please assist with this issue?

    I terminated an account that was no longer in use and received this error message in WHM:

    API failure: The system failed to lock the file “/etc/mailips” because of an error: Permission denied

    Logged in as root
    CLOUDLINUX 6.8 x86_64 xenpv – ssd
    WHM 60.0 (build 36)
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Do you have this option set to on in WHM > Exim Configuration Manager

    "Reference /etc/mailips for outgoing SMTP connections"

    Also what is the output of:

    Code:
    # ls -l /etc/mailips
     
  3. WorkinOnIt

    WorkinOnIt Well-Known Member

    Joined:
    Aug 3, 2016
    Messages:
    94
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi thanks for your help;

    "Reference /etc/mailips for outgoing SMTP connections": Off (default)


    root@[~]# ls -l /etc/mailips
    -rw-r----- 1 root mail 19 Nov 9 2015 /etc/mailips

    The server is currently set to send mails from a specific IP address as we had spam issues with a previous IP.

    Send mail from account’s dedicated IP address: off (default)
     
    #3 WorkinOnIt, Feb 20, 2017
    Last edited: Feb 20, 2017
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Hmm what about:

    Code:
    # lsattr /etc/mailips
     
  5. WorkinOnIt

    WorkinOnIt Well-Known Member

    Joined:
    Aug 3, 2016
    Messages:
    94
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Is this what you mean?

    Code:
    user@[~]# sudo lsattr /etc/mailips
    
    ----ia--------- /etc/mailips
    
     
  6. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    That's why, you have it chattr set to +i

    If you run

    Code:
    # chattr -i /etc/mailips
    this will fix it.

    Someone would have purposely set it to +i though, this stops the file from being modified/deleted so you may want to check with whomever else has root access to your server to see why they set that but if you have

    "Reference /etc/mailips for outgoing SMTP connections": Off (default)

    then /etc/mailips is doing nothing for you other than causing that error to be thrown.
     
    cPanelMichael likes this.
  7. WorkinOnIt

    WorkinOnIt Well-Known Member

    Joined:
    Aug 3, 2016
    Messages:
    94
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    OK - thank you for your kind assistance.

    is now:

    user@[~]# sudo lsattr /etc/mailips

    ----a--------- /etc/mailips


    The old server admin has long since gone. I will keep an eye on the logs.
    I appreciate your help :-=)
     
  8. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Perfect :)

    Feel free to create and terminate an account to test, but all should be good now.
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  10. WorkinOnIt

    WorkinOnIt Well-Known Member

    Joined:
    Aug 3, 2016
    Messages:
    94
    Likes Received:
    5
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Well - it seems the issue has not gone away - I am now getting this message when I upgraded an account:


     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You may have a third-party plugin or script installed that's automatically changing the attributes on that file. Check to see if the immutable attribute was added back to that file:

    Code:
    stat /etc/mailips
    lsattr /etc/mailips
    Thank you.
     
Loading...

Share This Page