Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <rest-service> resource-restful : add inital YaPI for ntp, (it is YaPI but due to bad YaST ntp-client condition it doesn't use it)
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 3 Sep 2009 15:14:24 +0200
  • Message-id: <E1Mq44D-00084d-Th@xxxxxxxxxxxxxxxx>
ref: refs/heads/resource-restful
commit 94f7662051eb6ea3dea9c6381305147b1d860a2c
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Thu Sep 3 15:14:24 2009 +0200

add inital YaPI for ntp, (it is YaPI but due to bad YaST ntp-client
condition it doesn't use it)
---
plugins/time/package/NTP.pm | 21 ++++++++++++++++++++
.../org.opensuse.yast.modules.yapi.ntp.policy | 19 ++++++++++++++++++
2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/plugins/time/package/NTP.pm b/plugins/time/package/NTP.pm
new file mode 100644
index 0000000..36b401b
--- /dev/null
+++ b/plugins/time/package/NTP.pm
@@ -0,0 +1,21 @@
+package YaPI::NTP;
+
+use strict;
+use YaPI;
+
+BEGIN{$TYPEINFO{Synchronize} = ["function",
+ "string","string"];
+sub Synchronize {
+ my $self = shift;
+ my $server = shift;
+
+ # -r: do set the system time
+ # -P no: do not ask if time difference is too large
+ # -c 1 -d 15: delay 15s, only one try (bnc#442287)
+ $out = `/usr/sbin/sntp -c 1 -d 15 -r -P no '$server' 2>&1`
+ if ($?){
+ return $out;
+ } else {
+ return "OK"
+ }
+}
diff --git a/plugins/time/package/org.opensuse.yast.modules.yapi.ntp.policy
b/plugins/time/package/org.opensuse.yast.modules.yapi.ntp.policy
new file mode 100644
index 0000000..070184f
--- /dev/null
+++ b/plugins/time/package/org.opensuse.yast.modules.yapi.ntp.policy
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd";>
+<policyconfig>
+
+ <vendor>YaST Webservice Project</vendor>
+ <vendor_url>http://en.opensuse.org/YAST</vendor_url>
+
+ <action id="org.opensuse.yast.modules.yapi.ntp.synchronize">
+ <description>One time synchronization agaijn given ntp server</description>
+ <message>Authentication is required to onetime synchronize with
ntp</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>no</allow_active>
+ </defaults>
+ </action>
+
+</policyconfig>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages