path: root/tests/testserver/vsftpd
diff options
authorRyan Chu <>2019-01-09 00:19:10 +0100
committerRyan Chu <>2019-01-16 18:24:01 +0000
commitfe29a6a6ebbf28505df7cdf1de24fa540fd3745e (patch)
treed97e5b945ae8e243094075af651f6847327fdda4 /tests/testserver/vsftpd
parent2c875efa999527b5d1419ea06d786b0a462c7133 (diff)
Fix the timing issue of vsftpd during boot (probably invalid config)
This appears to be a timing issue of vsftpd's initial script (/etc/init.d/vsftpd). When starting the vsftpd service, the script uses a while loop to make sure that the vsftpd process has been created with the expected PID. The problem is that it should sleep if it can't grep the same PID via ps command. while [ ${n} -le 5 ] do _PID="$(if [ -e ]; then cat; fi)" if ! ps -C vsftpd | grep -qs "${_PID}" then break fi sleep 1 n=$(( $n + 1 )) done if ! ps -C vsftpd | grep -qs "${_PID}" then log_warning_msg "vsftpd failed - probably invalid config." exit 1 fi However, synchronization based on time is not working in general. This change will rewrite the while loop to an infinite loop and remove the exclamation symbol (!) from the if condition. Upgrading the version of vsftpd is not helpful here because vsftpd_3.0.3-11 (Ubuntu 18.10) didn't resolve it yet. Change-Id: I07382709c33bd9bab61fcea76ab7deca5f630084 Reviewed-by: Jędrzej Nowacki <> Reviewed-by: Edward Welbourne <>
Diffstat (limited to 'tests/testserver/vsftpd')
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/testserver/vsftpd/ b/tests/testserver/vsftpd/
index 845c576534..14364f94c2 100755
--- a/tests/testserver/vsftpd/
+++ b/tests/testserver/vsftpd/
@@ -41,9 +41,10 @@ useradd -d "/home/$USER/ftp" -s /bin/bash ftptest; echo "ftptest:$PASS" | chpass
cp $TESTDATA/vsftpd.{conf,user_list} /etc/
# Resolve error message "vsftpd failed - probably invalid config" during boot
-command='start-stop-daemon --start --background -m --oknodo --pidfile /var/run/vsftpd/'
-command+=' --exec ${DAEMON}'
-sed -i "s,$command.*$,$command; sleep 10," /etc/init.d/vsftpd
+# This bug has been reported to Debian bug tracking system (ID #911396)
+command='ps -C vsftpd | grep -qs "${_PID}"'
+sed -i -e 's,while [ ${n} -le 5 ].*$,while true,' \
+ -e "s,\t\t\tif ! $command.*$,\t\t\tif $command," /etc/init.d/vsftpd
# Populate the FTP sites:
su $USER -c "cp -r $TESTDATA/ftp ~/ftp"