https://bugzilla.novell.com/show_bug.cgi?id=758879 https://bugzilla.novell.com/show_bug.cgi?id=758879#c7 --- Comment #7 from David Mair <dmair@suse.com> 2013-10-20 23:36:12 UTC --- Created an attachment (id=564157) --> (http://bugzilla.novell.com/attachment.cgi?id=564157) Sleazy bash script hack workaround to this bug This is NOT a fix, the setting of NTP servers from DHCP data should be automated but as an alternative to doing all the manual steps the attached bash script permits the problem to be worked around at least with a single command-line: fixntpservers <IF/connection name> The argument can be an interface device name or a NetworkManager connection name (see the NetworkManager connection manager tool for a list). For example, I have a connection named wireless in my connection list. Assuming it is a currently connected NetworkManager connection with an option ntp-servers lease file entry then: fixntpservers wireless Will get the NTP server list, and write it as a NTPSERVERS variable to /var/run/netconfig/NetworkManager.netconfig then run netconfig to update the ntp-runtime module. Beyond the sleaziness of the manual effort required every time you connect it is further sleazy in it's use of sudo for the following (sudoers ready) commands: /sbin/netconfig update -m ntp-runtime *, \ /usr/bin/grep uuid /etc/NetworkManager/system-connections/*, \ /usr/bin/cp /var/run/netconfig/NetworkManager.netconfig /tmp/tmp.NetworkManager.netconfig, \ /usr/bin/cp /tmp/tmp.NetworkManager.netconfig /var/run/netconfig/NetworkManager.netconfig, \ /usr/bin/chgrp users /tmp/tmp.NetworkManager.netconfig, \ /usr/bin/chgrp root /tmp/tmp.NetworkManager.netconfig, \ /usr/bin/chmod g+w /tmp/tmp.NetworkManager.netconfig, \ /usr/bin/chmod g-w /tmp/tmp.NetworkManager.netconfig, \ If you add it at the end of a user's sudo permissions remove the , \ from the end of the last line. The reasons for all the lines are that the ultimate goal is to run netconfig update -m ntp-runtime (perhaps with a -v on the end here) to set ntpd from NetworkManager.netconfig. But first we have to add the NTPSERVERS line to /var/run/netconfig/NetworkManager.netconfig and it's permissions are user root read/write, group root read and no world permissions. So, rather than hack the permissions to edit it in place it gets copied to $TMPDIR which the above sudoers settings assume is /tmp. If your $TMPDIR location is somewhere else change the /tmp/ in each case above to the correct location, the shell script uses $TMPDIR each time however and doesn't need changed. Once copied the file group is changed to users and the group write permission added. The NTPSERVERS line is then appended and the group write permission removed and the group reset to root before the file is copied over the original /var/run/netconfig/NetworkManager.netconfig. At that point, running netconfig update for the ntp-runtime module should create a running ntpd with a server list your DHCP server supplied. There are other ways, such as not doing the two copies and just changing the world permissions of the active file to allow write with only two sudoers commands (chmod o+w and chmod o-w) and each way is better than all the others. Checking on my home wireless I now see an actual server in the ntpq -pn output as opposed to the error that ntpd has no IDs and the displayed server is the correct server my DHCP server specifies. I don't promise it works for all scenarios but it should be easy to modify for those I can imagine. Take the * (including the space in front of it) from the end of the netconfig sudoers line and remove the space and the -v from the netconfig line in the shell script to tighten it up a tiny bit at the cost of less diagnostic output. Change the setting of DEBUG to 0 to reduce the amount of output (it's mostly diagnostic for following the flow of the script). Specifying an interface devname isn't the best use. With NetworkManager and a mobile host you are bound to have several lease files for the same interface and only one will be valid during any connection and I haven't bothered to select one line from the ls ouput (i.e. I assume you'll only use it with an interface with only one lease file anyway). But it's a start. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.