FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Location
    Central California
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hard linked resolv.conf and restorecond

    Hello---

    At least in FC6, /etc/resolv.conf and /etc/sysconfig/networking/profiles/default/resolv.conf are hard linked. This seems to be behind the log message

    restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) Invalid argument

    that a lot of people have noticed---or at least a lot of people among the who-knows-how-many who use SELinux have noticed.

    Replacing /etc/sysconfig/networking/profiles/default/resolv.conf with a symlink to the "real" resolv.conf, /etc/resolv.conf, fixes the restorecond problem.

    As far as I can tell (!!) this doesn't seem to break anything. In particular system-config-network doesn't seem to be upset about it.

    Does anyone know of any problems that this might cause? Does anything other than system-config-network use /etc/sysconfig/networking/profiles/default/resolv.conf?

    Thanks for any advice!

  2. #2
    thedeadbunnymm7 Guest

    Hard linked resolv.conf and restorecond

    I read somewhere else that you should find the hard-linked file, delete it, restorecon /etc/resolv.conf, then re-create the link.

    for example:

    $ ls -i /etc/resolv.conf #get inode
    7405582 /etc/resolv.conf
    $ sudo find /etc -inum 7405582 #find hard link
    Password:
    /etc/sysconfig/networking/profiles/default/resolv.conf
    /etc/resolv.conf
    $ sudo /usr/sbin/lsof|grep resolv.conf #make sure it is not open
    $ sudo rm /etc/sysconfig/networking/profiles/default/resolv.conf #delete
    $ sudo restorecon /etc/resolv.conf
    $ sudo ln /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf #recreate hard link

  3. #3
    Join Date
    Jun 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Hard linked resolv.conf and restorecond

    Quote Originally Posted by thedeadbunnymm7
    I read somewhere else that you should find the hard-linked file, delete it, restorecon /etc/resolv.conf, then re-create the link.

    for example:

    $ ls -i /etc/resolv.conf #get inode
    7405582 /etc/resolv.conf
    $ sudo find /etc -inum 7405582 #find hard link
    Password:
    /etc/sysconfig/networking/profiles/default/resolv.conf
    /etc/resolv.conf
    $ sudo /usr/sbin/lsof|grep resolv.conf #make sure it is not open
    $ sudo rm /etc/sysconfig/networking/profiles/default/resolv.conf #delete
    $ sudo restorecon /etc/resolv.conf
    $ sudo ln /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf #recreate hard link
    thanks for ur help, that was great

Similar Threads

  1. resolv.conf ignores hosts file. host.conf is correct
    By mlee07946 in forum Servers & Networking
    Replies: 2
    Last Post: 17th September 2013, 08:37 PM
  2. resolv.conf
    By Alien999 in forum Servers & Networking
    Replies: 2
    Last Post: 26th March 2009, 08:53 PM
  3. Empty /etc/resolv.conf
    By Sdq in forum Servers & Networking
    Replies: 9
    Last Post: 1st April 2008, 02:25 AM
  4. Dhclient and resolv.conf
    By crossmr in forum Using Fedora
    Replies: 0
    Last Post: 11th October 2006, 03:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •