MailCleaner / MailCleaner-Next

Fork of MailCleaner for Debian 12
GNU General Public License v3.0
6 stars 3 forks source link

configuration script doesnt create database #37

Closed si458 closed 11 months ago

si458 commented 11 months ago

for some reason the configuration script doesnt work, after you have run the install script, it gets to the 'mailcleaner base system configuration' but after running through the steps, apache2 isnt started and disabled on start up? mysql isnt started and disabled on startup? then when i start mariadb and check its databases, the is no mailcleaner or mc databases?

but i have spotted this in the logs saying permission denied

2023-11-30T11:20:37.123581+00:00 mailcleaner mariadbd-safe[846]: 231130 11:20:37 mysqld_safe Logging to '/var/mailcleaner/log/mysql_master/mysql.log'.
2023-11-30T11:20:37.128323+00:00 mailcleaner mariadbd-safe[1013]: mkdir: cannot create directory ‘/var/mailcleaner’: Permission denied
2023-11-30T11:20:37.130877+00:00 mailcleaner mariadbd-safe[846]: 231130 11:20:37 mysqld_safe Fatal error Can't create database directory '/var/mailcleaner/run/mysql_master/mysqld.sock'
2023-11-30T11:20:37.136898+00:00 mailcleaner mariadbd-safe[1017]: #007/usr/bin/mariadbd-safe-helper: Can't create/write to file '/var/mailcleaner/log/mysql_master/mysql.log' (Errcode: 13 "Permission denied")
2023-11-30T11:20:37.139576+00:00 mailcleaner systemd[1]: mariadb@master.service: Main process exited, code=exited, status=1/FAILURE
2023-11-30T11:20:37.139894+00:00 mailcleaner systemd[1]: mariadb@master.service: Failed with result 'exit-code'.
2023-11-30T11:20:37.208108+00:00 mailcleaner dump_apache_config.pl[964]: CANNOTCONNECTDB 2
2023-11-30T11:20:37.211546+00:00 mailcleaner systemd[1]: apache2.service: Control process exited, code=exited, status=255/EXCEPTION
2023-11-30T11:20:37.215891+00:00 mailcleaner systemd[1]: apache2.service: Failed with result 'exit-code'.
2023-11-30T11:20:37.216135+00:00 mailcleaner systemd[1]: Failed to start apache2.service - Apache HTTP daemon for MailCleaner.
2023-11-30T11:20:37.242207+00:00 mailcleaner mariadbd-safe[944]: 231130 11:20:37 mysqld_safe Logging to '/var/mailcleaner/log/mysql_slave/mysql.log'.
2023-11-30T11:20:37.245651+00:00 mailcleaner mariadbd-safe[1117]: mkdir: cannot create directory ‘/var/mailcleaner’: Permission denied
2023-11-30T11:20:37.247443+00:00 mailcleaner mariadbd-safe[944]: 231130 11:20:37 mysqld_safe Fatal error Can't create database directory '/var/mailcleaner/run/mysql_slave/mysqld.sock'
2023-11-30T11:20:37.249862+00:00 mailcleaner mariadbd-safe[1120]: #007/usr/bin/mariadbd-safe-helper: Can't create/write to file '/var/mailcleaner/log/mysql_slave/mysql.log' (Errcode: 13 "Permission denied")
2023-11-30T11:20:37.250610+00:00 mailcleaner systemd[1]: mariadb@slave.service: Main process exited, code=exited, status=1/FAILURE
2023-11-30T11:20:37.250897+00:00 mailcleaner systemd[1]: mariadb@slave.service: Failed with result 'exit-code'.
si458 commented 11 months ago

ok i was able to fix this by adding the mysql user to the mailcleaner group usermod -a -G mailcleaner mysql

si458 commented 11 months ago

Sorry but this still isn't working? While it now lets the mariadb master/slave start, it's not connecting as it's shutting down the mariadb straight away for some reason?

Screenshot_20231130_223258 Screenshot_20231130_223312 Screenshot_20231130_223328

si458 commented 11 months ago

It seems to show the service is being deactivated?

root@mailcleaner:/home/simon# systemctl status mariadb@master.service
○ mariadb@master.service - MariaDB 10.11.4 database server (multi-instance master)
     Loaded: loaded (/lib/systemd/system/mariadb@.service; disabled; preset: enabled)
    Drop-In: /usr/mailcleaner/scripts/systemd/mariadb@master.service.d
             └─override.conf
             /usr/mailcleaner/scripts/systemd/mariadb@.service.d
             └─overrides.conf
     Active: inactive (dead) since Thu 2023-11-30 22:34:09 GMT; 6min ago
   Duration: 698ms
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 56174 ExecStartPre=/usr/mailcleaner/bin/dump_mysql_config.pl master (code=exited, status=0/SUCCESS)
    Process: 56176 ExecStart=/usr/bin/mariadbd-safe $MYSQLD_MULTI_INSTANCE $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
   Main PID: 56176 (code=exited, status=0/SUCCESS)
        CPU: 568ms

Nov 30 22:34:08 mailcleaner.mefoo.com systemd[1]: Starting mariadb@master.service - MariaDB 10.11.4 database server (multi-instance master)...
Nov 30 22:34:08 mailcleaner.mefoo.com systemd[1]: Started mariadb@master.service - MariaDB 10.11.4 database server (multi-instance master).
Nov 30 22:34:08 mailcleaner.mefoo.com mariadbd-safe[56176]: 231130 22:34:08 mysqld_safe Logging to '/var/mailcleaner/log/mysql_master/mysql.log>
Nov 30 22:34:08 mailcleaner.mefoo.com mariadbd-safe[56176]: 231130 22:34:08 mysqld_safe Starting mariadbd daemon with databases from /var/mailc>
Nov 30 22:34:09 mailcleaner.mefoo.com systemd[1]: mariadb@master.service: Deactivated successfully.

root@mailcleaner:/home/simon#