Confusing with systemctl for mariadb

General support questions
Post Reply
23198938a
Posts: 9
Joined: 2014/12/16 07:31:17

Confusing with systemctl for mariadb

Post by 23198938a » 2014/12/16 07:36:02

Hi all,

I install CentOS 7 minimal for my personal LAMP server.
I using MariaDB 10 for database, after finish installation why i can't use

systemctl status mariadb.service
systemctl start mariadb.service

using google, in some website said to start mariaDB in CentOS 7 you can use systemctl start mariadb.service

why in my CentOS 7 i can't do this?

instead i need to use systemctl start mysql

is there any problem in my CentOS installation?

User avatar
TrevorH
Forum Moderator
Posts: 29120
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Confusing with systemctl for mariadb

Post by TrevorH » 2014/12/16 11:31:47

CentOS supplies mariadb 5.5 not 10. If you installed 10 then you got the packages from elsewhere and they may not be systemd aware or they may be named differently. You'll have to ask the place where you got them from.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

23198938a
Posts: 9
Joined: 2014/12/16 07:31:17

Re: Confusing with systemctl for mariadb

Post by 23198938a » 2014/12/24 07:21:25

TrevorH wrote:CentOS supplies mariadb 5.5 not 10. If you installed 10 then you got the packages from elsewhere and they may not be systemd aware or they may be named differently. You'll have to ask the place where you got them from.
Hi trevorH,

thanks information.

i am using mariadb official repo when installing mariadb 10, meaning mariadb 10 from mariadb official not systemd aware?

Code: Select all

https://downloads.mariadb.org/mariadb/repositories/#distro=RedHat&distro_release=rhel7-amd64&version=10.0

User avatar
jyoung
Posts: 102
Joined: 2014/09/22 13:40:31
Location: Nashville, TN, USA

Re: Confusing with systemctl for mariadb

Post by jyoung » 2014/12/24 18:36:12

Code: Select all

[jyoung@young Downloads]$ ls
MariaDB-10.0.15-centos7_0-x86_64-server.rpm

[jyoung@young Downloads]$ rpm -qlp MariaDB-10.* | grep service$
warning: MariaDB-10.0.15-centos7_0-x86_64-server.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY

[jyoung@young Downloads]$ rpm -qlp MariaDB-10.* | grep init
warning: MariaDB-10.0.15-centos7_0-x86_64-server.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
/etc/init.d/mysql
The RPM that you've downloaded is not built for systemd. It's using a SysV style startup script. The command that you're running, "systemctl start mysql", works because it uses the script that is provided in the RPM that you've downloaded.

If you're concerned about having to use the name mysql, what about symlinking /etc/init.d/mysql to /etc/init.d/mariadb.

Code: Select all

sudo bash
cd /etc/init.d
ln -s mysql mariadb
exit
Or, download the CentOS-provided mariadb-server RPM and use it's unit file as a starting point for using systemd to manage the service?

Code: Select all

sudo bash
cd ~
yum install -y --downloadonly mariadb-server
rpm2cpio mariadb-server* | cpio -idmv
mv usr/lib/systemd/system/*.service .   ## Save this file here just in case you need an original from which to work
cp -r *.service* /etc/systemd/system/
systemctl daemon-reload
systemctl enable mariadb
systemctl start mariadb
-- Jeremy --

23198938a
Posts: 9
Joined: 2014/12/16 07:31:17

Re: Confusing with systemctl for mariadb

Post by 23198938a » 2014/12/29 23:23:58

thanks jyoung, i have use your tricks to use soft link
jyoung wrote:

Code: Select all

[jyoung@young Downloads]$ ls
MariaDB-10.0.15-centos7_0-x86_64-server.rpm

[jyoung@young Downloads]$ rpm -qlp MariaDB-10.* | grep service$
warning: MariaDB-10.0.15-centos7_0-x86_64-server.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY

[jyoung@young Downloads]$ rpm -qlp MariaDB-10.* | grep init
warning: MariaDB-10.0.15-centos7_0-x86_64-server.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
/etc/init.d/mysql
The RPM that you've downloaded is not built for systemd. It's using a SysV style startup script. The command that you're running, "systemctl start mysql", works because it uses the script that is provided in the RPM that you've downloaded.

If you're concerned about having to use the name mysql, what about symlinking /etc/init.d/mysql to /etc/init.d/mariadb.

Code: Select all

sudo bash
cd /etc/init.d
ln -s mysql mariadb
exit
Or, download the CentOS-provided mariadb-server RPM and use it's unit file as a starting point for using systemd to manage the service?

Code: Select all

sudo bash
cd ~
yum install -y --downloadonly mariadb-server
rpm2cpio mariadb-server* | cpio -idmv
mv usr/lib/systemd/system/*.service .   ## Save this file here just in case you need an original from which to work
cp -r *.service* /etc/systemd/system/
systemctl daemon-reload
systemctl enable mariadb
systemctl start mariadb

Post Reply

Return to “CentOS 7 - General Support”