Announcement

Collapse
No announcement yet.

Problem with the chattr command

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem with the chattr command

    Hi.

    When I run the sudo chattr + i /etc/resolv.conf command I get the following message:

    Chattr: The operation is not supported while the flags were being read in /etc/resolv.conf

    Why do not you let me run this command?

    Thank you.

    #2
    What version of Kubuntu?
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Originally posted by jony127 View Post
      When I run the sudo chattr + i /etc/resolv.conf command I get the following message:
      Chattr: The operation is not supported while the flags were being read in /etc/resolv.conf
      In newer versions of kubuntu, /etc/resolv.conf is a symbolic link to /run/resolvconf/resolv.conf (because the resolvconf program is in charge of handling /etc/resolv.conf).

      And the 'chattr' command doesn't work on symbolic links (instead you should use chattr on the target file if you wish to change it's properties).

      I assume you have a reason why you wish to make it immutable?

      Comment


        #4
        Yeah, these days to modify resolv.conf manually and keep the edits, go to /etc/resolvconf/resolv.conf.d/ and edit base, head, and tail there.

        Please Read Me

        Comment


          #5
          Okay thanks, as soon as I can prove it.

          I'm doing some testing with dnscrypt and that's why I have to protect that file.

          Comment


            #6
            making a:
            Sudo chattr + i /run/resolvconf/resolv.conf
            Chattr: ioctl function not suitable for device while reading flags in /run/resolvconf/resolv.conf

            I get the same result.

            The base and head files that oshunluvr comments on /etc/resolvconf/resolv.conf.d/ are empty.

            Comment


              #7
              Originally posted by jony127 View Post
              making a:
              Sudo chattr + i /run/resolvconf/resolv.conf
              Chattr: ioctl function not suitable for device while reading flags in /run/resolvconf/resolv.conf

              I get the same result.
              Ah sorry, /run is on tmpfs which (as you found out) also does not support extended attributes.

              Originally posted by jony127 View Post
              The base and head files that oshunluvr comments on /etc/resolvconf/resolv.conf.d/ are empty.
              There are no settings there by default, but if you put settings there, they'll be included in the dynamic resolv.conf.

              For example you could append:
              nameserver ip.address.of.primarydns
              nameserver ip.address.of.secondarydns
              (replace "ip.address.of.XXXdns" entries with the actual ip addresses)

              to /etc/resolvconf/resolv.conf.d/head and these will be included in resolv.conf upon reconnection

              Comment


                #8
                Originally posted by jony127 View Post
                The base and head files that oshunluvr comments on /etc/resolvconf/resolv.conf.d/ are empty.
                Yes they are. You have to edit them. It seemed to me like what you were really after was control over resolv.conf.

                stuart@office:~$ cat /etc/resolv.conf
                # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
                # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
                domain smith.lan
                search smith.lan
                nameserver 192.168.1.1
                stuart@office:~$ cat /etc/resolvconf/resolv.conf.d/head
                # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
                # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
                stuart@office:~$ cat /etc/resolvconf/resolv.conf.d/base
                stuart@office:~$ cat /etc/resolvconf/resolv.conf.d/tail
                domain smith.lan
                search smith.lan
                nameserver 192.168.1.1
                stuart@office:~$

                Please Read Me

                Comment

                Working...
                X