3

I'm trying to install the latest version of ProFTPd (1.3.5) onto a CentOS 7 box, and wound up having to configure and install manually. The reason is that EPEL's version of proftpd doesn't include mod_sftp (although it does include mod_tls). This is the output of proftpd -l when EPEL's version is installed:

[root@blah /]# proftpd -l
Compiled-in modules:
  mod_core.c
  mod_xfer.c
  mod_rlimit.c
  mod_auth_unix.c
  mod_auth_file.c
  mod_auth.c
  mod_ls.c
  mod_log.c
  mod_site.c
  mod_delay.c
  mod_facts.c
  mod_dso.c
  mod_ident.c
  mod_readme.c
  mod_auth_pam.c
  mod_tls.c
  mod_memcache.c
  mod_cap.c
  mod_ctrls.c
  mod_lang.c

Using this guy's method where I think he was using CentOS 6, I configured proftpd with the following:

./configure --prefix=/usr --with-includes=/usr/local/ssl/include --with-libraries=/usr/local/ssl/lib --enable-openssl --with-modules=mod_sftp --enable-dso

And then I was able to run make and make install successfully.

The issue is that it doesn't look like it create any systemd scripts:

[root@localhost]# systemctl start proftpd.service
Failed to issue method call: Unit proftpd.service failed to load: No such file or directory.

However, the binary exists, and the system knows about it:

[root@localhost]# which proftpd
/sbin/proftpd

Additionally, there doesn't seem to be any init scripts for this in /etc/init.d nor in /usr/etc/init.d.

When I run the binary stand alone, it stars up just fine.

But I'd like to get some sort of working init or systemd script working for this, so that it'll start on boot (and I'll have an easier time of managing the service).

Any thoughts on how this is done?

[Disclaimer: I posted this same question on Stack Overflow a couple days ago, thinking this was a more programming-centric question, but that hasn't seen any activity, and I think that this is related enough to system administration that its relevant here too]

Castaglia
  • 3,239
  • 3
  • 19
  • 40
David W
  • 3,405
  • 5
  • 34
  • 61
  • 1
    Why are you doing this at all? proftpd is already packaged in EPEL. Stop reinventing wheels. – Michael Hampton Mar 15 '15 at 13:53
  • 1
    Good question... I tried going that route first. But it mod_sftp isn't included in the version EPEL puts out. mod_tls is included, but not mod_sftp. Obviously, mod_sftp would be preferable to security. – David W Mar 15 '15 at 15:23
  • Well, that's odd. I'd file a bug against it in Bugzilla. – Michael Hampton Mar 15 '15 at 15:52
  • mod_sftp is a contributed module, so I'm assuming that's why. But it does seem weird to me they wouldn't include it, as it's widely known mod_sftp is a better option than mod_tls. However, though I've never filed any sort of bug report, nor am familiar with how that operates, I'll go take a look at the project on Bugzilla. – David W Mar 15 '15 at 16:06

1 Answers1

3

The systemd unit would look something like this:

$ cat /etc/systemd/system/proftpd.service

[Unit]
Description=ProFTPd FTP Server
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/usr/sbin/proftpd
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

Then you could do:

$ sudo systemctl enable /etc/systemd/system/proftpd.service
$ sudo systemctl start proftpd.service

man systemctl should get you on the right track.

Belmin Fernandez
  • 10,629
  • 26
  • 84
  • 145