Giter Club home page Giter Club logo

Comments (3)

traylenator avatar traylenator commented on June 23, 2024

Agree it would be nice to get this or someway of safely exiting systemd-resolved once it is deployed

Background is that if you stop

systemd  stop systemd-resolved

Then both of the possible targets of /etc/resolv.conf are left behind i.e

  • /run/systemd/resolve/stub-resolv.conf
  • /run/systemd/resolve/resolv.conf

so setting use_stuf_file => false at the same time to restore symlink to /run/systemd/resolve/resolv.conf
may seem like a good idea until you reboot and /run/systemd/resolve is not there.

In a non puppet world it would be

rm -f /etc/resolv.conf
systemctl restart NetworkManager

but that is very OS dependent of course.

How about something like

exec{'install_working_resolve_conf':
     command  => `cp /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf`
     onlyif         => `resolv.conf  is a symlink one of  /run/systemd/resolve/stub-resolv.conf or  /run/systemd/resolve/resolv.conf`
}

all a bit fiddly.

from puppet-systemd.

traylenator avatar traylenator commented on June 23, 2024

On the very fine point I agree when the service is stopped /etc/resolv.conf should not be managed as that is only going to end badly.

from puppet-systemd.

ekohl avatar ekohl commented on June 23, 2024

It feels to me like we should document that resolv.conf gets left behind and it's up to the user of this module to find some other content. As @traylenator correctly states: the replacement is not always the same. Some may end up with a static resolv.conf file, others may use NetworkManagers and there are probably a few more options out there. Trying to solve it here will just end poorly.

from puppet-systemd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.