Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 234278 - vsftpd refuses to restart: (probably) bad init script
Summary: vsftpd refuses to restart: (probably) bad init script
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-08 22:49 UTC by Michael Perlov
Modified: 2008-12-26 16:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixed vsftpd init script (vsftpd,1.88 KB, text/plain)
2008-08-23 12:29 UTC, Steffen 'j0inty' Stollfuß
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Perlov 2008-08-08 22:49:24 UTC
During restart vsftpd daemon isn't killed, thus vsftpd refuses to start

Reproducible: Always

Actual Results:  
# /etc/init.d/vsftpd restart
 * Caching service dependencies ...                                                                                    [ ok ]
 * Stopping vsftpd ...
 * start-stop-daemon: no matching processes found                                                                      [ ok ]
 * Starting vsftpd ...
 * start-stop-daemon: /usr/sbin/vsftpd is already running                                                              [ !! ]
 * ERROR: vsftpd failed to start

Expected Results:  
# /etc/init.d/vsftpd restart
 * Stopping vsftpd ...                                                                                                 [ ok ]
 * Starting vsftpd ...                                                                                                 [ ok ]

After changing stop() function in /etc/init.d/vsftpd to

stop() {
 ebegin "Stopping ${SVCNAME}"
 start-stop-daemon --stop --exec /usr/sbin/vsftpd \
 --pidfile "${VSFTPD_PID}" \
 -- "${VSFTPD_CONF}"
 eend $?
}

it restarts properly.
Comment 1 Steffen 'j0inty' Stollfuß 2008-08-23 12:29:58 UTC
Created attachment 163613 [details]
Fixed vsftpd init script

[test]
arko j0inty # vi /etc/init.d/vsftpd
arko j0inty # /etc/init.d/vsftpd start
 * Caching service dependencies ...
 *  Service 'metalog' already provides 'logger'!;
 *  Not adding service 'syslog-ng'...                                                                                                 [ ok ]
 * Starting vsftpd ...                                                                                                                [ ok ]
arko j0inty # /etc/init.d/vsftpd restart
 * Stopping vsftpd ...                                                                                                                [ ok ]
 * Starting vsftpd ...                                                                                                                [ ok ]
arko j0inty # /etc/init.d/vsftpd stop
 * Stopping vsftpd ...                                                                                                                [ ok ]
arko j0inty # /etc/init.d/vsftpd start
 * Starting vsftpd ...                                                                                                                [ ok ]
arko j0inty # rm -vf /var/run/vsftpd.pid
„/var/run/vsftpd.pid“ entfernt
arko j0inty # /etc/init.d/vsftpd restart
 * Stopping vsftpd ...
 * Couldn't found /var/run/vsftpd.pid trying to stop over the process name vsftpd                                                     [ ok ]
 * Starting vsftpd ...                                                                                                                [ ok ]
arko j0inty #
Comment 2 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2008-09-06 06:17:32 UTC
Works for me as of vsftpd-2.0.6 and baselayout-1.12.11.1. I also have this in /etc/init.d/vsftpd:

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --exec /usr/sbin/vsftpd \
                --pidfile "${VSFTPD_PID}"
        eend $?
}
Comment 3 Jonas Jonsson 2008-09-12 18:49:13 UTC
(In reply to comment #2)
It seems that vsftpd-2.0.7 has a wrong stop command, it's not like the one you pasted. It was missing the --pidfile part which was a huge problem with more then one vsftpd instance.

> Works for me as of vsftpd-2.0.6 and baselayout-1.12.11.1. I also have this in
> /etc/init.d/vsftpd:
> 
> stop() {
>         ebegin "Stopping ${SVCNAME}"
>         start-stop-daemon --stop --exec /usr/sbin/vsftpd \
>                 --pidfile "${VSFTPD_PID}"
>         eend $?
> }
> 

Comment 4 Raúl Porcel (RETIRED) gentoo-dev 2008-12-26 16:56:15 UTC
Fixed on -r1, thanks for the script.