[SOLVED] Announcing Change In Manually Configuring /etc/resolv.conf

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Post Reply
des000
Level 1
Level 1
Posts: 13
Joined: Mon Mar 06, 2023 5:53 pm

[SOLVED] Announcing Change In Manually Configuring /etc/resolv.conf

Post by des000 »

I think my issue is a bug, but there's way too many projects on linuxmint github. I guess it's a github thing that these are hard to sort through. I don't know which project it applies to. I checked, and 21.3 is based off of the same ubuntu. So it should theoretically be NOT there issue. This is affecting the cinnamon edition, non-edge iso.

Basically, this code used to work:

Code: Select all

#! /bin/bash


echo Fix resolv.conf...
sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved
sudo systemctl status systemd-resolved
sleep 11
echo

echo Copy configuration files...
sudo rm -f /etc/resolv.conf
sudo cp -f /usr/bin/stub-resolv.conf /etc/resolv.conf
It worked, since at least mint 21 cinnamon non-edge iso. Or if anything, 21.1. However, now you need this code:

fix-resolv_conf2.sh

Code: Select all

#! /bin/bash


echo Fix resolv.conf...
sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved
sudo systemctl status systemd-resolved
sleep 11
echo

echo Copy configuration files...
sudo cp -f /usr/bin/stub-resolv.conf /var/run/systemd/resolve


echo Rebooting in 1 minute...
read -s -n 1 -p "Please run, 'sudo fix-resolv_conf3.sh', after reboot...'"
echo
shutdown -r +1 "Rebooting for fix-resolv_conf."
echo
fix-resolv_conf3.sh

Code: Select all

#! /bin/bash


echo Copy configuration files...
sudo rm -f /etc/resolv.conf
sudo cp -f /usr/bin/stub-resolv.conf /etc/resolv.conf

sudo chown root /etc/resolv.conf
sudo chgrp root /etc/resolv.conf
sudo chmod 777 /etc/resolv.conf
This issue might only affect me. I'd suggest changing it back, whatever has changed, unless it's a wayland issue. However, now that it's been introduced, you would need a filesystem flag that can set which behavior it has. I'd not do a patch, if I were you, but save fixing it for the next version. Otherwise you could have a non-bootable system suddenly. This affects upgrading to a new version, in my case. I will probably have to manually reinstall each machine in my network, rather than being able to upgrade. But in the case where I can't find where to put a bug report, at least I noted it here for others to see. I'll keep this open for a bit to facilitate discussion, even if you are just telling me where to file a bug report, which project. Thanks!
Last edited by des000 on Sun Feb 11, 2024 5:19 am, edited 1 time in total.
User avatar
SMG
Level 25
Level 25
Posts: 32007
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Announcing Change In Manually Configuring /etc/resolv.conf

Post by SMG »

des000 wrote: Sun Jan 28, 2024 11:31 pm I think my issue is a bug, but there's way too many projects on linuxmint github. I guess it's a github thing that these are hard to sort through. I don't know which project it applies to. I checked, and 21.3 is based off of the same ubuntu. So it should theoretically be NOT there issue. This is affecting the cinnamon edition, non-edge iso.
What exactly is wrong with the ISO?

The base Ubuntu version receives bug fix updates. Thus newer ISOs may have newer files on them. Have you checked to see if that is the case?

From where did you obtain the script?
Image
A woman typing on a laptop with LM20.3 Cinnamon.
t42
Level 11
Level 11
Posts: 3747
Joined: Mon Jan 20, 2014 6:48 pm

Re: Announcing Change In Manually Configuring /etc/resolv.conf

Post by t42 »

SMG wrote: Fri Feb 02, 2024 8:33 pm From where did you obtain the script?
...You can grasp it in full here from the author: https://www.linuxquestions.org/question ... ost6449625
Better link to the same post https://www.linuxquestions.org/question ... ost6449322
-=t42=-
des000
Level 1
Level 1
Posts: 13
Joined: Mon Mar 06, 2023 5:53 pm

Re: Announcing Change In Manually Configuring /etc/resolv.conf

Post by des000 »

You just linked to me. I am also des_a. I origionally got the code while learning about how to set up and connect a samba server to an active directory domain. My research provided the commands and the fact that that's how you do it.

However, there is a bug in it I found now. Hopefully now I've squashed all the bugs. Basically, I need to still disable and renable the services. Nothing changes or should change that I'm aware of except that you still enable and disable services, but before the copy of resolv.conf.

Why is this the case? It appears that now, when you remove the link to the file, and initially disable the service, the directory and stuff in it goes too, but only on this version of linux mint. Weird, but true. I'm glad my posts are helping people. I think.
des000
Level 1
Level 1
Posts: 13
Joined: Mon Mar 06, 2023 5:53 pm

Re: Announcing Change In Manually Configuring /etc/resolv.conf

Post by des000 »

The whole thing linked to, was unuique, but not those few lines, which help it work. However, I made it changed to work on the new version with no additional help.
Post Reply

Return to “Scripts & Bash”