When I have these in my pure-ftpd mysql config file: Code: # Optional : query to get the maximal number of files # Pure-FTPd must have been compiled with virtual quotas support. # MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L" MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") # Optional : query to get the maximal disk usage (virtual quotas) # The number should be in Megabytes. # Pure-FTPd must have been compiled with virtual quotas support. # MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L" MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") The service won't start however if I comment them out the service runs fine. I'm storing all my details in a table called ftpd all other areas work except this, i've been trying various different ways of amending the sql query but no joy - anyone?
I've tried running strace on this for about an hour and cannot see why it's failing. This is all is in my logs: Oct 30 13:25:57 mercury pure-ftpd: (?@?) [ERROR] Configuration error: Invalid SQL configuration file: /etc/pure-ftpd/mysql.conf Oct 30 13:26:49 mercury last message repeated 2 times Oct 30 13:28:02 mercury pure-ftpd: (?@?) [ERROR] Configuration error: Invalid SQL configuration file: /etc/pure-ftpd/mysql.conf Oct 30 13:31:49 mercury last message repeated 2 times I'm using Fedora Core 5 As I say above if i remove those two lines it works ok - but if I enable them ftp falls over.
I think you must escape the quotation marks in the two lines: Code: MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User="\L" AND status=\"1\" AND (ipaccess = \"*\" OR ipaccess LIKE \"\\R\") MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User="\L" AND status=\"1\" AND (ipaccess = \"*\" OR ipaccess LIKE \"\\R\")
Same problem Code: Nov 1 11:10:17 mercury pure-ftpd: (?@?) [ERROR] Configuration error: Invalid SQL configuration file: /etc/pure-ftpd/mysql.conf
Hi, You have to pass Code: --with-quotas to configure to enable the MySQLGetQTASZ and MySQLGetQTAFS configuration directives. Not well documented, I had to search through the source to find the Code: #ifdef QUOTAS section that showed the code and then the configure script itself to find which configure switch caused QUOTAS to be defined for compilation.