service name alias? mariadb->mysql - how?

General support questions
_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

service name alias? mariadb->mysql - how?

Post by _ck_ » 2014/07/20 21:28:08

What it is the cleanest way under 7 to make an alias for a service name?

I keep typing service mysql instead of service mariadb

(we won't even get into how it now is systemctl mariadb)

as a side question, since /var/run is now tempfs by default, where is the mariadb directory created on boot?
I tried to change the my.cnf to use /var/run/mysql instead and the problem is the directory vanishes with every reboot.
But the /var/run/mariadb is persistent. So something is creating it - but I cannot figure out where.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: service name alias? mariadb->mysql - how?

Post by gerald_clark » 2014/07/20 21:33:38

/var/run is a symlink to ../run.

_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

Re: service name alias? mariadb->mysql - how?

Post by _ck_ » 2014/07/20 21:35:01

Aha, I think I finally found the answer to my own question

systemd has an alias option under [Install]

edit /usr/lib/systemd/system/mariadb.service
add
Alias=mysql.service

and
systemctl enable mariadb
it then makes
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/mysql.service'

Now I just need to figure out where it makes the /var/run/mariadb directory

_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

Re: service name alias? mariadb->mysql - how?

Post by _ck_ » 2014/07/20 21:37:05

gerald_clark wrote:/var/run is a symlink to ../run.
Right, and that is now tempfs by default which is new since 6.5

So the system is recreating the /var/run/mariadb (aka /run/mariadb) directory on each boot.

The question is where is that happening, can I augment it, and if that is not the right place to edit, where/when is the best place to create new directories in /var/run

I guess I could just put it in the /var/run root.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: service name alias? mariadb->mysql - how?

Post by gerald_clark » 2014/07/20 21:54:28

/var/run contains the pid files of running services. It is better if it is not permanent.
/etc/my.cnf deffines datadir=/var/lib/mysql.
That is not tmpfs.

_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

Re: service name alias? mariadb->mysql - how?

Post by _ck_ » 2014/07/20 21:54:41

Okay I found the answer to my second question here:

https://wiki.archlinux.org/index.php/sy ... rary_files

/usr/lib/tmpfiles.d/mariadb.conf
has
d /var/run/mariadb 0755 mysql mysql -

and I guess I can put my own in /etc/tmpfiles.d/

yeah, systemd is so much cleaner and simplier than init.d, NOT

they've lost their minds adopting this systemd mess

everything could have just been in one init.d file in simple bash method/systax, now everything is 100% proprietary

_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

Re: service name alias? mariadb->mysql - how?

Post by _ck_ » 2014/07/20 21:57:46

gerald_clark wrote:/var/run contains the pid files of running services. It is better if it is not permanent.
/etc/my.cnf deffines datadir=/var/lib/mysql.
That is not tmpfs.
yes of course the datadir is not tmpfs, that would be crazy, lol

but you can also do this in my.cnf

socket=/var/run/mariadb/mysql.sock
pid-file=/var/run/mariadb/mysql.pid

and now I know I can create

/etc/tmpfiles.d/mariadb.conf

and put in there

d /var/run/mysql 0755 mysql mysql -

and when mariadb(aka mysql) starts it will create the /var/run/mysql directory

All you have to do is remember 15 billion little things with systemd, damn I hate it.

update: nope, this doesn't work, doesn't create it, now I have to spend an hour reading about how systemd-tmpfiles works

okay all I needed was to somehow know/remember to run systemd-tmpfiles --create

have I mentioned how much I hate systemd ?

User avatar
centminmod
Posts: 44
Joined: 2014/07/12 14:28:06
Location: Brisbane, Australia
Contact:

Re: service name alias? mariadb->mysql - how?

Post by centminmod » 2014/07/21 04:20:00

for me easiest way is disable CentOS 7 default included MariaDB and choose to use the official MariaDB YUM repo for CentOS 6 on CentOS7. That maintains the init.d/mysql naming and use of service mysql *

this also gives access to more updated MariaDB 5.5.38 and 10.0.x :)

_ck_
Posts: 89
Joined: 2012/08/10 23:00:35

Re: service name alias? mariadb->mysql - how?

Post by _ck_ » 2014/07/21 10:14:50

centminmod wrote:for me easiest way is disable CentOS 7 default included MariaDB and choose to use the official MariaDB YUM repo for CentOS 6 on CentOS7. That maintains the init.d/mysql naming and use of service mysql *

this also gives access to more updated MariaDB 5.5.38 and 10.0.x :)
Is that you eva? You are everywhere, but makes sense here too :-)

Thanks for confirming that the 6.x mariadb build works with 7.x - I was wondering if that was possible.

I wonder if that also means some missing things from the 7.x EPEL can be borrowed from the 6.x EPEL

By the way, since I know you like performance things too, I found out it is much easier to build HHVM on 7.x than 6.x, much much easier.

HHVM building is not quite a "minmod" thing but you might be interested in adding it as an optional script to your collection.

User avatar
centminmod
Posts: 44
Joined: 2014/07/12 14:28:06
Location: Brisbane, Australia
Contact:

Re: service name alias? mariadb->mysql - how?

Post by centminmod » 2014/07/22 09:49:13

_ck_ wrote:
centminmod wrote:for me easiest way is disable CentOS 7 default included MariaDB and choose to use the official MariaDB YUM repo for CentOS 6 on CentOS7. That maintains the init.d/mysql naming and use of service mysql *

this also gives access to more updated MariaDB 5.5.38 and 10.0.x :)
Is that you eva? You are everywhere, but makes sense here too :-)

Thanks for confirming that the 6.x mariadb build works with 7.x - I was wondering if that was possible.

I wonder if that also means some missing things from the 7.x EPEL can be borrowed from the 6.x EPEL

By the way, since I know you like performance things too, I found out it is much easier to build HHVM on 7.x than 6.x, much much easier.

HHVM building is not quite a "minmod" thi[*]ng but you might be interested in adding it as an optional script to your collection.
Your username can't quite place it ??

Yes it's me centminmod = eva2000 and yes I am everywhere :) Confirmed working MariaDB official YUM repo with CentOS 7.0 KVM netinstalled VPS https://community.centminmod.com/thread ... erver.797/ when testing my Centmin Mod .08 beta LEMP web stack auto installer :)

Centmin Mod LEMP Web stack installed
  • CentOS 7.0 64bit netinstall
  • Nginx 1.7.3 + ngx_pagespeed 1.8.31-4 beta
  • PHP 5.4.30 (PHP-FPM) + APC 3.1.13 + igbinary
  • MariaDB 5.5.38 via official MariaDB YUM repo
  • Additional source compiled PHP Extensions: imagick 3.1.2, memcache 3.0.8, memcached 2.2.0, libmemcached 1.0.18
  • Memcached 1.4.20 server with Libevent 2.0.21
  • CSF Firewall 7.0.4
  • Siege 3.0.6 benchmark
Thank God that init.d still works on CentOS 7.0 hehe

Actually, already testing Facebook HHVM support for Centmin Mod and it's on my to do list https://community.centminmod.com/thread ... do-list.7/ :D

Although HHVM might not be needed if PHPNG is anything to go by https://community.centminmod.com/thread ... p-5-6.888/ :)

Post Reply