[lsyncd] * Wed Dec 19 2012 Paul Wouters <pwouters at redhat.com> - 2.1.4-1 - Merged in changes of rhbz#805849 -

Paul Wouters pwouters at fedoraproject.org
Wed Dec 19 03:36:57 UTC 2012


commit 3731ebf6b7054b01273c910407c17a92095d345a
Author: Paul Wouters <pwouters at redhat.com>
Date:   Tue Dec 18 22:35:20 2012 -0500

    * Wed Dec 19 2012 Paul Wouters <pwouters at redhat.com> - 2.1.4-1
    - Merged in changes of rhbz#805849
    - Fixed URL/Source
    - Upgraded systemd macros

 .gitignore       |    1 +
 lsyncd.conf      |   11 ++++++
 lsyncd.init      |  103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lsyncd.logrotate |   10 +++++
 lsyncd.service   |   12 ++++++
 lsyncd.spec      |   59 +++++++++++++++++++++----------
 lsyncd.sysconfig |    6 +++
 sources          |    2 +-
 8 files changed, 184 insertions(+), 20 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 959b4e6..e8699bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /lsyncd-2.0.4.tar.gz
+/lsyncd-2.1.4.tar.gz
diff --git a/lsyncd.conf b/lsyncd.conf
new file mode 100644
index 0000000..c9e2e6a
--- /dev/null
+++ b/lsyncd.conf
@@ -0,0 +1,11 @@
+----
+-- User configuration file for lsyncd.
+--
+-- Simple example for default rsync, but executing moves through on the target.
+--
+-- For more examples, see /usr/share/doc/lsyncd*/examples/
+-- 
+sync{default.rsyncssh, source="/var/www/html", host="localhost", targetdir="/tmp/htmlcopy/"}
+
+
+
diff --git a/lsyncd.init b/lsyncd.init
new file mode 100644
index 0000000..6c46d4d
--- /dev/null
+++ b/lsyncd.init
@@ -0,0 +1,103 @@
+#!/bin/bash
+#
+# chkconfig: - 85 15
+# description: Lightweight inotify based sync daemon
+#
+# processname:  lsyncd
+# config:       /etc/lsyncd.conf
+# config:       /etc/sysconfig/lsyncd
+# pidfile:      /var/run/lsyncd.pid
+
+# Source function library
+. /etc/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "$NETWORKING" = "no" ] && exit 0
+
+LSYNCD_OPTIONS="-pidfile /var/run/lsyncd.pid /etc/lsyncd.conf"
+
+if [ -e /etc/sysconfig/lsyncd ]; then
+  . /etc/sysconfig/lsyncd
+fi
+
+RETVAL=0
+
+prog="lsyncd"
+thelock=/var/lock/subsys/lsyncd
+
+start() {
+	[ -f /etc/lsyncd.conf ] || exit 6
+        echo -n $"Starting $prog: "
+        if [ $UID -ne 0 ]; then
+                RETVAL=1
+                failure
+        else
+                daemon /usr/bin/lsyncd $LSYNCD_OPTIONS
+                RETVAL=$?
+                [ $RETVAL -eq 0 ] && touch $thelock
+        fi;
+        echo
+        return $RETVAL
+}
+
+stop() {
+        echo -n $"Stopping $prog: "
+        if [ $UID -ne 0 ]; then
+                RETVAL=1
+                failure
+        else
+                killproc lsyncd
+                RETVAL=$?
+                [ $RETVAL -eq 0 ] && rm -f $thelock
+        fi;
+        echo
+        return $RETVAL
+}
+
+reload(){
+        echo -n $"Reloading $prog: "
+        killproc lsyncd -HUP
+        RETVAL=$?
+        echo
+        return $RETVAL
+}
+
+restart(){
+        stop
+        start
+}
+
+condrestart(){
+    [ -e $thelock ] && restart
+    return 0
+}
+
+case "$1" in
+  start)
+        start
+        ;;
+  stop)
+        stop
+        ;;
+  restart)
+        restart
+        ;;
+  reload)
+        reload
+        ;;
+  condrestart)
+        condrestart
+        ;;
+  status)
+        status lsyncd
+        RETVAL=$?
+        ;;
+  *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
+        RETVAL=1
+esac
+
+exit $RETVAL
diff --git a/lsyncd.logrotate b/lsyncd.logrotate
new file mode 100644
index 0000000..c67f2ee
--- /dev/null
+++ b/lsyncd.logrotate
@@ -0,0 +1,10 @@
+/var/log/lsyncd/*log {
+	missingok
+	notifempty
+	sharedscripts
+	postrotate
+	if [ -f /var/lock/lsyncd ]; then
+		/sbin/service lsyncd restart > /dev/null 2>/dev/null || true
+	fi
+	endscript
+}
diff --git a/lsyncd.service b/lsyncd.service
new file mode 100644
index 0000000..1abc412
--- /dev/null
+++ b/lsyncd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Live Syncing (Mirror) Daemon
+After=network.target
+
+[Service]
+Type=simple
+Nice=19
+EnvironmentFile=-/etc/sysconfig/lsyncd
+ExecStart=/usr/bin/sh -c 'eval `/usr/bin/lsyncd -nodaemon $LSYNCD_OPTIONS /etc/lsyncd.conf`'
+
+[Install]
+WantedBy=multi-user.target
diff --git a/lsyncd.spec b/lsyncd.spec
index 4893b39..78f9ac2 100644
--- a/lsyncd.spec
+++ b/lsyncd.spec
@@ -1,17 +1,27 @@
 Name:           lsyncd
-Version:        2.0.4
-Release:        3%{?dist}
+Version:        2.1.4
+Release:        1%{?dist}
 Summary:        File change monitoring and synchronization daemon
-
 Group:          Applications/Internet
 License:        GPLv2+
 URL:            http://code.google.com/p/lsyncd/
-Source0:        http://lsyncd.googlecode.com/files/%{name}-%{version}.tar.gz
-# http://code.google.com/p/lsyncd/issues/detail?id=55
-Patch0:         lsyncd-2.0.4-execstack.patch
-BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+Source0:        http://%{name}.googlecode.com/files/%{name}-%{version}.tar.gz
+
+Source1: %{name}.service
+Source2: %{name}.init
+Source3: %{name}.sysconfig
+Source4: %{name}.logrotate
+Source5: %{name}.conf
 
 BuildRequires:  lua-devel >= 5.1.3
+BuildRequires:  prelink
+BuildRequires:  asciidoc
+Requires: lua
+Requires: rsync
+
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
 
 %description
 Lsyncd watches a local directory trees event monitor interface (inotify).
@@ -23,35 +33,45 @@ Lsyncd is thus a light-weight live mirror solution that is comparatively
 easy to install not requiring new file systems or block devices and does
 not hamper local file system performance.
 
-
 %prep
 %setup -q
-%patch0 -p1
-
 
 %build
 %configure
 make %{?_smp_mflags}
 
-
 %install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
+make install DESTDIR=%{buildroot}
+install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
+install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
+install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
+install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/
 
+%post
+%systemd_post lsyncd.service
 
-%clean
-rm -rf $RPM_BUILD_ROOT
+%preun
+%systemd_preun lsyncd.service
 
+%postun
+%systemd_postun_with_restart lsyncd.service
 
 %files
-%defattr(-,root,root,-)
+%doc %{_mandir}/man1/lsyncd.1*
+%doc COPYING ChangeLog examples
+%config(noreplace) %{_sysconfdir}/%{name}.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
 %{_bindir}/lsyncd
-%{_mandir}/man1/lsyncd.1*
+%{_unitdir}/%{name}.service
 %exclude %{_docdir}/lsyncd
-%doc COPYING ChangeLog examples
-
 
 %changelog
+* Wed Dec 19 2012 Paul Wouters <pwouters at redhat.com> - 2.1.4-1
+- Merged in changes of rhbz#805849
+- Fixed URL/Source
+- Upgraded systemd macros
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.4-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
@@ -60,3 +80,4 @@ rm -rf $RPM_BUILD_ROOT
 
 * Fri Apr 29 2011 Lubomir Rintel (GoodData) <lubo.rintel at gooddata.com> - 2.0.4-1
 - Initial packaging
+
diff --git a/lsyncd.sysconfig b/lsyncd.sysconfig
new file mode 100644
index 0000000..aa13e16
--- /dev/null
+++ b/lsyncd.sysconfig
@@ -0,0 +1,6 @@
+# Keep the space there for systemd. Don't nest variables without
+# changing the systemd service file to use: /usr/bin/sh -c 'eval XXXX'
+#
+#LSYNC_OPTIONS="-pidfile /var/run/lsyncd.pid /etc/lsyncd.conf"
+
+LSYNC_OPTIONS=" "
diff --git a/sources b/sources
index ecf2fa1..72fcd61 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-0b4557dd3d87a02ae0cbd7b5fc16cd0c  lsyncd-2.0.4.tar.gz
+9302e0c1e9ec8e9da0a1e58c9fb44ecd  lsyncd-2.1.4.tar.gz


More information about the scm-commits mailing list