# [SOLVED] proftpd will not enable under systemd

## rcb1974

I just built a new server and did a clean install of amd64 multilib systemd Gentoo.  I am amazed at the performance of this Ryzen based machine running this operating system.

However, I am unable to get the proftpd service to start automatically at boot time even though proftpd runs fine (after the server has finished booting) whenever it is manually started with:

```

# systemctl start proftpd

#

```

Here is the errors I get whenever I attempt to enable proftpd:

```

# systemctl enable proftpd

Synchronizing state of proftpd.service with SysV service script with /lib/systemd/systemd-sysv-install.

Executing: /lib/systemd/systemd-sysv-install enable proftpd

Failed to execute /lib/systemd/systemd-sysv-install: No such file or directory

#

```

Has systemd-sysv-install become deprecated?  I re-emerged systemd but I get the same error -- that systemd-sysv-install file is not found anywhere on my computer:

```

(myhost) /lib/systemd # ls systemd-sys*

systemd-sysctl

(myhost) /lib/systemd #

(myhost) /lib/systemd # locate systemd-sysv-install

(myhost) /lib/systemd #

```

I've been using Gentoo for 20 years, but systemd only for the past year so I'm new to it.  I would appreciate any suggestions on how to fix this.  I am using proftpd v1.3.7a and systemd v246-r2.

Thanks!Last edited by rcb1974 on Mon Oct 26, 2020 8:40 pm; edited 2 times in total

----------

## mike155

A wild guess: is Systemd installed with USE flag 'sysv-utils' ?

----------

## rcb1974

Thank you for your suggestions.  Yes, systemd was compiled with that sysv-utils USE flag.  See below from make.conf:

```

USE="3dnow 7zip a52 aac abi_x86_32 ac3 acl acpi aim alsa amd64 apache2 apng apparmor audit berkdb bluetooth \

bzip2 calendar cdb cdda cddb cdparanoia cdr cgroup-hybrid consolekit crypt cryptsetup css cups curl cvs dbus \

dga -debug djvu dns-over-tls -doc dri dts dv dvb dvd dvdr egl elfutils encode exif expat \

fdk ffmpeg fftw flac fontconfig ftp gallium gdbm gd gcrypt geoip geolocation gif gimp glut \

gnome -gnome-keyring gnuefi gnuplot gnutls gpm gps gsl gsm gstreamer gtk gzip http hwdb icu idn \

#gnome -gnome-keyring gnuefi gnuplot gnutls -gpm gps gsl gsm gstreamer -gtk gzip homed http hwdb icu idn \

#-ieee1394 imap imlib importd introspection ipv6 -java javascript jingle joystick \

-ieee1394 imap imlib importd introspection ipv6 java javascript jingle joystick \

#-jpeg -jpeg2k kmod -kerberos lame -latex lcms ldap -libav libidn2 libnotify libsamplerate \

jpeg jpeg2k kmod -kerberos lame -latex lcms ldap -libav libidn2 libnotify libsamplerate \

libwww lm_sensors lsma lzo lz4 lzma mad maildir matroska -mbox memlimit midi mikmod \

mime minizip mms mng mod mono motif mp3 mp4 mpeg mplayer msn multilib -multimedia \

musicbrainz mysql nat ncurses network nls nntp nocd nptl nsplugin -odbc ogg openal \

openexr opengl opus osc -oss pam pcre pcre16 pdf php plasma plotutils pkcs11 png policykit ppds printsupport \

pulseaudio pwquality python qml qrcode -qt4 qt5 raw rdp readline repart resolvconf rss ruby samba sasl savedconfig \

#pulseaudio python qml qrcode qt4 qt5 raw rdp readline resolvconf rss ruby samba sasl savedconfig \

scanner sctp sdl seccomp semantic-desktop seccomp session slang smp snmp sockets sound \

sox spell split-usr sqlite ssl subversion svc svg svga systemd sysv-utils taglib tcpd \

text theora threads tiff timidity \

truetype tty-helpers udisks upnp upnp-av upower usb v4l vaapi vanilla vcd vhosts video vnc \

#vorbis wavpack webkit webp widgets wifi -x264 -x265 -X xkb xft xine xml xmp xmpp xods \

vorbis wavpack webkit webp widgets wifi x264 x265 X xkb xft xine xml xmp xmpp xods \

xpm xv xvid zip zlib"

COMMON_FLAGS="-march=native -O2 -pipe -fomit-frame-pointer -funroll-loops"

#COMMON_FLAGS="-march=znver2 -O2 -pipe -fomit-frame-pointer -funroll-loops"

CFLAGS="${COMMON_FLAGS}"

CXXFLAGS="${COMMON_FLAGS}"

FCFLAGS="${COMMON_FLAGS}"

FFLAGS="${COMMON_FLAGS}"

MAKEOPTS=-j8

```

----------

## mike155

I don't understand what's going on here.

/usr/lib/systemd/systemd-sysv-install does NOT exist on my Gentoo machine

But it exists on my Debian machine:

```
# ls -la /usr/lib/systemd/systemd-sysv-install

-rwxr-xr-x 1 root root 1360 Apr 27 17:02 /usr/lib/systemd/systemd-sysv-install
```

Systemd's README says:

```
When calling "systemctl enable/disable/is-enabled" on a unit which is a

SysV init.d script, it calls /usr/lib/systemd/systemd-sysv-install;

this needs to translate the action into the distribution specific

mechanism such as chkconfig or update-rc.d. Packagers need to provide

this script if you need this functionality (you don't if you disabled

SysV init support).

Please see src/systemctl/systemd-sysv-install.SKELETON for how this

needs to look like, and provide an implementation at the marked places.
```

So I guess /usr/lib/systemd/systemd-sysv-install should be there - but it isn't...

----------

## Etal

I don't think Gentoo ever had a "systemd-sysv-install" since it wouldn't work with openrc scripts.

sysv-utils is fine because it's for symlinks like /sbin/init. Don't unset it or you could brick your system.

The proftpd.service file provided by portage looks pretty normal:

https://gitweb.gentoo.org/repo/gentoo.git/tree/net-ftp/proftpd/files/proftpd.service

Can you post the output of this? 

```
$ PAGER= systemctl cat proftpd
```

----------

## rcb1974

 *Quote:*   

> 
> 
> Can you post the output of this? 
> 
> 

 

Sure!  Could what be happening be that proftpd isn't first waiting for networking to finish getting setup at startup?

```

# PAGER= systemctl cat proftpd

# /lib/systemd/system/proftpd.service

[Unit]

Description=ProFTPd FTP daemon

[Service]

Type=simple

ExecStart=/usr/sbin/proftpd --nodaemon

StandardOutput=syslog

StandardError=syslog

Restart=always

[Install]

WantedBy=multi-user.target

# 

```

----------

## GDH-gentoo

 *Etal wrote:*   

> I don't think Gentoo ever had a "systemd-sysv-install" since it wouldn't work with openrc scripts.

 Support for "SysV service script" compatibility has been patched out, presumably for that reason, but...

 *rcb1974 wrote:*   

> See below from make.conf:
> 
> ```
> 
> USE="3dnow 7zip a52 aac abi_x86_32 ac3 acl acpi aim alsa amd64 apache2 apng apparmor audit berkdb bluetooth \
> ...

 ... if the vanilla USE flag was set when sys-apps/systemd was installed, the patch is not applied.

----------

## rcb1974

 *Quote:*   

> ... if the vanilla USE flag was set when sys-apps/systemd was installed, the patch is not applied.

 

I deleted the vanilla global USE flag, and then issued emerge -uvDN world.

Now everything works!  The error is gone and proftpd starts up fine automatically.

Thanks GDH-gentoo!   :Very Happy:   I never would have been able to figure this out on my own.

----------

## mike155

 *Quote:*   

> I deleted the vanilla global USE flag

 

The vanilla USE flag is used by multiple packages. On my machine:

```
# equery h vanilla

 * Searching for USE flag vanilla ... 

[IP-] [  ] app-text/a2ps-4.14-r6:0

[IP-] [  ] dev-libs/openssl-1.1.1g:0/1.1

[IP-] [  ] sys-apps/coreutils-8.32-r1:0

[IP-] [  ] sys-apps/systemd-246-r2:0/2

[IP-] [  ] sys-devel/gcc-9.3.0-r1:9.3.0

[IP-] [  ] sys-devel/gdb-9.2:0

[IP-] [  ] sys-devel/libtool-2.4.6-r6:2

[IP-] [  ] sys-firmware/intel-microcode-20200616_p20200921:0

[IP-] [  ] sys-libs/glibc-2.31-r6:2.2
```

You defined the vanilla USE flag in make.conf. As a result, all of those packages were installed with the vanilla USE flag. Then you removed that USE flag from make.conf. As a result, all of those packages were re-compiled and installed without the vanilla USE-flag. This may have resolved the issue with proftpd, but it also changed the behavior of all other packages.

It's much better to define USE flags like the vanilla USE flag on a per-package basis in /etc/portage/package.use.

Only USE flags that should be applied to all packages should be defined in make.conf. USE flags like 'alsa', 'nls', 'unicode' or 'vaapi' come to my mind. 

Other USE flags, which are used to tweak properties of only one (or a few) packages should be defined in package.use.

----------

## rcb1974

 *Quote:*   

> It's much better to define USE flags like the vanilla USE flag on a per-package basis in /etc/portage/package.use. 

 

Thank you for that tip.  A challenge for me sometimes is determining if it more beneficial to have a certain USE flag set globally rather than set just for specific package(s).  Sometimes the best choice is obvious, (i.e. mp3, pdf, multilib, etc) but for other USE flags it is not so obvious.

When I issued the "emerge -uvDN world" command, 7 of the same 9 packages that you mentioned also had to be recompiled on my system; coreutils, systemd, gcc, glibc, openssl, gdb, and libtool.  Everything is working now, so I'm happy.

Cheers!

----------

