View Full Version : Newbie cry for help!
baldur2630
23rd January 2008, 09:27
I decided to install ProFTPD Admin. To do this, I had to first remove the old rpm version and then download the source and recompile it with MySQL support.
It all worked beautifully, I was very proud of myself, ProFTPD and the admin module is perfect.
So what's the problem?
I can start ProFTPD manually. I tried to use chkconfig to add it to the services and it says operation not supported..
How do I add ProFTPD standalone to the Services so it starts when the box is booted and I can stop and restart it? It's a Fedora 8 Server
topdog
23rd January 2008, 09:36
You need to install and init script for it, then chkconfig will work. Am sure that the init script from your old rpm should work unless the paths for the compiled version are different but am sure you can fix that.
baldur2630
23rd January 2008, 10:17
I created the following script and put it into /etc/init.d but that doesn't seem to work. What am I missing?
#!/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
topdog
23rd January 2008, 10:30
I have modified it to work with chkconfig.
#!/bin/sh
#
#
# proftpd This shell script takes care of starting and stopping
# proftpd.
#
# chkconfig: - 80 30
# description: ProFTPd is an enhanced FTP server with a focus towards
#
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
baldur2630
23rd January 2008, 10:53
OK, it's now showing as a Service BUT...
proftpd: unrecognized service
topdog
23rd January 2008, 10:59
When does that error show up ? Is it when you run
service proftpd start
This is what happens on my side but its simply due to the fact that i dont have proftpd installed in that location.
[root@tdss ~]# chkconfig --level 345 proftpd on
[root@tdss ~]# service proftpd start
/etc/init.d/proftpd: /usr/local/sbin/proftpd: cannot execute
baldur2630
24th January 2008, 16:31
I did chkconfig --level 345 proftpd on and then went to the Service Panel and that is what is showing.
If I click restart or stop or start, nothing changes. I haven't tried service proftpd stop or start, because it was (is) in use and I didn't want to kick anyone off.
Do you think service proftpd restart from the command line will sort it out?
topdog
24th January 2008, 17:31
Yes test that, am not using ispconfig so i am not able to see what is causing that error.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.