diff options
-rw-r--r-- | scripts/system/vyatta_update_logrotate.pl | 7 | ||||
-rw-r--r-- | scripts/system/vyatta_update_syslog.pl | 7 | ||||
-rw-r--r-- | templates/system/ntp-server/node.def | 29 |
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" |