pxc 5.7 - systemd scripts (unit files) missing on ubuntu (18.04)

Hi,

I’m testing pxc in mutiple aws region setup and have installed pxc 5.7 from the official percona repo, using the percona-release package, on the official aws provided ubuntu server 18.04 ami. I’ve found there are systemd scripts (unit files) missing, only the sysV init scripts are provided with the installation. I’m a bit confused about how to properly handle the pxc service on the system. I would prefer just to use the systemctl command instead of the init scripts, if possible.

After I found this I’m considering moving to centos, becouse I know the systemd scripts are working ok there.

Also I found somebody making his own systemd scripts, but I don’t feel I want to go this way.

What do you recommend as a workaround? Use init.d scripts, switch to centos, or use custom systemd scripts? I would prefer to stay on ubuntu, but with default configuration and not to hassle with custom scripts.

Best regards

Jakub

ubuntu-bionic-18.04-amd64-server-20200112, Linux 4.15.0-1060-aws

percona-release/unknown,now 1.0-14.generic all [installed]
percona-xtrabackup-24/unknown,unknown,now 2.4.18-1.bionic amd64 [installed,automatic]
percona-xtradb-cluster-5.7-dbg/unknown,now 5.7.28-31.41-1.bionic amd64 [installed,automatic]
percona-xtradb-cluster-client-5.7/unknown,now 5.7.28-31.41-1.bionic amd64 [installed,automatic]
percona-xtradb-cluster-common-5.7/unknown,now 5.7.28-31.41-1.bionic amd64 [installed,automatic]
percona-xtradb-cluster-full-57/unknown,now 5.7.28-31.41-1.bionic amd64 [installed]
percona-xtradb-cluster-garbd-5.7/unknown,now 5.7.28-31.41-1.bionic amd64 [installed,automatic]
percona-xtradb-cluster-garbd-debug-5.7/unknown,now 5.7.28-31.41-1.bionic amd64 [installed,automatic]
percona-xtradb-cluster-server-5.7/unknown,now 5.7.28-31.41-1.bionic amd64 [installed,automatic]
percona-xtradb-cluster-server-debug-5.7/unknown,now 5.7.28-31.41-1.bionic amd64 [installed,automatic]
percona-xtradb-cluster-test-5.7/unknown,now 5.7.28-31.41-1.bionic amd64 [installed,automatic]

systemctl status mysql.service
● mysql.service - LSB: Start and stop the mysql (Percona XtraDB Cluster) daemon
Loaded: loaded (/etc/init.d/mysql; generated)
Active: active (running) since Wed 2020-02-19 14:36:23 UTC; 11s ago
Docs: man:systemd-sysv-generator(8)
Process: 6184 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 6392 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
Tasks: 42 (limit: 1151)
CGroup: /system.slice/mysql.service
├─6447 /bin/sh /usr/bin/mysqld_safe
└─6851 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --wsrep-provider=/usr/lib/galera3/libgalera_smm.so --log-error=/var

Feb 19 14:36:21 pxc-1-use-1 systemd[1]: Starting LSB: Start and stop the mysql (Percona XtraDB Cluster) daemon...
Feb 19 14:36:21 pxc-1-use-1 mysql[6392]: * Starting MySQL (Percona XtraDB Cluster) database server mysqld
Feb 19 14:36:21 pxc-1-use-1 /etc/init.d/mysql[6446]: MySQL PID not found, pid_file detected/guessed: /var/run/mysqld/mysqld.pid
Feb 19 14:36:23 pxc-1-use-1 mysql[6392]: ...done.
Feb 19 14:36:23 pxc-1-use-1 systemd[1]: Started LSB: Start and stop the mysql (Percona XtraDB Cluster) daemon.

Hi there, I’m going to check in with Jaime who raised that Jira request and see what he concluded.
Bear with us :slight_smile:

Hi again
Jaime said that to be on the safe side, it is best to use the built-in sysv scripts provided. If you need any guidance on that, let me know and I’ll ask someone from the tech team to provide info.

Hi Lorraine,

thanks for guiding me on this topic. On ubuntu linux I’ll use sysv scripts, but for aws instances I’ve migrated to centos, where this issue isn’t present. On centos the pxc has a native systemd support.

Best regards
Jakub