added systemd unit file, SysV initscript moved to subpackage

This commit is contained in:
Jiri Skala 2011-08-03 16:01:45 +02:00
parent dda064da81
commit 80f6d3e480
3 changed files with 92 additions and 10 deletions

39
vsftpd-2.3.4-sd.patch Normal file
View File

@ -0,0 +1,39 @@
diff -up vsftpd-2.3.4/vsftpd.8.sd vsftpd-2.3.4/vsftpd.8
--- vsftpd-2.3.4/vsftpd.8.sd 2011-08-03 11:02:30.509291451 +0200
+++ vsftpd-2.3.4/vsftpd.8 2011-08-03 15:50:00.024014865 +0200
@@ -25,6 +25,8 @@ in
Direct execution of the
.Nm vsftpd
binary will then launch the FTP service ready for immediate client connections.
+.Pp
+Systemd changes the vsftpd start-up. When the SysV initscript attempts to start one instance of the vsftpd daemon for each of /etc/vsftpd/*.conf file, each configuration file requires a correct symbolic link to the vsftpd@.service file.The name of the symbolic link must contain the name of the configuration file. See systemd.unit(5) for details. Each instance of the vsftpd daemon is started separately. See systemd.unit(5).
.Sh OPTIONS
An optional
configuration file or files
@@ -55,6 +57,11 @@ the "ftpd_banner" setting is set to "bla
setting and any identical setting that was in the config file.
.Sh FILES
.Pa /etc/vsftpd/vsftpd.conf
+.Pp
+.Pa /lib/systemd/system/vsftpd@.conf
+.Pp
+.Pa /lib/systemd/system/vsftpd@vsftpd.conf
.Sh SEE ALSO
.Xr vsftpd.conf 5
+.Xr systemd.unit 5
.end
diff -up vsftpd-2.3.4/vsftpd.conf.5.sd vsftpd-2.3.4/vsftpd.conf.5
--- vsftpd-2.3.4/vsftpd.conf.5.sd 2011-08-03 11:02:37.480372306 +0200
+++ vsftpd-2.3.4/vsftpd.conf.5 2011-08-03 15:50:29.435371891 +0200
@@ -13,6 +13,11 @@ inetd such as
to launch vsftpd with different configuration files on a per virtual host
basis.
+Systemd changes the vsftpd daemon start-up. Each configuration file
+requires a correct symbolic link to the vsftpd@.service file. The name
+of the symbolic link must contain the name of the configuration file.
+See systemd.unit(5) for details.
+
.SH FORMAT
The format of vsftpd.conf is very simple. Each line is either a comment or
a directive. Comment lines start with a # and are ignored. A directive line

View File

@ -2,7 +2,7 @@
Name: vsftpd Name: vsftpd
Version: 2.3.4 Version: 2.3.4
Release: 4%{?dist} Release: 5%{?dist}
Summary: Very Secure Ftp Daemon Summary: Very Secure Ftp Daemon
Group: System Environment/Daemons Group: System Environment/Daemons
@ -16,6 +16,7 @@ Source3: vsftpd.ftpusers
Source4: vsftpd.user_list Source4: vsftpd.user_list
Source5: vsftpd.init Source5: vsftpd.init
Source6: vsftpd_conf_migrate.sh Source6: vsftpd_conf_migrate.sh
Source7: vsftpd@.service
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -28,7 +29,6 @@ BuildRequires: tcp_wrappers-devel
Requires: logrotate Requires: logrotate
Requires (preun): /sbin/chkconfig Requires (preun): /sbin/chkconfig
Requires (preun): /sbin/service
Requires (post): /sbin/chkconfig Requires (post): /sbin/chkconfig
# Build patches # Build patches
@ -53,11 +53,21 @@ Patch14: vsftpd-2.2.0-wildchar.patch
Patch16: vsftpd-2.2.2-clone.patch Patch16: vsftpd-2.2.2-clone.patch
Patch17: vsftpd-2.2.2-v6only.patch Patch17: vsftpd-2.2.2-v6only.patch
Patch18: vsftpd-2.3.4-tout.patch Patch18: vsftpd-2.3.4-tout.patch
Patch19: vsftpd-2.3.4-sd.patch
%description %description
vsftpd is a Very Secure FTP daemon. It was written completely from vsftpd is a Very Secure FTP daemon. It was written completely from
scratch. scratch.
%package sysvinit
Group: System Environment/Daemons
Summary: SysV initscript for vsftpd daemon
Requires: %{name} = %{version}-%{release}
Requires(preun): /sbin/service
Requires(postun): /sbin/service
%description sysvinit
The vsftpd-sysvinit contains SysV initscritps support.
%prep %prep
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
@ -80,6 +90,7 @@ cp %{SOURCE1} .
%patch16 -p1 -b .clone %patch16 -p1 -b .clone
%patch17 -p1 -b .v6only %patch17 -p1 -b .v6only
%patch18 -p1 -b .tout %patch18 -p1 -b .tout
%patch19 -p1 -b .sd
%build %build
%ifarch s390x sparcv9 sparc64 %ifarch s390x sparcv9 sparc64
@ -96,6 +107,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sbindir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{vsftpd,pam.d,logrotate.d,rc.d/init.d} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{vsftpd,pam.d,logrotate.d,rc.d/init.d}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man{5,8} mkdir -p $RPM_BUILD_ROOT%{_mandir}/man{5,8}
mkdir -p $RPM_BUILD_ROOT/lib/systemd/system
install -m 755 vsftpd $RPM_BUILD_ROOT%{_sbindir}/vsftpd install -m 755 vsftpd $RPM_BUILD_ROOT%{_sbindir}/vsftpd
install -m 600 vsftpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/vsftpd/vsftpd.conf install -m 600 vsftpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/vsftpd/vsftpd.conf
install -m 644 vsftpd.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/ install -m 644 vsftpd.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/
@ -106,29 +118,38 @@ install -m 600 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/vsftpd/ftpusers
install -m 600 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/vsftpd/user_list install -m 600 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/vsftpd/user_list
install -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/vsftpd install -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/vsftpd
install -m 744 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/vsftpd/vsftpd_conf_migrate.sh install -m 744 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/vsftpd/vsftpd_conf_migrate.sh
install -m 644 %{SOURCE7} $RPM_BUILD_ROOT/lib/systemd/system/
ln -s /lib/systemd/system/vsftpd@.service $RPM_BUILD_ROOT/lib/systemd/system/vsftpd@vsftpd.service
mkdir -p $RPM_BUILD_ROOT/%{_var}/ftp/pub mkdir -p $RPM_BUILD_ROOT/%{_var}/ftp/pub
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%post %post
/sbin/chkconfig --add vsftpd /bin/systemctl daemon-reload >/dev/null 2>&1 || :
%preun %preun
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
/sbin/service vsftpd stop > /dev/null 2>&1 /bin/systemctl disable vsftpd@vsftpd.service > /dev/null 2>&1 || :
/sbin/chkconfig --del vsftpd /bin/systemctl stop vsftpd@vsftpd.service > /dev/null 2>&1 || :
fi fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%triggerun -- %{name} < 2.3.4-5
/sbin/chkconfig --del vsftpd >/dev/null 2>&1 || :
/bin/systemctl try-restart vsftpd@vsftpd.service >/dev/null 2>&1 || :
%triggerpostun -n %{name}-sysvinit -- %{name} < 2.3.4-5
/sbin/chkconfig --add vsftpd >/dev/null 2>&1 || :
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
/lib/systemd/system/vsftpd@.service
/lib/systemd/system/vsftpd@vsftpd.service
%{_sbindir}/vsftpd %{_sbindir}/vsftpd
%{_sysconfdir}/rc.d/init.d/vsftpd
%dir %{_sysconfdir}/vsftpd %dir %{_sysconfdir}/vsftpd
%{_sysconfdir}/vsftpd/vsftpd_conf_migrate.sh %{_sysconfdir}/vsftpd/vsftpd_conf_migrate.sh
%config(noreplace) %{_sysconfdir}/vsftpd/ftpusers %config(noreplace) %{_sysconfdir}/vsftpd/ftpusers
@ -142,8 +163,14 @@ fi
%{_mandir}/man8/vsftpd.* %{_mandir}/man8/vsftpd.*
%{_var}/ftp %{_var}/ftp
%files sysvinit
%{_sysconfdir}/rc.d/init.d/vsftpd
%changelog %changelog
* Wed Aug 03 2011 Jiri Skala <jskala@redhat.com> - 2.3.4-5
- fixes #719434 - Provide native systemd unit file
- moving SysV initscript into subpackage
* Mon Aug 01 2011 Jiri Skala <jskala@redhat.com> - 2.3.4-4 * Mon Aug 01 2011 Jiri Skala <jskala@redhat.com> - 2.3.4-4
- rebuild for libcap - rebuild for libcap

16
vsftpd@.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=Vsftpd ftp daemon
After=syslog.target network.target
[Service]
# Follow the steps below to set up an additional configuration file:
#
# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd2.conf
# ln -s /lib/systemd/system/vsftpd@.service /lib/systemd/system/vsftpd@vsftpd2.service
#
Type=oneshot
ExecStart=/usr/sbin/vsftpd /etc/vsftpd/%i.conf
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target