1

I updated Mariadb from 10.0 to 10.2, and now pure-ftpd-mysql won't restart:

service pure-ftpd-mysql restart

outputs:

Job for pure-ftpd-mysql.service failed. See 'systemctl status pure-ftpd-mysql.service' and 'journalctl -xn' for details.

systemctl

systemctl status pure-ftpd-mysql.service -l

outputs

● pure-ftpd-mysql.service - (null)
 Loaded: loaded (/etc/init.d/pure-ftpd-mysql)
 Active: failed (Result: exit-code) since Sun 2017-07-09 23:12:23 CEST; 53s ago
Process: 3887 ExecStart=/etc/init.d/pure-ftpd-mysql start (code=exited, status=127)

  Jul 09 23:12:23 s***.h****.net pure-ftpd-mysql[3887]: Starting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot -l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -E -j -D -A -H -J ALL:!aNULL:!SSLv3 -O clf:/var/log/pure-ftpd/transfer.log -b -8 UTF-8 -Y 1 -u 1000 -B
  Jul 09 23:12:23 s***.h****.net pure-ftpd-mysql[3887]: /usr/sbin/pure-ftpd-mysql-virtualchroot: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18: no version information available (required by /usr/sbin/pure-ftpd-mysql-virtualchroot)
  Jul 09 23:12:23 s***.h****.net pure-ftpd-mysql[3887]: /usr/sbin/pure-ftpd-mysql-virtualchroot: relocation error: /usr/sbin/pure-ftpd-mysql-virtualchroot: symbol my_make_scrambled_password, version libmysqlclient_18 not defined in file libmysqlclient.so.18 with link time reference
  Jul 09 23:12:23 s***.h****.net systemd[1]: pure-ftpd-mysql.service: control process exited, code=exited status=127
  Jul 09 23:12:23 s***.h****.net systemd[1]: Failed to start (null).
  Jul 09 23:12:23 s***.h****.net systemd[1]: Unit pure-ftpd-mysql.service entered failed state.

journalctl

-- Unit pure-ftpd-mysql.service has begun starting up.
Jul 09 23:15:22 s***.h****.net pure-ftpd-mysql[4170]: Starting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot -l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -
Jul 09 23:15:22 s***.h****.net pure-ftpd-mysql[4170]: /usr/sbin/pure-ftpd-mysql-virtualchroot: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18: no version information avai
Jul 09 23:15:22 s***.h****.net pure-ftpd-mysql[4170]: /usr/sbin/pure-ftpd-mysql-virtualchroot: relocation error: /usr/sbin/pure-ftpd-mysql-virtualchroot: symbol my_make_s
Jul 09 23:15:22 s***.h****.net systemd[1]: pure-ftpd-mysql.service: control process exited, code=exited status=127
Jul 09 23:15:22 s***.h****.net systemd[1]: Failed to start (null).
-- Subject: Unit pure-ftpd-mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit pure-ftpd-mysql.service has failed.
-- 
-- The result is failed.
Jul 09 23:15:22 s***.h****.net systemd[1]: Unit pure-ftpd-mysql.service entered failed state.

mariadb -v

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 17831
Server version: 10.2.6-MariaDB-10.2.6+maria~jessie-log mariadb.org binary distribution

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Reading history-file /root/.mysql_history

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

9
  • Have you updated mariadb-libs to latest one for MariaDB 10.2? Jul 10 '17 at 3:56
  • I removed mariadb by apt-get remove mariadb-server, downloaded the deb files and did a dpkg -i *.deb, no errors so I guess everything was installed. Is there a way I can check the libs version?
    – spacebiker
    Jul 10 '17 at 8:43
  • 1
    try to execute apt list --installed and check is there libmariadbd19. Jul 10 '17 at 9:06
  • 1
    Try to reinstall libmariadbclient18. Jul 10 '17 at 11:05
  • 1
    so, update pureftpd. Jul 10 '17 at 11:45
2

This is a definitely a known bug with the Debian pureftpd package Here's the full story: In its early days, say, about 20 years ago, libmysqlclient did not version symbols and did not limit their visibility. Some functions were documented — they were client API, and we promised to keep them stable, working over years. Other functions were not documented, they were internal, no promises. But they were exported and available too. Later, in MariaDB time, RedHat was versioning libmysqlclient symbols. Old symbols from libmysqlclient.so.16.0.0 had the version libmysqlclient_16, newer symbols had the version libmysqlclient_18. Internal symols was hidden, with few exceptions. One of such exceptions was my_make_scrambled_password, because pureftpd started using it since the old days, when everything was kind of allowed. Debian had a different, simpler (and less correct) approach to versioning, all symbols had libmysqlclient_18 version. In MariaDB we managed to create a library compatible with both approaches. my_make_scrambled_password was not hidden, with the comment "for pureftpd". The use of my_make_scrambled_password has been removed from pureftpd, but the debian version has not yet been updated, therefor, the only option by now is installing from source:

apt-get remove pure-ftpd-mysql
cd /tmp
wget https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.47.tar.gz
tar xzvf pure-ftpd-1.0.47.tar.gz
cd pure-ftpd-1.0.47
./configure --with-tls --with-virtualchroot --with-puredb --with-quotas --with-throttling --with-mysql
make install-strip

After this the system started to work

3
  • 1
    For thouse struggling with an error "libmysqlclient" not found: just "apt install libmysqlclient-dev". Everything else worked perfectly
    – Hirbod
    Jan 9 '18 at 14:42
  • @Hirbod on Debian: I had to install libmariadbclient-dev-compat then I had error saying OpenSSL headers not found so I had to install libssl-dev - if install fails => try apt udpate, if apt-udpate fails => first repair apt-update errors. Like for example I had to first repair apt-update by installing new sury.org/php packages keys => sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg then apt update then apt install libmariadbclient-dev-compat, then apt install libssl-dev and only then installation described in this answer was successful :)
    – jave.web
    Feb 18 '20 at 3:39
  • what I described in previous comment I had to do after cd pure-ftpd-... step, so I did that, then ./configure --..... step went OK and make install-strip also went ok and finally - service pure-ftpd-mysql start started with no errors! :)
    – jave.web
    Feb 18 '20 at 3:44
1

For those who use Debian 9 (stretch) with pure-ftpd-mysql v1.0.43, and mariadb 10.3 (on Ispconfig for me), you could install the two debfiles from this gitlab

This is the same version with patch for this bug

Thanks to jisse44 for providing this compiled version And to luckyluk3 for the link provided on howtoforge

0

Debian stretch with mariadb 10.2
must download https://packages.debian.org/stretch/amd64/libmariadb-dev/download and apt-get install libmariadb2 after dpkg -i libmariadb-devxxxxx.deb ./configure --with-tls --with-virtualchroot --with-puredb --with-quotas --with-throttling --with-mysql make install-strip

2
0

ISPConfig 3 on Debian & pure-ftpd-mysql (MariaDB)

So I tried @spacebiker's answer and along with the answer comments I managed to get the service to run - however, for some weird reason - it still wasn't working. So I've purged everything.
sudo apt purge pure-ftpd* to get the clean state.
Then I've applied the fix from @psyray provided link to howto by gitlab user jisse44 and then reconfigured the pure-ftpd-mysql service from ISPConfig php update script:

https://gitlab.com/jisse44/pure-ftpd/blob/master/HowTo.txt

PROPS & THANKS TO gitlab.com/jisse44

For completness and more future-durable answer I will quote everything here

The gitlab.com/jisse44/pure-ftpd HowTo.txt

We will rebuild the pure-ftp-1.0.43-3 package from official Debian sources, with patch applied:

You may need to install this packages before:
apt-get install build-essential fakeroot dpkg-dev autoconf-archive libcap2-dev default-libmysqlclient-dev po-debconf debhelper

cd /usr/local/src
mkdir pure-ftp-1.0.43-3
cd pure-ftp-1.0.43-3
wget http://deb.debian.org/debian/pool/main/p/pure-ftpd/pure-ftpd_1.0.43-3.dsc
wget http://deb.debian.org/debian/pool/main/p/pure-ftpd/pure-ftpd_1.0.43.orig.tar.gz
wget http://deb.debian.org/debian/pool/main/p/pure-ftpd/pure-ftpd_1.0.43-3.diff.gz
tar zxvf pure-ftpd_1.0.43.orig.tar.gz
mv pure-ftpd-1.0.43.orig/ pure-ftpd-1.0.43
mkdir pure-ftpd-1.0.43/debian
gunzip pure-ftpd_1.0.43-3.diff.gz
patch -p0 < pure-ftpd_1.0.43-3.diff
wget https://gitlab.com/jisse44/pure-ftpd/raw/master/configure.ac.diff
wget https://gitlab.com/jisse44/pure-ftpd/raw/master/log_mysql.c.diff
patch -p0 < configure.ac.diff
patch -p0 < log_mysql.c.diff
chmod +x pure-ftpd-1.0.43/debian/rules
cd pure-ftpd-1.0.43/
dpkg-buildpackage -uc -b
cd ..
dpkg -i pure-ftpd-mysql_1.0.43-3_amd64.deb pure-ftpd-common_1.0.43-3_all.deb
  • if it fails / errors for some missing packages => just install them with
    sudo apt install missingPackageMissing
  • if it fails for some permission issues - just switch tu sudo mode with su
  • this process takes a LONG time (minutes, it's a whole rebuild & install), but after that service pure-ftpd-mysql is able to start - and pure-ftpd-mysql service is all you need - program-wise you only need pure-ftpd-common and pure-ftpd-mysql

You don't need pure-ftpd (service), you just need pure-ftpd-mysql (service)!

Reconfiguring ISPConfig service

After this I ended up with running pure-ftpd-mysql service, but obviously, it was not working with with ISPConfig's database.

What you need to do is to reconfigure the service while in ISPConfig update process - problem is, that the update sh script will not run, if you've already updated ISPConfig.

So you need to get the current ispconfig installation and run php update from that

  • First, you need to know database connection info of ispconfig-interface's config.inc.php
    => you can find that like this
    cat /usr/local/ispconfig/interface/lib/config.inc.php | grep --context=5 "db_password"
    (show file and filter out only lines with "db_password" + context of 5 lines before and after)
  • go to tmp dir cd /tmp
  • download current intallation wget https://ispconfig.org/downloads/ISPConfig-3.1.15p2.tar.gz
  • unpack it tar zxvf ISPConfig-3.1.15p2.tar.gz
  • go to installation dir (it's a must) cd /tmp/ispconfig3_install/install/
  • run the PHP (important) update script php /tmp/ispconfig3_install/install/update.php
  • during the installation when asked if reconfigure services answer yes!
  • when asked for DB password (or other DB connect info) use the info you've found in the config.inc.php earlier

Run service pure-ftpd-mysql restart and you should be all-good

Files on gitlab not available any more?

In future, it may happen that this gitlab patch files won't exist
https://gitlab.com/jisse44/pure-ftpd/raw/master/configure.ac.diff and
https://gitlab.com/jisse44/pure-ftpd/raw/master/log_mysql.c.diff
But they're in plain text so I will put them also here (I hope debian links will presist)

The gitlab.com/jisse44/pure-ftp configure.ac.diff

--- pure-ftpd-1.0.43/configure.ac   2018-11-30 15:12:17.024657198 +0100
+++ pure-ftpd-1.0.43/configure.ac   2018-11-30 14:32:32.046763067 +0100
@@ -1317,7 +1317,6 @@
         AC_MSG_ERROR(Your MySQL client libraries aren't properly installed)
     ],[])
     AC_MSG_RESULT(yes)
-    AC_CHECK_FUNCS(my_make_scrambled_password make_scrambled_password)
   fi ])

 AC_ARG_WITH(pgsql,

The gitlab.com/jisse44/pure-ftp log_mysql.c.diff

--- pure-ftpd-1.0.43/src/log_mysql.c    2018-11-30 15:07:55.673325041 +0100
+++ pure-ftpd-1.0.43/src/log_mysql.c    2018-11-30 14:34:45.002421780 +0100
@@ -470,33 +470,24 @@
     if (crypto_mysql != 0) {
         char scrambled_password[42]; /* 2 * 20 (sha1 hash size) + 2 */

-# ifdef HAVE_MY_MAKE_SCRAMBLED_PASSWORD
-        my_make_scrambled_password(scrambled_password, password,
-                                   strlen(password));
-# elif defined(HAVE_MAKE_SCRAMBLED_PASSWORD)
-        make_scrambled_password(scrambled_password, password);
-# else
-        {
-            SHA1_CTX       ctx;
-            unsigned char  h0[20], h1[20];
-            char          *p;
-
-            SHA1Init(&ctx);
-            SHA1Update(&ctx, password, strlen(password));
-            SHA1Final(h0, &ctx);
-            SHA1Init(&ctx);
-            SHA1Update(&ctx, h0, sizeof h0);
-            pure_memzero(h0, sizeof h0);
-            SHA1Final(h1, &ctx);
+        SHA1_CTX        ctx;
+        unsigned char  h0[20], h1[20];
+        char          *p;
+        SHA1Init(&ctx);
+        SHA1Update(&ctx, password, strlen(password));
+        SHA1Final(h0, &ctx);
+        SHA1Init(&ctx);
+        SHA1Update(&ctx, h0, sizeof h0);
+        pure_memzero(h0, sizeof h0);
+        SHA1Final(h1, &ctx);
             *scrambled_password = '*';
-            hexify(scrambled_password + 1U, h1,
-                   (sizeof scrambled_password) - 1U, sizeof h1);
-            *(p = scrambled_password) = '*';
-            while (*p++ != 0) {
-                *p = (char) toupper((unsigned char) *p);
-            }
+        hexify(scrambled_password + 1U, h1,
+               (sizeof scrambled_password) - 1U, sizeof h1);
+        *(p = scrambled_password) = '*';
+        while (*p++ != 0) {
+            *p = (char) toupper((unsigned char) *p);
         }
-# endif
+
         if (pure_strcmp(scrambled_password, spwd) == 0) {
             goto auth_ok;
         }
1
  • If FTP server is answering but giving you messages like, Command: AUTH TLS Response: 500 This security scheme is not implemente , you may need to allow the TLS first - to allow TLS ONLY - echo 2 > /etc/pure-ftpd/conf/TLS and restart: service pure-ftpd-mysql restart
    – jave.web
    Feb 20 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.