selectively restarting named automatically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Have I done anything fundamentally wrong with this script (below)? 
It's working as expected.  I can't think of anything that's going to
blow up because of it, maybe someone else can.  I don't think it needs
to be any more complicated than it is.  Perhaps a small wait delay?

I've been using my mobile phone for my desktop computer's internet
access, lately, and pop.mail.yahoo.com.au DNS records were expiring
when off-line.  Then, when going back on-line, fetchmail would fail to
get mail from yahoo, needing named to be manually reloaded to refresh
its DNS records.

Surprisingly, named wasn't trying to reload the records upon demand. 
And this has only been a recent problem, so I'm guessing Yahoo may have
changed TTL lengths in the last few weeks.  Fetchmail isn't running
constantly, just run once when I want to check for mail.

I wanted to restart named when a new network connection comes up, but
not do anything when it went down (so the LAN still carries on working
as expected).  I don't think it matters if named is restarted when
*any* network connection comes up, not just my internet gateway.


#!/bin/sh

## /etc/NeworkManager/dispatcher.d/20-named
## added by me 19 Jan 2025
##
## Idea copied from 20-squid, to restart a service if a network goes up, if
## that service was already running.  But do nothing if that service was
## stopped.


case "$2" in
        up)
                if [ -f /var/run/named/named.pid ]; then
                        /bin/systemctl reload named.service || :
                fi
                ;;
esac
 
-- 
 
uname -rsvp
Linux 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 

-- 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux