Fixed: #737710 - provide native systemd services

This commit is contained in:
Michal Luscon 2012-11-30 16:54:34 +01:00
parent f534c746bd
commit 3bfee3e3eb
6 changed files with 70 additions and 20 deletions

View File

@ -7,15 +7,21 @@
Summary: A program for synchronizing files over a network
Name: rsync
Version: 3.0.9
Release: 5%{?prerelease}%{?dist}
Release: 6%{?prerelease}%{?dist}
Group: Applications/Internet
URL: http://rsync.samba.org/
Source0: ftp://rsync.samba.org/pub/rsync/rsync-%{version}%{?prerelease}.tar.gz
Source1: ftp://rsync.samba.org/pub/rsync/rsync-patches-%{version}%{?prerelease}.tar.gz
Source2: rsync.xinetd
Source2: rsyncd.socket
Source3: rsyncd.service
Source4: rsyncd.conf
Source5: rsyncd.sysconfig
BuildRequires: libacl-devel, libattr-devel, autoconf, popt-devel, zlib-devel
Requires: zlib
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
License: GPLv3+
Patch0: rsync-3.0.10-lose-track.patch
@ -65,8 +71,11 @@ make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
rm -rf $RPM_BUILD_ROOT
%makeinstall INSTALLCMD='install -p' INSTALLMAN='install -p'
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/%{name}
install -D -m644 %{SOURCE3} $RPM_BUILD_ROOT/%{_unitdir}/rsyncd.service
install -D -m644 %{SOURCE2} $RPM_BUILD_ROOT/%{_unitdir}/rsyncd.socket
install -D -m644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/rsyncd.conf
install -D -m644 %{SOURCE5} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/rsyncd
%clean
rm -rf $RPM_BUILD_ROOT
@ -74,12 +83,27 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc COPYING NEWS OLDNEWS README support/ tech_report.tex
%config(noreplace) %{_sysconfdir}/xinetd.d/%{name}
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%{_mandir}/man5/rsyncd.conf.5*
%config(noreplace) %{_sysconfdir}/rsyncd.conf
%config(noreplace) %{_sysconfdir}/sysconfig/rsyncd
%{_unitdir}/rsyncd.socket
%{_unitdir}/rsyncd.service
%post
%systemd_post rsyncd.service
%preun
%systemd_preun rsyncd.service
%postun
%systemd_postun_with_restart rsyncd.service
%changelog
* Thu Nov 15 2012 Michal Luscon <mluscon@redhat.com> 3.0.9-6
- Systemd units for rsync
* Tue Oct 23 2012 Michal Luscon <mluscon@redhat.com> 3.0.9-5
- Reverted: #495310 - rsync contains forked copy of zlib

View File

@ -1,14 +0,0 @@
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = yes
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}

20
rsyncd.conf Normal file
View File

@ -0,0 +1,20 @@
# /etc/rsyncd: configuration file for rsync daemon mode
# See rsyncd.conf man page for more options.
# configuration examlple:
# uid = nobody
# gid = nobody
# use chroot = yes
# max connections = 4
# pid file = /var/run/rsyncd.pid
# exclude = lost+found/
# transfer logging = yes
# timeout = 900
# ignore nonreadable = yes
# dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
# [ftp]
# path = /home/ftp
# comment = ftp export area

9
rsyncd.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=fast remote file copy program daemon
ConditionPathExists=/etc/rsyncd.conf
[Service]
ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS"
[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

1
rsyncd.sysconfig Normal file
View File

@ -0,0 +1 @@
OPTIONS=""