summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-10-17 18:45:17 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-10-17 18:45:17 -0700
commitbe79ca9ff0b67565870a18fa2ddadd09deb934a1 (patch)
treef54f40c106e66652fada7f08b9117d4753b6f65b
parent8dc3dcf797dee1b498157f986619524b0caff182 (diff)
downloadvyatta-cfg-be79ca9ff0b67565870a18fa2ddadd09deb934a1.tar.gz
vyatta-cfg-be79ca9ff0b67565870a18fa2ddadd09deb934a1.zip
use the default init scripts from ntp and sysklogd
-rw-r--r--scripts/system/vyatta_update_logrotate.pl7
-rw-r--r--scripts/system/vyatta_update_syslog.pl7
-rw-r--r--templates/system/ntp-server/node.def29
3 files changed, 17 insertions, 26 deletions
diff --git a/scripts/system/vyatta_update_logrotate.pl b/scripts/system/vyatta_update_logrotate.pl
index 2740526..abc4a25 100644
--- a/scripts/system/vyatta_update_logrotate.pl
+++ b/scripts/system/vyatta_update_logrotate.pl
@@ -42,12 +42,7 @@ EOF
close OUT;
sleep 1;
-# XXX somehow starting syslogd with 'start-stop-daemon --start...' here fails
-# with SEGV (?). just start syslogd directly.
-#if (system("/opt/vyatta/sbin/sysklogd.init restart")) {
-system("/opt/vyatta/sbin/sysklogd.init stop");
-sleep 1;
-if (system(". /etc/default/syslogd ; /sbin/syslogd \$SYSLOGD")) {
+if (system("/usr/sbin/invoke-rc.d sysklogd restart")) {
exit 4;
}
diff --git a/scripts/system/vyatta_update_syslog.pl b/scripts/system/vyatta_update_syslog.pl
index 315e2a9..a55fe61 100644
--- a/scripts/system/vyatta_update_syslog.pl
+++ b/scripts/system/vyatta_update_syslog.pl
@@ -43,12 +43,7 @@ if ($update_line ne "") {
close OUT;
sleep 1;
-# XXX somehow starting syslogd with 'start-stop-daemon --start...' here fails
-# with SEGV (?). just start syslogd directly.
-#if (system("/opt/vyatta/sbin/sysklogd.init restart")) {
-system("/opt/vyatta/sbin/sysklogd.init stop");
-sleep 1;
-if (system(". /etc/default/syslogd ; /sbin/syslogd \$SYSLOGD")) {
+if (system("/usr/sbin/invoke-rc.d sysklogd restart")) {
exit 5;
}
diff --git a/templates/system/ntp-server/node.def b/templates/system/ntp-server/node.def
index 9f828e1..230dd31 100644
--- a/templates/system/ntp-server/node.def
+++ b/templates/system/ntp-server/node.def
@@ -1,16 +1,17 @@
multi:
type: txt
-help: "IP address of NTP server"
-# should help be "domain name" instead of "ip address", or change type to ipv4?
-create: "sh -c \"touch /etc/ntp/ntp.conf && \
-if ! grep -q 'server.*$(@)' /etc/ntp/ntp.conf; then \
-echo \\\"server $(@)\\\" >> /etc/ntp/ntp.conf && \
-/opt/vyatta/sbin/ntpd.init restart; fi\" "
-update: "sh -c \"touch /etc/ntp/ntp.conf && \
-if ! grep -q 'server.*$(@)' /etc/ntp/ntp.conf; then \
-echo \\\"server $(@)\\\" >> /etc/ntp/ntp.conf && \
-/opt/vyatta/sbin/ntpd.init restart; fi\" "
-delete: "sh -c \"touch /etc/ntp/ntp.conf && \
-if grep -q 'server.*$(@)' /etc/ntp/ntp.conf; then \
-sed -i '/server $(@)/d' /etc/ntp/ntp.conf && \
-/opt/vyatta/sbin/ntpd.init restart; fi\" "
+help: "Name or IP address of NTP server"
+update: "touch /etc/ntp.conf && \
+if ! grep -q 'server.*$(@)' /etc/ntp.conf; then \
+ echo \"server $(@)\" >> /etc/ntp.conf && \
+ /usr/sbin/invoke-rc.d ntp restart; \
+fi"
+delete: "touch /etc/ntp.conf && \
+if grep -q 'server.*$(@)' /etc/ntp.conf; then \
+ sed -i '/server $(@)/d' /etc/ntp.conf && \
+ if grep -q '^server ' /etc/ntp.conf; then \
+ /usr/sbin/invoke-rc.d ntp restart; \
+ else \
+ /usr/sbin/invoke-rc.d ntp stop; \
+ fi; \
+fi"