• [gentoo-user] Getting tar to keep going

    From Peter Humphrey@21:1/5 to All on Tue Nov 5 16:40:01 2024
    Greetings.

    The Network Manager man page says to 'chattr +i /etc/resolv.conf', so I did, and that one move enabled the wireless network to work as it should.

    Now I find it causes a problem when restoring a backup: tar fails in restoring that file, of course, and reports an error. The number of files restored is less
    than expected, so I assume that tar stops restoring and just continues to spin through the rest of the tarball without doing anything. Is that right?

    I've tried setting the options --ignore-command-error and --ignore-failed- read, separately, but with no effect.

    Is there a way to tell tar to 'keep going', as with portage? If not, I'm going to have to mess about with 'chattr [+/-]i' with all the opportunities that has for error. I don't need any more of those, thank-you-very-much!

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Humphrey@21:1/5 to tar needs an --ignore-failed- on Tue Nov 5 18:00:02 2024
    On Tuesday 5 November 2024 16:27:57 GMT Grant Taylor wrote:
    On 11/5/24 9:38 AM, Peter Humphrey wrote:
    The Network Manager man page says to 'chattr +i /etc/resolv.conf',
    so I did, and that one move enabled the wireless network to work as
    it should.

    What?!?!?! Network Manager can't be made to keep it's hands off of /etc/resolv.conf so the workaround is to leverage file system features
    to break Network Manager's hands when it tries to touch the file?

    That's a hell of a bad design in my opinion.

    Yes, I thought it might raise a laugh...

    The tar error will be related to the restore / write to disk, not
    reading from ""tape or command error.

    I see what you mean: in my case, tar needs an --ignore-failed-write option.

    You might explore an option to cause tar to exclude /etc/resolv.conf
    from the restore job. I'm not sure what that would look like as I'm
    usually only messing with exclude during backups.

    There is an --exclude option; I can use that.

    You might be able to mess with some even more esoteric (bind) mount
    options, but that will be quite similar to the chattr dance.

    I'd go smack Network Manager with a bigger bat.

    I'll hold your coat... :)

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Taylor@21:1/5 to Peter Humphrey on Tue Nov 5 17:30:01 2024
    On 11/5/24 9:38 AM, Peter Humphrey wrote:
    The Network Manager man page says to 'chattr +i /etc/resolv.conf',
    so I did, and that one move enabled the wireless network to work as
    it should.

    What?!?!?! Network Manager can't be made to keep it's hands off of /etc/resolv.conf so the workaround is to leverage file system features
    to break Network Manager's hands when it tries to touch the file?

    That's a hell of a bad design in my opinion.

    The tar error will be related to the restore / write to disk, not
    reading from ""tape or command error.

    You might explore an option to cause tar to exclude /etc/resolv.conf
    from the restore job. I'm not sure what that would look like as I'm
    usually only messing with exclude during backups.

    You might be able to mess with some even more esoteric (bind) mount
    options, but that will be quite similar to the chattr dance.

    I'd go smack Network Manager with a bigger bat.



    --
    Grant. . . .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli Schwartz@21:1/5 to Grant Taylor on Tue Nov 5 19:30:01 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------bqjardwF28XIjaUvDlLyhDWk
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 11/5/24 11:27 AM, Grant Taylor wrote:
    On 11/5/24 9:38 AM, Peter Humphrey wrote:
    The Network Manager man page says to 'chattr +i /etc/resolv.conf', so
    I did, and that one move enabled the wireless network to work as it
    should.

    What?!?!?!  Network Manager can't be made to keep it's hands off of / etc/resolv.conf so the workaround is to leverage file system features to break Network Manager's hands when it tries to touch the file?

    That's a hell of a bad design in my opinion.


    Yeah, and it's also nonsense as far as I can tell. Here's what the man
    page for Network Manager actually says:

    dns
    Set the DNS processing mode.

    none: NetworkManager will not modify resolv.conf. This implies
    rc-manager unmanaged


    rc-manager
    Set the resolv.conf management mode. This option is about how
    NetworkManager writes to /etc/resolv.conf, if at all.


    If you configure dns=none or make /etc/resolv.conf immutable
    with chattr +i, NetworkManager will ignore this setting and
    always choose unmanaged (below).


    symlink: If /etc/resolv.conf is a regular file or does not
    exist, NetworkManager will write the file directly.

    file: NetworkManager will write /etc/resolv.conf as regular
    file.

    unmanaged: don't touch /etc/resolv.conf.


    --
    Eli Schwartz

    --------------bqjardwF28XIjaUvDlLyhDWk--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCZypjBQUDAAAAAAAKCRCEp9ErcA0vV5mN AQCMMaRQfYF6ytL/7eeu5/8A9lhafwljHoUZXxtAPOZ7RwD/Q3B74uLR7voifjYi6fw3wgAac8Xy QlFAM8eY2i99YgY=
    =ptxY
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?utf-8?Q?Arsen_Arsenovi=C4=87?=@21:1/5 to Grant Taylor on Tue Nov 5 23:30:01 2024
    Grant Taylor <gtaylor@gentoo.tnetconsulting.net> writes:

    On 11/5/24 9:38 AM, Peter Humphrey wrote:
    The Network Manager man page says to 'chattr +i /etc/resolv.conf', so I did, >> and that one move enabled the wireless network to work as it should.

    What?!?!?! Network Manager can't be made to keep it's hands off of /etc/resolv.conf so the workaround is to leverage file system features to break
    Network Manager's hands when it tries to touch the file?

    https://www.networkmanager.dev/docs/api/latest/NetworkManager.conf.html
    under the dns key in the main section:

    none: NetworkManager will not modify resolv.conf. This implies
    rc-manager unmanaged

    FOTM, doing a FTS over all manuals (which is slow because man-pages are
    awful):
    ~$ man -K chattr
    --Man-- next: rm(1) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    --Man-- next: ostree-prepare-root(1) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    --Man-- next: chattr(1) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: systemd-dissect(1) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    --Man-- next: socat1(1) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: btrfs-property(8) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    --Man-- next: utime(2) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: ioctl_iflags(2) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: fallocate(2) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: statx(2) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: utimensat(2) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: mount(2) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: archive_read_disk(3) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    --Man-- next: archive_write_disk(3) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    --Man-- next: ext3(5) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    --Man-- next: tmpfiles.d(5) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: sysupdate.d(5) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: nm-system-settings.conf(5) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    --Man-- next: slapd-relay(5) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: slapo-rwm(5) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: slapd-meta(5) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ] --Man-- next: btrfs(5) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]

    nm-system-settings.conf says:

    If you configure dns=none or make /etc/resolv.conf immutable with
    chattr +i, NetworkManager will ignore this setting and always choose unmanaged (below).

    so, certainly not what was said above..
    --
    Arsen Arsenović

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iIcEARYKAC8WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZyqa6hEcYXJzZW5AZ2Vu dG9vLm9yZwAKCRBSwpQwHqLEk9jTAP9j9VcrvBHklVrokAG0G1Bnx0b/8FQA3bU4 AhQ3+aAG4AD/b4voz8ZF7RtX5SJYymwJpzoEvimkQ/fibRZ2hHIyugU=6KHW
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Taylor@21:1/5 to Grant Taylor on Wed Nov 6 00:50:01 2024
    On 11/5/24 10:27 AM, Grant Taylor wrote:
    What?!?!?!  Network Manager can't be made to keep it's hands off of /etc/resolv.conf so the workaround is to leverage file system features
    to break Network Manager's hands when it tries to touch the file?

    Clarifying, after some replies that I've seen.

    I was surprised by, and doubted, the idea that Network Manager might not
    be able to be configured to leave /etc/resolv.conf alone.

    I assumed that Network Manager can be configured to leave
    /etc/resolv.conf alone.

    As such, I'd think it is better to configure Network Manager to leave /etc/resolv.conf alone and not fall back to something like setting the immutable attribute on the file to prevent it being messed with.



    --
    Grant. . . .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli Schwartz@21:1/5 to Grant Taylor on Wed Nov 6 01:10:01 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------KYEMxapLnM3z5v6qw9NivJ8F
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 11/5/24 6:41 PM, Grant Taylor wrote:
    Clarifying, after some replies that I've seen.

    I was surprised by, and doubted, the idea that Network Manager might not
    be able to be configured to leave /etc/resolv.conf alone.


    Oops, yeah, sorry. My reply was badly worded -- I responded to your post because your post included that shock and skepticism which was a good
    lead-in to my quote of the actual manual.

    I 100% agree with you that it doesn't sound like the way things would
    actually work.

    But my reply was really intended for Peter. I don't quite understand
    what Peter read (when saying "the Network Manager man page says to
    chattr") to overlook the fact that the manpage is fairly clear in the
    only place it talks about chattr, that chattr is not your only option.


    --
    Eli Schwartz

    --------------KYEMxapLnM3z5v6qw9NivJ8F--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCZyqzbQUDAAAAAAAKCRCEp9ErcA0vV1PY AP9VhYUDD95GTpTYA7JUudkpxfs9XogC298jDA8JwhCN3gD+KVfCkDSAUah/M0lijKJ4jShsVKye z2MgCbdG/cKVmA8=
    =2/ta
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Humphrey@21:1/5 to All on Wed Nov 6 03:20:01 2024
    On Wednesday 6 November 2024 00:08:12 GMT Eli Schwartz wrote:

    But my reply was really intended for Peter. I don't quite understand
    what Peter read (when saying "the Network Manager man page says to
    chattr") to overlook the fact that the manpage is fairly clear in the
    only place it talks about chattr, that chattr is not your only option.

    I didn't just make it up. I did actually read it; I was sure it was in the man page, but it seems I was mistaken.

    Back to the drawing-board then, but with a better idea of what to do.

    Thanks all for dragging me back to reality. ;)

    --
    Regards,
    Peter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)