From 5d80725870ac619f1e6cdb0ee59f13cebfd0f2f1 Mon Sep 17 00:00:00 2001 From: acinonyx Date: Tue, 12 Apr 2011 23:18:19 +0000 Subject: [PATCH] [packages] rsync: Add initscript for rsync daemon Add an initscript to the rsync package for use as a daemon, and a sample rsyncd.conf to show a simple setup. Signed-off-by: Ian Leonard git-svn-id: svn://svn.openwrt.org/openwrt/packages@26630 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/rsync/Makefile | 6 +++++- net/rsync/files/rsyncd.conf | 15 +++++++++++++++ net/rsync/files/rsyncd.init | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 net/rsync/files/rsyncd.conf create mode 100644 net/rsync/files/rsyncd.init diff --git a/net/rsync/Makefile b/net/rsync/Makefile index 8035f7c9d..d6342b5af 100644 --- a/net/rsync/Makefile +++ b/net/rsync/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rsync PKG_VERSION:=3.0.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://rsync.samba.org/ftp/rsync/src @@ -49,6 +49,10 @@ CONFIGURE_ARGS += \ --disable-acl-support \ define Package/rsync/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/rsyncd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/rsyncd.init $(1)/etc/init.d/rsyncd $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ endef diff --git a/net/rsync/files/rsyncd.conf b/net/rsync/files/rsyncd.conf new file mode 100644 index 000000000..896f36887 --- /dev/null +++ b/net/rsync/files/rsyncd.conf @@ -0,0 +1,15 @@ +# /etc/rsyncd.conf +# Minimal configuration for rsync daemon + +# Next line required for init script +pid file = /var/run/rsyncd.pid +use chroot = yes +uid = nobody +gid = nogroup +read only = yes + +# Simple example to configure server +#[openwrt-etc] +#path = /etc +#comment = OpenWrt Configuration Files +#exclude = /init.d diff --git a/net/rsync/files/rsyncd.init b/net/rsync/files/rsyncd.init new file mode 100644 index 000000000..a24a7901e --- /dev/null +++ b/net/rsync/files/rsyncd.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2011 OpenWrt.org + +START=50 +BIN=/usr/bin/rsync +PID=/var/run/rsyncd.pid +SSD=start-stop-daemon + +start() { + $SSD -p $PID -S -x $BIN -- --daemon +} + +stop() { + $SSD -p $PID -K +}