Bug 206843 - vsftpd is checked wrongly in init script
vsftpd is checked wrongly in init script
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: vsftpd (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Nagy
: Patch
Depends On:
  Show dependency treegraph
Reported: 2006-09-17 03:21 EDT by Milan Kerslager
Modified: 2016-07-26 19:46 EDT (History)
6 users (show)

See Also:
Fixed In Version: RHSA-2008-0680
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-07-24 15:34:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch of Init script (758 bytes, patch)
2007-08-21 06:36 EDT, Maros Barabas
no flags Details | Diff
Patch to disable the background option and behave like it was set to YES (1.06 KB, patch)
2008-02-04 09:01 EST, Martin Nagy
no flags Details | Diff
Patch to add option --force-background (3.75 KB, patch)
2008-02-07 17:48 EST, Martin Nagy
no flags Details | Diff
Patch for the initscript (943 bytes, text/x-patch)
2008-02-07 17:51 EST, Martin Nagy
no flags Details

  None (edit)
Description Milan Kerslager 2006-09-17 03:21:58 EDT
Because /etc/init.d/vsftpd use "&" when launching daemon, RETVAL=$? does not
work and always returns success even daemon does not start (missing RSA key file).
Also error message is not sent to the log.

To reproduce, place "ssl_enable=YES" to /etc/vsftpd/vsftpd.conf and do not
generate vsftpd.pem in /usr/share/ssl/certs. Try run vsftpd by init script. Even
OK, daemon does not run. Run "vsftpd /etc/vsftpd/vsftpd.conf! to see error message:
500 OOPS: SSL: cannot load RSA key

There should be RETVAL=$! (most recently executed background command) and check
if the daemon is running after a while. Check /etc/init.d/opensmd from opensm
package how to check it.
Comment 1 Maros Barabas 2007-02-06 09:32:16 EST
Hi Milan,
     waiting at least one second to check if server is still running is very
ugly solution. 

I think

- /usr/sbin/vsftpd $i &
+ daemon /usr/sbin/vsftpd $i

 could be much better solution
Comment 2 Milan Kerslager 2007-02-06 09:59:52 EST
If this could provide desired solution, use it please.
Comment 8 hajma 2007-03-16 20:11:26 EDT
(In reply to comment #1)
> - /usr/sbin/vsftpd $i &
> + daemon /usr/sbin/vsftpd $i
>  could be much better solution

but this causes the init script to hang :-(
Comment 9 RHEL Product and Program Management 2007-05-09 05:36:56 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 10 Maros Barabas 2007-08-21 06:36:00 EDT
Created attachment 161959 [details]
Patch of Init script

Please try this patch .. tested on RHEL-4.5 with vsftpd-2.0.1-5.EL4.5
Comment 13 Issue Tracker 2007-08-24 06:27:48 EDT
Thank you, it works (RHEL 4, vsftpd-2.0.1-5.EL4.5) if:

- I set "background=YES" in "/etc/vsftpd/vsftpd.conf" (the default in
RHEL 4 is "NO")
- I apply to "/etc/rc.d/init.d/vsftpd" the patch as per comment #10

Should we then consider those changes for future RHEL 4s?

Thanks, Leonardo.

This event sent from IssueTracker by lmacchia 
 issue 114096
Comment 14 Maros Barabas 2007-08-25 17:24:48 EDT
This patch (including default "background=YES" behaviour) should be in next
update for RHEL4. Thanks.
Comment 19 Martin Nagy 2008-02-04 09:01:25 EST
Created attachment 293886 [details]
Patch to disable the background option and behave like it was set to YES

In my opinion, we shouldn't push in a patch that could cause that vsftpd won't
start if a specific configuration is used (background=NO). I propose to use
this patch along with Maros' so that the background option is silently ignored
and the behavior is same as if the background option was set to YES. Any
Comment 20 Martin Nagy 2008-02-07 17:48:26 EST
Created attachment 294282 [details]
Patch to add option --force-background

This patch adds the option --force-background that when used will enforce
Comment 21 Martin Nagy 2008-02-07 17:51:44 EST
Created attachment 294283 [details]
Patch for the initscript

This will fix the problem using the --force-background option from the previous
Comment 22 Martin Nagy 2008-02-08 05:50:39 EST
Fix checked in CVS and the new packages were built successfully. This issue
should be resolved in vsftpd-2.0.1-6.el4
Comment 26 errata-xmlrpc 2008-07-24 15:34:47 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.