From 86f5b18fd764f8349c5d8bfd5e8014b285df866d Mon Sep 17 00:00:00 2001 From: kueller Date: Thu, 22 Apr 2010 13:35:17 +0000 Subject: [PATCH] Vorbereitung auf upstart git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_ntp@5573 504e572c-2e33-0410-9681-be2bf7408885 --- etc/init/ntpd.conf | 19 +++++++++++++++++++ init/genpkg | 32 +++++++++++++++++--------------- 2 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 etc/init/ntpd.conf diff --git a/etc/init/ntpd.conf b/etc/init/ntpd.conf new file mode 100644 index 0000000..4e595e2 --- /dev/null +++ b/etc/init/ntpd.conf @@ -0,0 +1,19 @@ +description "Samba Name Deamon" +author "Harald Kueller " +version 1.0 +emits none special + +start on (runlevel [2345] and (started ifup)) +stop on runlevel [016] + +console output + +pre-start script + if [ -f /etc/ntp.conf ]; then + /usr/bin/ntpdate `grep server /etc/ntp.conf|head --lines=1|sed -e "s/server //g"` + else + exit 10 + fi +end script + +exec /usr/bin/ntpd -n -l /var/log/ntp.log diff --git a/init/genpkg b/init/genpkg index 71b138b..bfc5d05 100644 --- a/init/genpkg +++ b/init/genpkg @@ -32,18 +32,20 @@ # # -WDIR=`pwd` -cd etc/init.d -chmod 755 ntp -mkdir rc{0,1,2,3,4,5,6}.d -for i in 0 1 2 6; do - cd rc$i.d - ln -s ../ntp K75ntp - cd .. -done -for i in 3 4 5; do - cd rc$i.d - ln -s ../ntp S13ntp - cd .. -done -cd $WDIR +if [ -d /var/install/sysvinit* ]; then + WDIR=`pwd` + cd etc/init.d + chmod 755 ntp + mkdir rc{0,1,2,3,4,5,6}.d + for i in 0 1 2 6; do + cd rc$i.d + ln -s ../ntp K75ntp + cd .. + done + for i in 3 4 5; do + cd rc$i.d + ln -s ../ntp S13ntp + cd .. + done + cd $WDIR +fi