diff --git a/vsftpd.changes b/vsftpd.changes index 9d9b568..0c76255 100644 --- a/vsftpd.changes +++ b/vsftpd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 21 11:14:59 UTC 2015 - joop.boonen@opensuse.org + +- Brought back additional systemv support so it also builds for SLES 10 and 11 + ------------------------------------------------------------------- Tue Sep 8 10:57:55 UTC 2015 - tchvatal@suse.com diff --git a/vsftpd.init b/vsftpd.init new file mode 100644 index 0000000..7c25dca --- /dev/null +++ b/vsftpd.init @@ -0,0 +1,107 @@ +#! /bin/sh +# Copyright (c) 1995-2005 SUSE Linux GmbH, Nuernberg, Germany. +# All rights reserved. +# +# Author: Mads Martin Joergensen +# +# /etc/init.d/vsftpd +# and its symbolic link +# /usr/sbin/rcvsftpd +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +### BEGIN INIT INFO +# Provides: ftpd +# Required-Start: $local_fs $remote_fs $syslog network-remotefs +# Required-Stop: $local_fs $remote_fs $syslog network-remotefs +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Description: very secure ftp daemon +# Short-Description: very secure ftp daemon +### END INIT INFO +# Note on runlevels: +# 0 - halt/poweroff 6 - reboot +# 1 - single user 2 - multiuser without network exported +# 3 - multiuser w/ network (text mode) 5 - multiuser w/ network and X11 (xdm) +# +# Note on script names: +# http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/scrptnames.html +# A registry has been set up to manage the init script namespace. +# http://www.lanana.org/ +# Please use the names already registered or register one or use a +# vendor prefix. + +VSFTPD_BIN=/usr/sbin/vsftpd +test -x $VSFTPD_BIN || { echo "$VSFTPD_BIN not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + +. /etc/rc.status + +rc_reset + +case "$1" in + start) + echo -n "Starting vsftpd " + /sbin/startproc -l /var/log/rcvsftp.log $VSFTPD_BIN + rc_status -v + ;; + stop) + echo -n "Shutting down vsftpd " + /sbin/killproc -TERM $VSFTPD_BIN + rc_status -v + ;; + try-restart|condrestart) + ## Do a restart only if the service was active before. + ## Note: try-restart is now part of LSB (as of 1.9). + ## RH has a similar command named condrestart. + if test "$1" = "condrestart"; then + echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" + fi + $0 status + if test $? = 0; then + $0 restart + else + rc_reset # Not running is not a failure. + fi + + rc_status + ;; + restart) + $0 stop + $0 start + rc_status + ;; + force-reload) + echo -n "Reload service vsftpd " + /sbin/killproc -HUP $VSFTPD_BIN + rc_status -v + ;; + reload) + echo -n "Reload service vsftpd " + /sbin/killproc -HUP $VSFTPD_BIN + rc_status -v + ;; + status) + echo -n "Checking for service vsftpd " + /sbin/checkproc $VSFTPD_BIN + rc_status -v + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" + exit 1 + ;; +esac +rc_exit diff --git a/vsftpd.spec b/vsftpd.spec index ccebff0..ba208bd 100644 --- a/vsftpd.spec +++ b/vsftpd.spec @@ -16,6 +16,14 @@ # +%if 0%{?suse_version} < 1210 +%global with_sysvinit 1 +%global with_systemd 0 +%else +%global with_sysvinit 0 +%global with_systemd 1 +%endif + Name: vsftpd Version: 3.0.3 Release: 0 @@ -26,6 +34,7 @@ Url: https://security.appspot.com/vsftpd.html Source0: https://security.appspot.com/downloads/%{name}-%{version}.tar.gz Source1: %{name}.pam Source2: %{name}.logrotate +Source3: %{name}.init Source4: README.SUSE Source5: %{name}.xml Source6: %{name}.firewall @@ -64,12 +73,16 @@ Patch22: vsftpd-path-normalize.patch BuildRequires: libcap-devel BuildRequires: openssl-devel BuildRequires: pam-devel +%if %{with_systemd} BuildRequires: systemd +%endif Requires: logrotate Requires(pre): %{_sbindir}/useradd Provides: ftp-server BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if %{with_systemd} %{?systemd_requires} +%endif %description Vsftpd is an FTP server, or daemon. The "vs" stands for Very Secure. @@ -121,10 +134,16 @@ install -D -m 644 $RPM_SOURCE_DIR/%{name}.pam %{buildroot}%{_sysconfdir}/pam.d/% install -D -m 644 $RPM_SOURCE_DIR/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} install -D -m 644 %{name}.conf.5 %{buildroot}/%{_mandir}/man5/%{name}.conf.5 install -D -m 644 %{name}.8 %{buildroot}/%{_mandir}/man8/%{name}.8 +%if %{with_sysvinit} +install -D -m 755 %SOURCE3 %{buildroot}/etc/init.d/%{name} +ln -sf ../../etc/init.d/%{name} %{buildroot}/%_prefix/sbin/rc%{name} +%endif +%if %{with_systemd} ln -sf service %{buildroot}/%{_sbindir}/rc%{name} install -D -m 0644 %{SOURCE7} %{buildroot}/%{_unitdir}/%{name}.service install -D -m 0644 %{SOURCE8} %{buildroot}/%{_unitdir}/%{name}@.service install -D -m 0644 %{SOURCE10} %{buildroot}/%{_unitdir}/%{name}.socket +%endif install -d %{buildroot}/%{_datadir}/omc/svcinfo.d/ install -D -m 644 %{SOURCE5} %{buildroot}/%{_datadir}/omc/svcinfo.d/ install -d %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ @@ -132,24 +151,51 @@ install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/s %pre %{_sbindir}/useradd -r -g nogroup -s /bin/false -c "Secure FTP User" -d %{_localstatedir}/lib/empty ftpsecure 2> /dev/null || : +%if %{with_systemd} %service_add_pre %{name}.service %{name}@.service %{name}.socket +%endif %preun +if [ -e /etc/init.d/%{name} ]; then +%stop_on_removal %{name} +fi + +%if %{with_systemd} %service_del_preun %{name}.service %{name}@.service %{name}.socket +%endif %post +%if %{with_sysvinit} +%insserv_cleanup +%restart_on_update %{name} +%endif + +%if %{with_systemd} %service_add_post %{name}.service %{name}@.service %{name}.socket +%endif %postun +%if %{with_sysvinit} +%insserv_cleanup +%restart_on_update %{name} +%endif + +%if %{with_systemd} %service_del_postun %{name}.service %{name}@.service %{name}.socket +%endif %files %defattr(-,root,root) +%if %{with_systemd} %{_unitdir}/%{name}.service %{_unitdir}/%{name}.socket %{_unitdir}/%{name}@.service +%endif %{_sbindir}/%{name} %{_sbindir}/rc%{name} +%if %{with_sysvinit} +%config /etc/init.d/%{name} +%endif %{_datadir}/omc/svcinfo.d/vsftpd.xml %dir %{_datadir}/empty %config(noreplace) %{_sysconfdir}/xinetd.d/%{name}