#!/bin/sh /etc/rc.common
# Copyright (C) 2011-2014 OpenWrt.org

START=90
STOP=10

USE_PROCD=1
PROG=/usr/bin/rsync

start_service() {
	procd_open_instance
	procd_set_param command "$PROG" --daemon --no-detach
	[ -x /sbin/ujail -a -e /etc/capabilities/rsyncd.json ] && {
		procd_add_jail rsyncd
		procd_set_param capabilities /etc/capabilities/rsyncd.json
		procd_set_param user rsyncd
		procd_set_param group rsyncd
		procd_set_param no_new_privs 1
	}
	procd_close_instance
}
