LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-07-2016, 01:26 PM   #1
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
proftpd where is the rc. file to make it executable?


OK I found a proftpd.conf file in /etc/ But where is the start the daemon rc file in rc.d so I can start it up and see if I did this right???

Code:
userx@SlackO/etc/rc.d>> ls
init.d        rc.consolekit    rc.mcelog          rc.syslog
rc.0          rc.cpufreq       rc.messagebus      rc.sysstat
rc.4          rc.cups          rc.modules         rc.sysvinit
rc.6          rc.cups-browsed  rc.modules.local   rc.udev
rc.K          rc.dnsmasq       rc.mysqld          rc.ulogd
rc.M          rc.font          rc.networkmanager  rc.wireless
rc.S          rc.fuse          rc.nfsd            rc.wireless.conf
rc.acpid      rc.gpm           rc.ntpd            rc.yp
rc.alsa       rc.httpd         rc.pcmcia          rc0.d
rc.alsa-oss   rc.inet1         rc.php-fpm         rc1.d
rc.atalk      rc.inet1.conf    rc.pulseaudio      rc2.d
rc.autofs     rc.inet2         rc.rpc             rc3.d
rc.bind       rc.inetd         rc.samba           rc4.d
rc.bluetooth  rc.ip_forward    rc.saslauthd       rc5.d
rc.cgconfig   rc.keymap        rc.sendmail        rc6.d
rc.cgmanager  rc.local         rc.serial
rc.cgproxy    rc.loop          rc.snmpd
rc.cgred      rc.lxc           rc.sshd
I don't see anything in there referring to ftp anything.

thanks
 
Old 12-07-2016, 01:43 PM   #2
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Roll Your Own

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.
 
Old 12-07-2016, 01:55 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Just start /etc/rc.d/rc.inetd and uncomment the second line below in /etc/inetd.conf:
Code:
# Professional File Transfer Protocol (FTP) server.
#ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  proftpd
inetd is a super-daemon that can start a lot of services, among which this one.

Last edited by Didier Spaier; 12-07-2016 at 01:58 PM.
 
4 members found this post helpful.
Old 12-07-2016, 02:00 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by TracyTiger View Post
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
I think I got everything.
 
Old 12-07-2016, 02:05 PM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Didier Spaier View Post
Just start /etc/rc.d/rc.inetd and uncomment the second line below in /etc/inetd.conf:
Code:
# Professional File Transfer Protocol (FTP) server.
#ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  proftpd
inetd is a super-daemon that can start a lot of services, among which this one.
what????
thanks I'd of never thought ... giving it a shot right now.
 
Old 12-07-2016, 02:05 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Maybe you didn't see my answer before posting your last message? There's no need for a specific daemon, just make rc.inetd executable.

EDIT. Seems you read it after having posted. No worries

Last edited by Didier Spaier; 12-07-2016 at 02:07 PM.
 
Old 12-07-2016, 02:09 PM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
OK I got it working now thanks @Didier Spaier @TracyTiger
 
Old 12-07-2016, 02:17 PM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
... However, see the note about DoS attacks in proftpd.conf

If you need it, xinetd is available @ https://slackbuilds.org/

Last edited by Didier Spaier; 12-07-2016 at 02:23 PM. Reason: Second line added.
 
Old 12-07-2016, 02:24 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Didier Spaier View Post
... However, see the note about DoS attacks in proftpd.conf

If you need it, xinetd is available @ https://slackbuilds.org/
that slack is a virtual play toy, but it'd be interesting to play with I suppose, thanks.
 
Old 12-07-2016, 02:44 PM   #10
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Example

@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.
 
1 members found this post helpful.
Old 12-07-2016, 02:54 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by TracyTiger View Post
@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.
Thanks ....
 
Old 12-08-2016, 03:19 AM   #12
franzen
Member
 
Registered: Nov 2012
Distribution: slackware
Posts: 535

Rep: Reputation: 379Reputation: 379Reputation: 379Reputation: 379
Quote:
Originally Posted by Didier Spaier View Post
... However, see the note about DoS attacks in proftpd.conf

If you need it, xinetd is available @ https://slackbuilds.org/
It should also work with inetd to limit DoS attacks, see https://www.freebsd.org/doc/handbook/network-inetd.html
example:
Code:
ftp     stream  tcp     nowait/10/20/5  root    /usr/sbin/tcpd  proftpd
 
1 members found this post helpful.
Old 12-08-2016, 07:25 AM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by franzen View Post
It should also work with inetd to limit DoS attacks, see https://www.freebsd.org/doc/handbook/network-inetd.html
example:
Code:
ftp     stream  tcp     nowait/10/20/5  root    /usr/sbin/tcpd  proftpd
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?

So I just left it alone for the moment.
 
  


Reply

Tags
ftpd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] NTFS permission problem, can not make file executable will_kranz Linux - General 6 03-17-2014 04:43 PM
Make a file executable and then run mostafaashish Linux - Newbie 7 02-20-2014 05:34 AM
[SOLVED] How to make a bin file an executable? MWH Linux - Software 6 03-14-2010 10:11 AM
how to make any file executable kratosal Linux - Newbie 8 04-08-2008 03:50 AM
Make newly created file executable Black Chaos Linux - General 3 08-03-2006 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration