summaryrefslogtreecommitdiffstats
path: root/ipa-client/ipaclient
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2008-03-31 17:33:55 -0400
committerSimo Sorce <ssorce@redhat.com>2008-03-31 17:33:55 -0400
commit28ac93a5356979efeff2e0a09b099ded77cba75e (patch)
tree87d2c8098cda80549f13878665b28e7fa68efac1 /ipa-client/ipaclient
parent7b5088955ad5b4b273fc48d3443fb42aaece37b7 (diff)
downloadfreeipa-28ac93a5356979efeff2e0a09b099ded77cba75e.tar.gz
freeipa-28ac93a5356979efeff2e0a09b099ded77cba75e.tar.xz
freeipa-28ac93a5356979efeff2e0a09b099ded77cba75e.zip
Implement client uninstall
(including RHEL4 contrib setup script)
Diffstat (limited to 'ipa-client/ipaclient')
-rw-r--r--ipa-client/ipaclient/ntpconf.py34
1 files changed, 28 insertions, 6 deletions
diff --git a/ipa-client/ipaclient/ntpconf.py b/ipa-client/ipaclient/ntpconf.py
index ca88cedeb..14e720c2b 100644
--- a/ipa-client/ipaclient/ntpconf.py
+++ b/ipa-client/ipaclient/ntpconf.py
@@ -70,20 +70,42 @@ keys /etc/ntp/keys
#controlkey 8
"""
-def config_ntp(server_fqdn):
+ntp_sysconfig = """# Drop root to id 'ntp:ntp' by default.
+OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
+
+# Set to 'yes' to sync hw clock after successful ntpdate
+SYNC_HWCLOCK=yes
+
+# Additional options for ntpdate
+NTPDATE_OPTIONS=""
+"""
+
+def config_ntp(server_fqdn, fstore = None):
sub_dict = { }
sub_dict["SERVER"] = server_fqdn
-
+
nc = template_str(ntp_conf, sub_dict)
-
- shutil.copy("/etc/ntp.conf", "/etc/ntp.conf.ipasave")
-
+
+ if fstore:
+ fstore.backup_file("/etc/ntp.conf")
+ else:
+ shutil.copy("/etc/ntp.conf", "/etc/ntp.conf.ipasave")
+
fd = open("/etc/ntp.conf", "w")
fd.write(nc)
fd.close()
+ if fstore:
+ fstore.backup_file("/etc/sysconfig/ntpd")
+ else:
+ shutil.copy("/etc/sysconfig/ntpd", "/etc/sysconfig/ntpd.ipasave")
+
+ fd = open("/etc/sysconfig/ntpd", "w")
+ fd.write(ntp_sysconfig)
+ fd.close()
+
# Set the ntpd to start on boot
run(["/sbin/chkconfig", "ntpd", "on"])
-
+
# Restart ntpd
run(["/sbin/service", "ntpd", "restart"])