]> git.pld-linux.org Git - packages/lldpd.git/commitdiff
start scripts auto/th/lldpd-0.5.7-0.1
authorPaweł Gołaszewski <blues@pld-linux.org>
Wed, 14 Nov 2012 13:26:26 +0000 (14:26 +0100)
committerPaweł Gołaszewski <blues@pld-linux.org>
Wed, 14 Nov 2012 13:26:26 +0000 (14:26 +0100)
lldpd.init [new file with mode: 0644]
lldpd.spec
lldpd.sysconfig [new file with mode: 0644]

diff --git a/lldpd.init b/lldpd.init
new file mode 100644 (file)
index 0000000..2126dbf
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/sh
+# openlldp     LLDPD - LLDP, CDP and EDP implimentation
+#
+# chkconfig:   345 55 55
+# description: The LLDPD project aims to provide a comprehensive implementation 
+#              of the IEEE standard 802.1AB Link Layer Discovery Protocol.
+# processname: lldpd
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/lldpd ] && . /etc/sysconfig/lldpd
+
+start() {
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/lldpd ]; then
+               msg_starting "LLDP Daemon"
+               daemon /usr/sbin/lldpd $LLDP_OPT
+               RETVAL=$?
+               if [ $RETVAL -eq 0 ]; then
+                       touch /var/lock/subsys/lldpd
+                       ok
+               else
+                       fail
+               fi
+       else
+               msg_already_running "LLDP Daemon"
+       fi
+}
+
+stop() {
+       # Stop daemons.
+       if [ -f /var/lock/subsys/lldpd ]; then
+               killproc --pidfile /var/run/lldpd.pid lldpd
+               rm -f /var/lock/subsys/lldpd
+       else
+               msg_not_running "LLDP Daemon"
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  status)
+       status lldpd
+       RETVAL=$?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|status}"
+       exit 3
+       ;;
+esac
+
+exit $RETVAL
index 4807b1f86373b751e1d7970c031b7d02da40f6f9..271ad17a9f4c0c929e379be519e7105d923f560f 100644 (file)
@@ -10,15 +10,15 @@ License:    MIT
 Group:         Networking
 Source0:       http://media.luffy.cx/files/lldpd/%{name}-%{version}.tar.gz
 # Source0-md5: 3db3a80fa6a384cd59e9d6a42ce7b630
-#Source2:      %{name}-lldpd.init
-#Source3:      %{name}-lldpd.sysconfig
-#Source4:      %{name}-lldpd.service
+Source1:       %{name}.init
+Source2:       %{name}.sysconfig
+#Source3:      %{name}-lldpd.service
 URL:           https://github.com/vincentbernat/lldpd/wiki
 BuildRequires: autoconf >= 1.5
 BuildRequires: automake
-BuildRequires: libconfuse-devel
 Requires(post,preun,postun):   systemd-units >= 38
 Requires:      systemd-units >= 38
+Conflicts:     openlldp
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -49,13 +49,13 @@ on bridges. More complex setups may give false results.
 
 %install
 rm -rf $RPM_BUILD_ROOT
-#install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{systemdunitdir}}
+install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{systemdunitdir}}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
-#install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lldpd
-#install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/lldpd
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/lldpd
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lldpd
 #install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/lldpd.service
 
 %clean
@@ -64,7 +64,7 @@ rm -rf $RPM_BUILD_ROOT
 %post
 /sbin/chkconfig --add lldpd
 %service lldpd restart "LLDP Daemon"
-%systemd_post lldpd.service
+#systemd_post lldpd.service
 
 %preun
 if [ "$1" = "0" ]; then
@@ -76,14 +76,14 @@ fi
 %postun
 %systemd_reload
 
-%triggerpostun -- openlldp < 0.4
+%triggerpostun -- lldpd < 0.4
 %systemd_trigger lldpd.service
 
 %files
 %defattr(644,root,root,755)
 %doc CHANGELOG README.md
-#%attr(754,root,root) /etc/rc.d/init.d/lldpd
-#%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lldpd
+%attr(754,root,root) /etc/rc.d/init.d/lldpd
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lldpd
 #%{systemdunitdir}/lldpd.service
 %attr(755,root,root) %{_sbindir}/lldpd
 %attr(755,root,root) %{_sbindir}/lldpctl
diff --git a/lldpd.sysconfig b/lldpd.sysconfig
new file mode 100644 (file)
index 0000000..b0243ba
--- /dev/null
@@ -0,0 +1,3 @@
+# Customized settings for lldpd
+
+LLDP_OPT=""
This page took 0.107264 seconds and 4 git commands to generate.