SHA256
1
0
forked from pool/rsync

- rsync-gcc14.patch: fixed the ipv6 configure check (bsc#1230156)

OBS-URL: https://build.opensuse.org/package/show/network/rsync?expand=0&rev=125
This commit is contained in:
David Anes 2024-09-06 12:59:14 +00:00 committed by Git OBS Bridge
commit 3bc367b409
21 changed files with 1965 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

11
logrotate.rsync Normal file
View File

@ -0,0 +1,11 @@
/var/log/rsyncd.log {
compress
dateext
maxage 365
rotate 99
size=+1024k
notifempty
missingok
copytruncate
}

BIN
rsync-3.3.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

6
rsync-3.3.0.tar.gz.asc Normal file
View File

@ -0,0 +1,6 @@
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQQASMiwJtTJbw5YnC9shZ+xS5aoxQUCZhF6vQAKCRBshZ+xS5ao
xZ6kAKDZkE3C9w/cu8o3/Ic5KNycbcTw8gCdH/pdNo6kSGF3qLelFI6uK5Q4jdA=
=vJGJ
-----END PGP SIGNATURE-----

13
rsync-gcc14.patch Normal file
View File

@ -0,0 +1,13 @@
Index: rsync-3.3.0/configure.ac
===================================================================
--- rsync-3.3.0.orig/configure.ac
+++ rsync-3.3.0/configure.ac
@@ -412,7 +412,7 @@ AS_HELP_STRING([--disable-ipv6],[disable
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
-main()
+int main(void)
{
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);

13
rsync-no-libattr.patch Normal file
View File

@ -0,0 +1,13 @@
Index: rsync-3.2.2/configure.ac
===================================================================
--- rsync-3.2.2.orig/configure.ac
+++ rsync-3.2.2/configure.ac
@@ -1309,7 +1309,7 @@ else
AC_DEFINE(HAVE_LINUX_XATTRS, 1, [True if you have Linux xattrs (or equivalent)])
AC_DEFINE(SUPPORT_XATTRS, 1)
AC_DEFINE(NO_SYMLINK_USER_XATTRS, 1, [True if symlinks do not support user xattrs])
- AC_CHECK_LIB(attr,getxattr)
+ AC_SEARCH_LIBS([getxattr], [attr])
;;
darwin*)
AC_MSG_RESULT(Using OS X xattrs)

BIN
rsync-patches-3.3.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQQASMiwJtTJbw5YnC9shZ+xS5aoxQUCZhF6vQAKCRBshZ+xS5ao
xcOpAJ0e/0uM2Ds98F7lwsTWiYdsJJ4EGwCfU4SaBIySxtKPdHh0Qy6Y1dt8uTc=
=dZu7
-----END PGP SIGNATURE-----

12
rsync-run-dir.patch Normal file
View File

@ -0,0 +1,12 @@
diff -ur rsync-3.3.0.old/rsync.h rsync-3.3.0/rsync.h
--- rsync-3.3.0.old/rsync.h 2022-10-16 19:28:58.000000000 +0200
+++ rsync-3.3.0/rsync.h 2024-08-26 11:31:14.458919925 +0200
@@ -30,7 +30,7 @@
/* RSYNCD_SYSCONF is now set in config.h */
#define RSYNCD_USERCONF "rsyncd.conf"
-#define DEFAULT_LOCK_FILE "/var/run/rsyncd.lock"
+#define DEFAULT_LOCK_FILE "/run/rsyncd.lock"
#define URL_PREFIX "rsync://"
#define SYMLINK_PREFIX "/rsyncd-munged/" /* This MUST have a trailing slash! */

76
rsync-usr-etc.patch Normal file
View File

@ -0,0 +1,76 @@
Nur in a: .cirrus.yml.
diff -ur a/clientserver.c b/clientserver.c
--- a/clientserver.c 2023-11-28 17:12:41.643268046 +0100
+++ b/clientserver.c 2023-11-28 17:25:30.476279700 +0100
@@ -1261,10 +1261,16 @@
static int load_config(int globals_only)
{
if (!config_file) {
- if (am_daemon < 0 && am_root <= 0)
+ if (am_daemon < 0 && am_root <= 0) {
config_file = RSYNCD_USERCONF;
- else
+ } else {
config_file = RSYNCD_SYSCONF;
+#ifdef RSYNCD_DISTCONF
+ STRUCT_STAT st;
+ if (do_stat(RSYNCD_SYSCONF, &st) != 0)
+ config_file = RSYNCD_DISTCONF;
+#endif
+ }
}
return lp_load(config_file, globals_only);
}
diff -ur a/configure.ac b/configure.ac
--- a/configure.ac 2023-11-28 17:12:41.647268046 +0100
+++ b/configure.ac 2023-11-28 17:40:15.678280030 +0100
@@ -175,7 +175,7 @@
AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])
AC_ARG_WITH(rsyncd-conf,
- AS_HELP_STRING([--with-rsyncd-conf=PATH],[set configuration file for rsync server to PATH (default: /etc/rsyncd.conf)]),
+ AS_HELP_STRING([--with-rsyncd-conf=PATH],[set user/admin defined configuration file for rsync server to PATH (default: /etc/rsyncd.conf)]),
[ if test ! -z "$with_rsyncd_conf" ; then
case $with_rsyncd_conf in
yes|no)
@@ -193,7 +193,27 @@
fi ],
[ RSYNCD_SYSCONF="/etc/rsyncd.conf" ])
-AC_DEFINE_UNQUOTED(RSYNCD_SYSCONF, "$RSYNCD_SYSCONF", [location of configuration file for rsync server])
+AC_DEFINE_UNQUOTED(RSYNCD_SYSCONF, "$RSYNCD_SYSCONF", [location of user/admin defined configuration file for rsync server])
+
+AC_ARG_WITH(rsyncd-distconf,
+ AS_HELP_STRING([--with-rsyncd-distconf=PATH],[set vendor configuration file for rsync server to PATH (default: not set)]),
+ [ if test ! -z "$with_rsyncd_distconf" ; then
+ case $with_rsyncd_distconf in
+ yes|no)
+ RSYNCD_DISTCONF="/usr/etc/rsyncd.conf"
+ ;;
+ /*)
+ RSYNCD_DISTCONF="$with_rsyncd_distconf"
+ ;;
+ *)
+ AC_MSG_ERROR(You must specify an absolute path to --with-rsyncd-distconf=PATH)
+ ;;
+ esac
+ fi
+ ],
+ [])
+
+AC_DEFINE_UNQUOTED(RSYNCD_DISTCONF, "$RSYNCD_DISTCONF", [location of vendor configuration file for rsync server])
AC_ARG_WITH(rsh,
AS_HELP_STRING([--with-rsh=CMD],[set remote shell command to CMD (default: ssh)]))
diff -ur a/rsyncd.conf.5.md b/rsyncd.conf.5.md
--- a/rsyncd.conf.5.md 2023-11-28 17:12:41.643268046 +0100
+++ b/rsyncd.conf.5.md 2023-11-29 13:08:32.125333095 +0100
@@ -1235,7 +1235,7 @@
## FILES
-/etc/rsyncd.conf or rsyncd.conf
+rsyncd.conf or /etc/rsyncd.conf or /usr/etc/rsyncd.conf
## SEE ALSO

1346
rsync.changes Normal file

File diff suppressed because it is too large Load Diff

32
rsync.keyring Normal file
View File

@ -0,0 +1,32 @@
pub 1024D/4B96A8C5 2003-12-19
uid Wayne Davison <wayned@users.sourceforge.net>
uid Wayne Davison <wayned@samba.org>
sub 1024g/29C67D63 2003-12-19
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.9 (GNU/Linux)
mQGiBD/ja2cRBACZqtQ/VnuWd2TA/T4nFitXPOF//7uterTWZVMDBrSE3tJdW1lv
90z2g2RJKktJTC3yjs82IH6wWvvFsHDPGXQRuoBr0dPYHBaVhKX85uewigHiE2M1
1Ub8Vv1c/JDGAh1cNmCAWazghV+emamrWJWq0f0hz5eqq4LCcPwo4riUVwCg9W37
YAR8Z4NHa6FWjrEKjl2NIMUD/iXJnp6qJFMK9Fs+2dWyL1m/mRb0h+I/cqgpkUvo
gRhL95Jttg2QQtXJWCsB3hA/L/2Iu2bV8iS1aRlZQsAWogA3/m56ROs8cIyN4ouj
1dpPoG7sKGA8BTvXxuSF9l6ngx7208iX+xiQCDeGfBtBFBy70iJxTFGzp2mP3IiP
pwWtBACJ6l8UPwSRmp0Hz/N6H4RkzqGQnvYsMba/uPkRYou/14JsEGCQqjSB99UX
hsPg9wubCEpo3YFTf1p1j3OlbOhiiMkRFwyYaT1fqGjQK0w8hQ1yXHxbXffnz6e3
gKELz7fNQxS0L/tZkNOT7uyGuwnPsUDCBAzDPMwYVIFRo+MKZLQgV2F5bmUgRGF2
aXNvbiA8d2F5bmVkQHNhbWJhLm9yZz6IWwQTEQIAGwUCP+NrZwYLCQgHAwIDFQID
AxYCAQIeAQIXgAAKCRBshZ+xS5aoxbKaAJ98/UHW+BAmnsWCvCXYw5xAvjKQuwCg
7rJUYSl3xpb6YmIaBbyyw5QTKiC0LFdheW5lIERhdmlzb24gPHdheW5lZEB1c2Vy
cy5zb3VyY2Vmb3JnZS5uZXQ+iF4EExECAB4FAkFgW4ACGwMGCwkIBwMCAxUCAwMW
AgECHgECF4AACgkQbIWfsUuWqMXxFQCg9Dgb5SnWZroPGl25DL2OYFHdqV4An0N2
QQj0mVi18JgadtS4xv7yNiDauQENBD/ja3EQBADkZadXo4zP2P9XjCP9jCel2hIp
E/khYifgu8sLYQ3VOaVM6iczw71a+iM3C44CddioGNv0svJ/cEttbtAE5zZIfqm0
Rd/CYR+kqOkUydss736olRh+4lXLi9dAzDwHoEmlO+i95V6bDdSCAF9+XLhpfUY/
xtgistlUGTd+wyeQMwADBQP9HXUGOcR18VJsQtFOmXaXv9MSKZYMjCf9R5Z7gcPF
PSIWINyUvMEgnLIrUKJ7pgoA6cLDnYm/lBVP801u5C+D4s79oCnjS21wlOxA2Go0
hxG6XpT9mwBOWk4uZUK+g8Emeu7Vi6l3XwH8fACdCIfp3wKlqH/qtkqN7Gts95TM
59uIRgQYEQIABgUCP+NrcQAKCRBshZ+xS5aoxUisAKC2tk0y7PNjh9C9vbfx3fdA
gqiD8gCgg6qjwVbeddcrA0a84BB3zXnb93A=
=0IcW
-----END PGP PUBLIC KEY BLOCK-----

217
rsync.spec Normal file
View File

@ -0,0 +1,217 @@
#
# spec file for package rsync
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if 0%{?suse_version} >= 1550
%bcond_without xxhash
%else
%bcond_with xxhash
%endif
%if 0%{?suse_version} < 1550
%bcond_without gcc11
%else
%bcond_with gcc11
%endif
%if 0%{?suse_version} < 1600
%bcond_without slp
%else
%bcond_with slp
%endif
Name: rsync
Version: 3.3.0
Release: 0
Summary: Versatile tool for fast incremental file transfer
License: GPL-3.0-or-later
Group: Productivity/Networking/Other
URL: https://rsync.samba.org/
Source: https://rsync.samba.org/ftp/rsync/src/rsync-%{version}.tar.gz
Source1: https://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.tar.gz
Source2: logrotate.rsync
Source3: rsyncd.socket
Source4: rsyncd.rc
Source5: rsyncd.conf
Source6: rsyncd.secrets
Source8: rsyncd.service
Source9: rsyncd@.service
Source10: https://rsync.samba.org/ftp/rsync/src/rsync-%{version}.tar.gz.asc
Source11: https://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.tar.gz.asc
Source12: %{name}.keyring
Source13: rsyncd
Patch0: rsync-no-libattr.patch
Patch1: rsync-gcc14.patch
Patch2: rsync-usr-etc.patch
Patch3: rsync-run-dir.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: c++_compiler
BuildRequires: libacl-devel
BuildRequires: liblz4-devel
BuildRequires: libzstd-devel
BuildRequires: pkgconfig
BuildRequires: popt-devel
BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel
%if %{with xxhash}
BuildRequires: pkgconfig(libxxhash) >= 0.8.0
%endif
%if %{with gcc11}
BuildRequires: gcc11-c++
%endif
%if %{with slp}
BuildRequires: openslp-devel
%endif
BuildRequires: pkgconfig(openssl)
Requires(post): grep
Requires(post): sed
Recommends: logrotate
%description
Rsync is a fast and extraordinarily versatile file copying tool. It can copy
locally, to/from another host over any remote shell, or to/from a remote rsync
daemon. It offers a large number of options that control every aspect of its
behavior and permit very flexible specification of the set of files to be
copied. It is famous for its delta-transfer algorithm, which reduces the amount
of data sent over the network by sending only the differences between the
source files and the existing files in the destination. Rsync is widely used
for backups and mirroring and as an improved copy command for everyday use.
%prep
%setup -q -b 1
rm -f zlib/*.h zlib/*.c
%if %{with slp}
patch -p1 < patches/slp.diff
%endif
%autopatch -p1
%build
autoreconf -fiv
%if %{with gcc11}
export CC=gcc-11
export CXX=g++-11
%endif
export CFLAGS="%{optflags} -fPIC -DPIC -fPIE"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-Wl,-z,relro,-z,now -fPIE -pie"
%configure \
--with-included-popt=no \
--with-included-zlib=no \
--disable-debug \
%if 0%{?suse_version} > 1500
--with-rsyncd-distconf=%{_distconfdir}/rsyncd.conf \
%endif
%if !%{with xxhash}
--disable-xxhash\
%endif
%ifarch x86_64
--enable-roll-simd \
%endif
%if %{with slp}
--enable-slp \
%endif
--enable-acl-support \
--enable-xattr-support
%make_build reconfigure
%make_build
%check
chmod +x support/*
%make_build check
chmod -x support/*
%install
%make_install
rm -f %{buildroot}%{_sbindir}/rsyncd
install -d %{buildroot}%{_sysconfdir}/init.d
install -d %{buildroot}%{_sysconfdir}/xinetd.d
install -d %{buildroot}%{_sbindir}
install -m 755 %{SOURCE13} %{buildroot}%{_sbindir}/rsyncd
install -m 755 support/rsyncstats %{buildroot}%{_bindir}
%if 0%{?suse_version} > 1500
install -d %{buildroot}%{_distconfdir}/logrotate.d
install -m 644 %{SOURCE2} %{buildroot}%{_distconfdir}/logrotate.d/rsync
install -m 644 %{SOURCE5} %{buildroot}%{_distconfdir}/rsyncd.conf
install -m 600 %{SOURCE6} %{buildroot}%{_distconfdir}/rsyncd.secrets
echo "# This is a template only. Create your own entries in /etc/rsyncd.secrets" >>%{buildroot}%{_distconfdir}/rsyncd.secrets
echo
%else
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/rsync
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/rsyncd.conf
install -m 600 %{SOURCE6} %{buildroot}%{_sysconfdir}/rsyncd.secrets
%endif
install -D -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/rsyncd@.service
install -D -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/rsyncd.service
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/rsyncd.socket
ln -sf service %{buildroot}%{_sbindir}/rcrsyncd
chmod -x support/*
%pre
%service_add_pre rsyncd.service
%if 0%{?suse_version} > 1500
# Prepare for migration to /usr/etc; save any old .rpmsave
for i in logrotate.d/rsync rsyncd.conf rsyncd.secrets; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
done
%endif
%if 0%{?suse_version} > 1500
%posttrans
# Migration to /usr/etc, restore just created .rpmsave
for i in logrotate.d/rsync rsyncd.conf rsyncd.secrets; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
done
%endif
%preun
%service_del_preun rsyncd.service
%post
%service_add_post rsyncd.service
%postun
%service_del_postun rsyncd.service
%files
%license COPYING
%doc NEWS.md README.md tech_report.tex support/
%{_unitdir}/rsyncd@.service
%{_unitdir}/rsyncd.service
%{_unitdir}/rsyncd.socket
%if 0%{?suse_version} > 1500
%{_distconfdir}/logrotate.d/rsync
%{_distconfdir}/rsyncd.conf
%{_distconfdir}/rsyncd.secrets
%else
%config(noreplace) %{_sysconfdir}/logrotate.d/rsync
%config(noreplace) %{_sysconfdir}/rsyncd.conf
%config(noreplace) %{_sysconfdir}/rsyncd.secrets
%endif
%{_sbindir}/rcrsyncd
%{_sbindir}/rsyncd
%{_bindir}/rsyncstats
%{_bindir}/rsync
%{_bindir}/rsync-ssl
%{_mandir}/man1/rsync.1%{?ext_man}
%{_mandir}/man1/rsync-ssl.1%{?ext_man}
%{_mandir}/man5/rsyncd.conf.5%{?ext_man}
%changelog

6
rsyncd Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# We need this wrapper instead of a plain symlink to be able to set
# a different SELinux label on this
exec -a rsyncd /usr/bin/rsync "$@"

16
rsyncd.conf Normal file
View File

@ -0,0 +1,16 @@
gid = users
read only = true
use chroot = true
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /run/rsyncd.pid
hosts allow = trusted.hosts
slp refresh = 300
use slp = false
#[Example]
# path = /home/Example
# comment = An Example
# auth users = user
# secrets file = /etc/rsyncd.secrets

137
rsyncd.rc Normal file
View File

@ -0,0 +1,137 @@
#! /bin/sh
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
# Copyright (c) 2002 SuSE Linux AG
#
# Author: Kurt Garloff <feedback@suse.de>
#
# init.d/rsyncd
#
# and symbolic its link
#
# /sbin/rcrsyncd
#
# System startup script for the rsync daemon
#
### BEGIN INIT INFO
# Provides: rsync
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: slpd
# Should-Stop: slpd
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start the rsync server daemon
# Short-Description: Start the rsync server daemon
### END INIT INFO
RSYNCD_BIN=/usr/sbin/rsyncd
test -x $RSYNCD_BIN || exit 5
RSYNCD_PID=/var/run/rsyncd.pid
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num><num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
case "$1" in
start)
echo -n "Starting rsync daemon"
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.
# NOTE: startproc return 0, even if service is
# already running to match LSB spec.
startproc -p $RSYNCD_PID -t 1 $RSYNCD_BIN --daemon
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down rsync daemon"
## Stop daemon with killproc(8) and if this fails
## set echo the echo return value.
killproc -p $RSYNCD_PID $RSYNCD_BIN
# Remember status and be verbose
rc_status -v
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
$0 status >/dev/null && $0 restart
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
## If it does not support it, restart.
echo "Reload service rsync"
"$0" restart
rc_status -v
;;
reload)
# rsyncd does not catch SIGHUP
echo -n "Reload service rsync"
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for rsync daemon: "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
# NOTE: checkproc returns LSB compliant status values.
checkproc -p $RSYNCD_PID $RSYNCD_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit

1
rsyncd.secrets Normal file
View File

@ -0,0 +1 @@
# user:passwd

22
rsyncd.service Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=Start the rsync server daemon
After=network.target
ConditionPathExists=/etc/rsyncd.conf
[Service]
ExecStart=/usr/sbin/rsyncd --daemon --no-detach
IOSchedulingClass=idle
CPUSchedulingPolicy=batch
PrivateTmp=true
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectHostname=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
[Install]
WantedBy=multi-user.target

10
rsyncd.socket Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=Rsync Server Socket
Conflicts=rsyncd.service
[Socket]
ListenStream=873
Accept=yes
[Install]
WantedBy=sockets.target

11
rsyncd@.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Start the rsync server daemon
After=network.target
ConditionPathExists=/etc/rsyncd.conf
[Service]
ExecStart=/usr/sbin/rsyncd --daemon --no-detach
IOSchedulingClass=idle
CPUSchedulingPolicy=batch
PrivateTmp=true
StandardInput=socket