[-]
[+]
|
Changed |
project.diff
|
@@ -8,13 +8,11 @@
Source4: README.SUSE
Source5: %{name}.xml
Source6: %{name}.firewall
-@@ -56,11 +57,18 @@ Patch15: vsftpd-enable-dev-log-se
+@@ -56,11 +57,16 @@ Patch15: vsftpd-enable-dev-log-se
Patch16: vsftpd-root-squashed-chroot.patch
#PATCH-FIX-UPSTREAM: bnc#870122
Patch17: vsftpd-enable-gettimeofday-sec.patch
+
-+Patch50: vsftpd-3.0.2-pidfile.patch
-+
+%if 0%{?suse_version} >= 1230
BuildRequires: gpg-offline
+%endif
@@ -27,7 +25,7 @@
Requires: logrotate
Requires(pre): %{_sbindir}/useradd
Provides: ftp-server
-@@ -79,7 +87,9 @@ vsftpd was always faster, supporting ove
+@@ -79,7 +85,9 @@ vsftpd was always faster, supporting ove
tests.
%prep
@@ -37,16 +35,7 @@
%setup -q
%patch1
%patch3 -p1
-@@ -98,6 +108,8 @@ tests.
- %patch16 -p1
- %patch17 -p1
-
-+%patch50 -p0
-+
- %build
- %define seccomp_opts -D_GNU_SOURCE -DUSE_SECCOMP
- rm -f dummyinc/sys/capability.h
-@@ -114,10 +126,15 @@ install -D -m 644 $RPM_SOURCE_DIR/%{name
+@@ -114,10 +122,15 @@ install -D -m 644 $RPM_SOURCE_DIR/%{name
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
@@ -62,7 +51,7 @@
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/
-@@ -125,22 +142,41 @@ install -m 644 %{SOURCE6} %{buildroot}%{
+@@ -125,22 +138,41 @@ install -m 644 %{SOURCE6} %{buildroot}%{
%pre
%{_sbindir}/useradd -r -g nogroup -s /bin/false -c "Secure FTP User" -d %{_localstatedir}/lib/empty ftpsecure 2> /dev/null || :
|
[-]
[+]
|
Deleted |
vsftpd-3.0.2-pidfile.patch
^
|
@@ -1,33 +0,0 @@
---- main.c.orig 2012-09-16 06:27:13.000000000 +0200
-+++ main.c 2014-08-27 18:08:44.355514485 +0200
-@@ -5,6 +5,10 @@
- * main.c
- */
-
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <syslog.h>
-+
- #include "session.h"
- #include "utility.h"
- #include "tunables.h"
-@@ -243,6 +247,19 @@
- tunable_chown_uploads = 0;
- }
- }
-+ pid_t pid;
-+ FILE *pidf;
-+ pid = getpid();
-+ if (pid > 0) {
-+ pidf = fopen ("/var/run/vsftpd/vsftpd.pid", "w");
-+ if (!pidf) {
-+ openlog("vsftpd", LOG_PID, LOG_DAEMON);
-+ syslog(LOG_ERR, "Can't write PID %d to /var/run/vsftpd/vsftpd.pid", (int)pid);
-+ } else {
-+ fprintf(pidf, "%d\n", (int)pid);
-+ fclose(pidf);
-+ }
-+ }
- if (tunable_one_process_model)
- {
- vsf_one_process_start(&the_session);
|
[-]
[+]
|
Changed |
_link
^
|
@@ -1,5 +1,6 @@
<link project="openSUSE.org:network" package="vsftpd" baserev="76bd9ba69cf406554124d31ebe05afc0">
<patches>
+ <delete name="vsftpd-3.0.2-pidfile.patch" />
<apply name="project.diff" />
</patches>
</link>
|
[-]
[+]
|
Changed |
vsftpd.init
^
|
@@ -55,15 +55,36 @@
mkdir -p /var/run/vsftpd
chown ftpsecure:nogroup /var/run/vsftpd || :
+function writePidFile() {
+ echo ${2} > /var/run/vsftpd/${1}.pid
+}
+
+function getPidFromConf() {
+ if [ "${1}" == "" ] ; then
+ conf="/etc/vsftpd.conf"
+ else
+ conf="${1}"
+ fi
+ for PID in `pidof vsftpd` ; do
+ if [ -n "`grep ${conf} /proc/${PID}/cmdline`" ] ; then
+ RPID="${PID}"
+ break;
+ fi
+ done
+ confname=`basename $conf .conf`
+ writePidFile $confname $RPID
+}
+
case "$1" in
start)
echo -n "Starting vsftpd "
- /sbin/startproc -l /var/log/rcvsftp.log $VSFTPD_BIN
+ /sbin/startproc -l /var/log/rcvsftp.log $VSFTPD_BIN $VSFTPD_CONF
+ getPidFromConf $VSFTPD_CONF
rc_status -v
;;
stop)
echo -n "Shutting down vsftpd "
- /sbin/killproc -TERM $VSFTPD_BIN
+ /sbin/killproc -p /var/run/vsftpd/vsftpd.pid -TERM $VSFTPD_BIN
rc_status -v
;;
try-restart|condrestart)
@@ -89,17 +110,17 @@
;;
force-reload)
echo -n "Reload service vsftpd "
- /sbin/killproc -HUP $VSFTPD_BIN
+ /sbin/killproc -p /var/run/vsftpd/vsftpd.pid -HUP $VSFTPD_BIN
rc_status -v
;;
reload)
echo -n "Reload service vsftpd "
- /sbin/killproc -HUP $VSFTPD_BIN
+ /sbin/killproc -p /var/run/vsftpd/vsftpd.pid -HUP $VSFTPD_BIN
rc_status -v
;;
status)
echo -n "Checking for service vsftpd "
- /sbin/checkproc $VSFTPD_BIN
+ /sbin/checkproc -p /var/run/vsftpd/vsftpd.pid $VSFTPD_BIN
rc_status -v
;;
*)
|