<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=2126&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Problems with NTP and network config after upgrade]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=2126</link>
		<description><![CDATA[The most recent posts in Problems with NTP and network config after upgrade.]]></description>
		<lastBuildDate>Mon, 03 Sep 2018 18:05:13 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Problems with NTP and network config after upgrade]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=11637#p11637</link>
			<description><![CDATA[<p>The reason there is a ntp hook for dhcp is to override the system configuration with the ntp servers advertised through dhcp. You could get rid of it all by removing &#039;ntp-server&#039; from the dhclient.conf request line. I haven&#039;t tested it yet though, so if I don&#039;t correct myself assume what I said to be accurate.</p>]]></description>
			<author><![CDATA[dummy@example.com (xrogaan)]]></author>
			<pubDate>Mon, 03 Sep 2018 18:05:13 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=11637#p11637</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problems with NTP and network config after upgrade]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=9955#p9955</link>
			<description><![CDATA[<div class="quotebox"><cite>msi wrote:</cite><blockquote><div><p>I temporarily replaced the current verison of the file with that from Jessie to see if it would make any difference and it didn&#039;t. So, the root of the problem must be somewhere else.</p></div></blockquote></div><p>Well, maybe not. I&#039;ve found that throwing out <span class="bbc">/etc/dhcp/dhclient-exit-hooks.d/ntp</span> will make both of the error messages mentioned above go away. So, the one on boot is obviously also triggered by it. There will, of course, be no automatic handling of <span class="bbc">ntp</span> restarts on DHCP events if the file is missing.</p><p>I&#039;ve been trying to understand what this script really does and I kind of do. But the <span class="bbc">ntp_servers_setup</span> function is still a mystery to me. Where does it get the value for <span class="bbc">$reason</span>? It&#039;s simply not defined within the script. And neither are <span class="bbc">$new_ntp_servers</span> and <span class="bbc">$old_ntp_servers</span>, which are used in the <span class="bbc">ntp_servers_setup_add</span> function.</p><p>Here&#039;s the entire file:</p><div class="codebox"><pre class="vscroll"><code>NTP_CONF=/etc/ntp.conf
NTP_DHCP_CONF=/run/ntp.conf.dhcp

ntp_server_restart() {
	invoke-rc.d ntp try-restart
}

ntp_servers_setup_remove() {
	if [ ! -e $NTP_DHCP_CONF ]; then
		return
	fi
	rm -f $NTP_DHCP_CONF
	ntp_server_restart
}

ntp_servers_setup_add() {
	if [ -e $NTP_DHCP_CONF ] &amp;&amp; [ &quot;$new_ntp_servers&quot; = &quot;$old_ntp_servers&quot; ]; then
		return
	fi

	if [ -z &quot;$new_ntp_servers&quot; ]; then
		ntp_servers_setup_remove
		return
	fi

	tmp=$(mktemp &quot;$NTP_DHCP_CONF.XXXXXX&quot;) || return
	chmod --reference=$NTP_CONF $tmp
	chown --reference=$NTP_CONF $tmp

	(
	  echo &quot;# This file was copied from $NTP_CONF with the server options changed&quot;
	  echo &quot;# to reflect the information sent by the DHCP server.  Any changes made&quot;
	  echo &quot;# here will be lost at the next DHCP event.  Edit $NTP_CONF instead.&quot;
	  echo
	  echo &quot;# NTP server entries received from DHCP server&quot;
	  for server in $new_ntp_servers; do
		echo &quot;server $server iburst&quot;
	  done
	  echo
	  sed &#039;/^[[:space:]]*\(server\|peer\|pool\)[[:space:]]/d&#039; $NTP_CONF
	) &gt;&gt;$tmp
	
	mv $tmp $NTP_DHCP_CONF

	ntp_server_restart
}

ntp_servers_setup() {
	case $reason in
		BOUND|RENEW|REBIND|REBOOT)
			ntp_servers_setup_add
			;;
		EXPIRE|FAIL|RELEASE|STOP)
			ntp_servers_setup_remove
			;;
	esac
}

ntp_servers_setup</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (msi)]]></author>
			<pubDate>Tue, 12 Jun 2018 17:39:38 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=9955#p9955</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problems with NTP and network config after upgrade]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=9789#p9789</link>
			<description><![CDATA[<p>That script seems to be there to make sure NTP is being restarted automatically when bringing up and down network interfaces that get their IP address through DHCP.</p><p>I&#039;ve dug a little deeper and found that it has been part of the <span class="bbc">ntp</span> package at least since Debian Wheezy. Also, it&#039;s identical in the Wheezy and Jessie packages, but has seen minor changes in Stretch.</p><p>These are:</p><p>1. Line 2 was changed from</p><div class="codebox"><pre><code>NTP_DHCP_CONF=/var/lib/ntp/ntp.conf.dhcp</code></pre></div><p>to</p><div class="codebox"><pre><code>NTP_DHCP_CONF=/run/ntp.conf.dhcp</code></pre></div><p>2. Line 43 was changed from</p><div class="codebox"><pre><code>sed -r -e &#039;/^ *(server|peer).*$/d&#039; $NTP_CONF</code></pre></div><p>to</p><div class="codebox"><pre><code>sed &#039;/^[[:space:]]*\(server\|peer\|pool\)[[:space:]]/d&#039; $NTP_CON</code></pre></div><p>I temporarily replaced the current verison of the file with that from Jessie to see if it would make any difference and it didn&#039;t. So, the root of the problem must be somewhere else.</p>]]></description>
			<author><![CDATA[dummy@example.com (msi)]]></author>
			<pubDate>Wed, 06 Jun 2018 08:42:12 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=9789#p9789</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problems with NTP and network config after upgrade]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=9754#p9754</link>
			<description><![CDATA[<p>I followed Luke to the source, and saw that <span class="bbc">ntp</span> has a script added into <span class="bbc">/etc/dhcp/dhclient-exit-hooks.d/</span> that apparently does some willy-nilly restart attempt upon dhcp events,</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Tue, 05 Jun 2018 05:11:09 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=9754#p9754</guid>
		</item>
		<item>
			<title><![CDATA[Problems with NTP and network config after upgrade]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=9750#p9750</link>
			<description><![CDATA[<p>Since I have upgraded from Jessie to ASCII, I&#039;m getting the following warning about NTP on shutdown, which is apparently somehow connected to network device configuration:</p><div class="codebox"><pre><code>DHCPRELEASE on wlan0 to 192.168.178.1 port 67
invoke-rc.d: -----------------------------------------------------
invoke-rc.d: WARNING: &#039;invoke-rc.d ntp try-restart&#039; called
invoke-rc.d: during shutdown sequence.
invoke-rc.d: enabling safe mode: initscript policy layer disabled
invoke-rc.d: -----------------------------------------------------
done</code></pre></div><p>I hadn&#039;t heard of <span class="bbc">invoke-rc.d</span> before, so I looked it up. The manual page says it&#039;s &quot;a generic interface to execute System V style init script /etc/init.d/name actions&quot; and that &quot;all access to the init scripts by Debian packages&#039; maintainer scripts should be done through invoke-rc.d&quot;.</p><p>I had initially tried to solve the problem by editing <span class="bbc">/etc/init.d/ntp</span>. But that doesn&#039;t seem right, so I restored the original file from backup.</p><p>How can I find out now what is calling <span class="bbc">invoke-rc.d ntp try-restart</span> during shutdown and why?</p><p>As for this issue being connected to the network device settings, I&#039;ve found the following: When I use <span class="bbc">auto wlan0</span> instead of <span class="bbc">allow-hotplug wlan0</span> in <span class="bbc">/etc/network/interfaces</span> (where I do all my network configuration), I&#039;ll get this during boot:</p><div class="codebox"><pre><code>DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPREQUEST of 192.168.178.21 on wlan0 to 255.255.255.255 port 67
DHCPOFFER of 192.168.178.21 from 192.168.178.1
DHCPACK of 192.168.178.21 from 192.168.178.1
invoke-rc.d: could not determine current runlevel
bound to 192.168.178.21 -- renewal in 400249 seconds.</code></pre></div><p>First, these messages are not shown when using the <span class="bbc">allow-hotplug</span> configuration. In that case, all that is shown of the network device configuration during boot is:</p><div class="codebox"><pre><code>Configuring network interfaces...ifup: waiting for lock on /run/network/ifstate.wlan0
ifup: interface wlan0 already configured</code></pre></div><p>Second, there&#039;s an error message in there. And even though I understand what it says, I have no clue what to do about that.</p><p>The warning message displayed on shutdown is the same in both cases.</p><p>Any ideas?</p>]]></description>
			<author><![CDATA[dummy@example.com (msi)]]></author>
			<pubDate>Mon, 04 Jun 2018 20:08:08 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=9750#p9750</guid>
		</item>
	</channel>
</rss>
