Bug 365515

Summary: ntp init script broken
Product: [openSUSE] openSUSE 11.0 Reporter: Ludwig Nussel <lnussel>
Component: NetworkAssignee: Andreas Schneider <anschneider>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: samba-maintainers, vuntz
Version: Alpha 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 359502, 361548    

Description Ludwig Nussel 2008-02-28 09:54:46 UTC
The ntp init script in factory is broken:
- the script removes all server lines, starts ntpd without servers and re-adds them. This loses all server options except iburst
- there is an exception for the local clock but it uses 127.0.0.1 instead of 127.127.1.0
- the temporary ntp.conf is stored in /etc. somewhere below /var would be more suitable.
- startproc is used to start ntpd and the temporary file is removed immediately after. This causes a race condition where ntpd will not find the config file as startproc forks immediately and returns control to the shell script.
Comment 1 Vincent Untz 2008-03-02 00:32:55 UTC
Also, from the init script:

NTP_KEYS=$(awk '/^keys/ { print $2 }' $NTP_CONF)
if test -z "$NTP_KEYS"; then
	echo -n "NTP key file does not exist"
    rc_status -s
    exit 5
fi
NTP_KEYID=$(awk '/^requestkey[[:blank:]]/ { print $2 }' $NTP_CONF)
if test -z "$NTP_KEYS"; then
	echo -n "NTP key id not defined"
    rc_status -s
    exit 5
fi
NTP_PASSWD=$(awk '$0 ~ key { print $3 }' key="^[[:blank:]]*$NTP_KEYID[[:blank:]]" $NTP_KEYS)
if test -z "$NTP_KEYS"; then
	echo -n "No password for requestkey set"
	return 1
fi

The last two tests should not look at the length of $NTP_KEYS, I guess.

Another problem is that if ntp.conf is updated with dhcp (DHCLIENT_MODIFY_NTP_CONF option in /etc/sysconfig/network/dhcp), there's no keys option defined in the updated ntp.conf and so ntp fails to start...
Comment 2 Andreas Schneider 2008-03-25 11:18:56 UTC
Fixed with the next factory update.