You are not logged in.
Hi,
I have installed and enabled the package mariadb long time ago (I had mysql installed previously). Now I'd like to stop mariadb from starting on boot. I think this should work by just disabling it's systemd service (systemctl disable mariadb) but it doesn't. I disabled the mariadb service but it starts nevertheless and I can't figure out whats starting it. Do you have any idea or hint what I could try or what I've missed?
Status of mariadb.service:
[root@flohlap cjohn]# systemctl status mariadb
● mariadb.service - MariaDB 10.1.32 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2018-05-01 11:54:38 CEST; 1h 52min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 1237 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 820 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR ||>
Process: 780 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 898 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 27 (limit: 4915)
Memory: 180.8M
CGroup: /system.slice/mariadb.service
└─898 /usr/bin/mysqld
Mai 01 11:54:37 flohlap mysqld[898]: 2018-05-01 11:54:37 140214481276864 [Note] Recovering after a crash using mysql-bin
Mai 01 11:54:37 flohlap mysqld[898]: 2018-05-01 11:54:37 140214481276864 [Note] Starting crash recovery...
Mai 01 11:54:37 flohlap mysqld[898]: 2018-05-01 11:54:37 140214481276864 [Note] Crash recovery finished.
Mai 01 11:54:37 flohlap mysqld[898]: 2018-05-01 11:54:37 140214481255168 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' d>
Mai 01 11:54:37 flohlap mysqld[898]: 2018-05-01 11:54:37 140214481276864 [Note] Server socket created on IP: '::'.
Mai 01 11:54:37 flohlap mysqld[898]: 2018-05-01 11:54:37 140214481276864 [ERROR] Missing system table mysql.roles_mapping; please run mysql_upgrade to create it
Mai 01 11:54:38 flohlap mysqld[898]: 2018-05-01 11:54:38 140214480640768 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' d>
Mai 01 11:54:38 flohlap mysqld[898]: 2018-05-01 11:54:38 140214481276864 [Note] /usr/bin/mysqld: ready for connections.
Mai 01 11:54:38 flohlap mysqld[898]: Version: '10.1.32-MariaDB' socket: '/run/mysqld/mysqld.sock' port: 3306 MariaDB Server
Mai 01 11:54:38 flohlap systemd[1]: Started MariaDB 10.1.32 database server.
Enabled Systemd unit files:
[root@flohlap cjohn]# systemctl list-unit-files | grep enabled
org.cups.cupsd.path enabled
acpid.service enabled
autovt@.service enabled
avahi-daemon.service enabled
cpupower.service enabled
dbus-org.freedesktop.Avahi.service enabled
dbus-org.freedesktop.NetworkManager.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
display-manager.service enabled
getty@.service enabled
httpd.service enabled
libvirtd.service enabled
lm_sensors.service enabled
named.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager.service enabled
ntpd.service enabled
org.cups.cupsd.service enabled
sddm.service enabled
sshd.service enabled
systemd-fsck-root.service enabled-runtime
tlp-sleep.service enabled
tlp.service enabled
avahi-daemon.socket enabled
org.cups.cupsd.socket enabled
virtlockd.socket enabled
virtlogd.socket enabled
remote-fs.target enabled
Kind regards
Clemens
Last edited by Floh1111 (2018-05-01 15:15:53)
Offline
https://wiki.archlinux.org/index.php/Sy … _a_service might be helpful to figure out what's happening.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Or mask it rather than disabling it. Grab some popcorn, reboot, and see what other service now fails to start because it cannot start mariadb
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Offline
Hi,
I finally managed to stop mariadb from starting. The dependency list did the trick:
[root@flohlap system]# systemctl list-dependencies
default.target
● ├─bumblebeed.service
● ├─sddm.service
● ├─ssh-agent.service
● └─multi-user.target
● ├─acpid.service
● ├─avahi-daemon.service
● ├─cpupower.service
● ├─cups.path
● ├─dbus.service
● ├─dkms.service
● ├─httpd.service
● ├─libvirtd.service
● ├─lm_sensors.service
● ├─man-db.timer
● ├─mariadb.service
● ├─named.service
● ├─NetworkManager.service
● ├─ntpd.service
...
Somehow multi-user.target depends on mariadb.service. I could not stop it from starting by masking the service so I looked up if there are some false symlinks lingering around in the filesystem and found one (mysqld.service):
[root@flohlap cjohn]# ls /etc/systemd/system/multi-user.target.wants/
acpid.service cpupower.service httpd.service mysqld.service ntpd.service sshd.service
avahi-daemon.service cups.path libvirtd.service named.service org.cups.cupsd.path tlp.service
btsync@floh1111.service dkms.service lm_sensors.service NetworkManager.service remote-fs.target vboxservice.service
[root@flohlap cjohn]# ls -la /etc/systemd/system/multi-user.target.wants/mysqld.service
lrwxrwxrwx 1 root root 38 26. Mai 2013 /etc/systemd/system/multi-user.target.wants/mysqld.service -> /usr/lib/systemd/system/mysqld.service
[root@flohlap system]# unlink /etc/systemd/system/multi-user.target.wants/mysqld.service
[root@flohlap system]# systemctl daemon-reload
[root@flohlap system]# systemctl list-dependencies
default.target
● ├─bumblebeed.service
● ├─sddm.service
● ├─ssh-agent.service
● └─multi-user.target
● ├─acpid.service
● ├─avahi-daemon.service
● ├─cpupower.service
● ├─cups.path
● ├─dbus.service
● ├─dkms.service
● ├─httpd.service
● ├─libvirtd.service
● ├─lm_sensors.service
● ├─man-db.timer
● ├─named.service
● ├─NetworkManager.service
...
This looks better now. Maybe this is a leftover from some migration? Anyway, it works
Thank you, I learned something today!
Best whishes
Clemens
Offline
Glad I could help
Another good trick is to use...
# tree /etc/systemd/system
Offline