[SOLVED] proftpd where is the rc. file to make it executable?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running proftpd on a Slackware64 14.1 system from a couple of years ago.
If I recall correctly there was no startup script that came with the package. I just copied another 'rc' script and modified it for proftpd.
Let me know if you want me to get the script and post it here.
ya think I could just take apatche rc.http and mod that and use it?
here is what I'd do to it.
Quote:
#!/bin/sh
#
#
# MODED from RC.HTTP
# /etc/rc.d/rc.proftpd
#
#
# Start/stop/restart/graceful[ly restart]/graceful[ly]-stop
# the proftpd (ftp) server.
#
# To make Apache start automatically at boot, make this
# file executable: chmod 755 /etc/rc.d/rc.proftpd
#
# For information on these options, "man apachectl".
case "$1" in
'start')
/usr/sbin/proftpd -k start
;;
'stop')
/usr/sbin/proftpd -k stop
killall proftpd
# Remove both old and new .pid locations:
rm -f /var/run/proftpd.pid /var/run/proftpd/proftpd.pid
;;
'force-restart')
# Because sometimes restarting through doesn't apply just doesn't do the trick...
/usr/sbin/proftpd -k stop
killall proftpd
# Remove both old and new .pid locations:
rm -f /var/run/proftpd.pid /var/run/proftpd/proftpd.pid
/usr/sbin/proftpd -k start
;;
'restart')
/usr/sbin/proftpd -k restart
;;
'graceful')
/usr/sbin/proftpd -k graceful
;;
'graceful-stop')
/usr/sbin/proftpd -k graceful-stop
;;
*)
echo "Usage: $0 {start|stop|restart|graceful|graceful-stop}"
;;
esac
@BW-userx With the help of Didier Spaier it looks like you have a simple solution. In case you run into other issues (and since I already dug up the files ) I'll share my basic setup.
The contents of rc.proftpd ...
Code:
#!/bin/sh
# Start/stop/restart proftpd
# Called from rc.local
# Copied from rc.ntpd
# Start proftpd:
proftpd_start() {
TZ=":US/Pacific"; export TZ
if [ -x /usr/sbin/proftpd ]; then
CMDLINE="/usr/sbin/proftpd"
echo "----------"
echo "Starting proftpd daemon: $CMDLINE"
$CMDLINE
echo "Wait ..."
sleep 15
proftpd_status
echo "----------"
fi
}
# Stop proftpd:
proftpd_stop() {
if [ -x /usr/sbin/ftpshut ]; then
CMDLINE="/usr/sbin/ftpshut now"
echo "Stopping proftpd connections: $CMDLINE"
$CMDLINE
echo "Wait ..."
sleep 20
if [ -r /var/run/proftpd.pid ]; then
echo "Stopping proftpd daemon."
kill -TERM $(cat /var/run/proftpd.pid)
echo "Wait ..."
sleep 10
proftpd_status
echo "----------"
else
killall -TERM proftpd
echo "Wait ..."
sleep 10
proftpd_status
echo "----------"
fi
if [ -e /etc/shutmsg ]; then
echo "Remove /etc/shutmsg file"
rm /etc/shutmsg
fi
fi
}
# Restart proftpd:
proftpd_restart() {
proftpd_stop
sleep 15
proftpd_start
}
# Check if proftpd is running
proftpd_status() {
if [ -e /var/run/proftpd.pid ]; then
echo -n "proftpd is running as pid "
cat /var/run/proftpd.pid
else
echo "proftpd is not running (no pid)."
# exit 1
fi
}
case "$1" in
'start')
proftpd_start
;;
'stop')
proftpd_stop
;;
'restart')
proftpd_restart
;;
'status')
proftpd_status
;;
*)
echo "usage $0 start|stop|restart|status"
esac
The use of TZ was a fast fix to a timestamp issue in the logs.
Relevant lines from rc.local ...
Code:
# Start proftpd
if [ -x /etc/rc.d/rc.proftpd ]; then
sh /etc/rc.d/rc.proftpd start
fi
Relevant lines from rc.local_shutdown ...
Code:
# Stop proftpd
if [ -x /etc/rc.d/rc.proftpd ]; then
sh /etc/rc.d/rc.proftpd stop
fi
These files work for me. However, starting from inetd may be all you need.
@BW-userx With the help of Didier Spaier it looks like you have a simple solution. In case you run into other issues (and since I already dug up the files ) I'll share my basic setup.
These files work for me. However, starting from inetd may be all you need.
yeah their is a big difference between inetd and Xinetd inside its guts. I opened up xinetd.conf and it was almost empty. the instructions blurp I seen somewhere, could have been on slackBuilds, was to just mv xnetd.conf over top inetd.conf if I remember correctly. Which left it bare, their is no line within xnetd.conf to start up any other service other then itself?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.