Discussion:
How to handle alias and sysv init enable/disable (mariadb/mysql)
(too old to reply)
Faustin Lammler
2018-11-10 18:23:37 UTC
Permalink
Hi,
sorry if this was already discussed but I can't find any
pointer or documentation on how to handle this.

This is the problem we are facing:
https://jira.mariadb.org/browse/MDEV-15526

It can be reproduced on Debian stretch by disabling mariadb service
using 'systemctl disable mariadb' (all versions of mariadb are
concerned).

The problem is that this doesn't call the systemd-sysv-install script
(to update /etc/init.d/rc?.d links) because there is no
'/etc/init.d/mariadb' script but '/etc/init.d/mysql'. And on reboot
mariadb is not disabled because it is started by '/etc/init.d/mysql'
script.

Of course calling 'systemctl disable mysql' does the job but we need
both command acting the same way (mysql|mariadb).

If you have any pointer/documentation or you know a similar project -
that needs to maintain multiple name/alias for the same service - that
would be a great help.

Thanks!
Faustin
Michael Biebl
2018-11-10 18:56:47 UTC
Permalink
Post by Faustin Lammler
Hi,
sorry if this was already discussed but I can't find any
pointer or documentation on how to handle this.
https://jira.mariadb.org/browse/MDEV-15526
It can be reproduced on Debian stretch by disabling mariadb service
using 'systemctl disable mariadb' (all versions of mariadb are
concerned).
The problem is that this doesn't call the systemd-sysv-install script
(to update /etc/init.d/rc?.d links) because there is no
'/etc/init.d/mariadb' script but '/etc/init.d/mysql'. And on reboot
mariadb is not disabled because it is started by '/etc/init.d/mysql'
script.
Of course calling 'systemctl disable mysql' does the job but we need
both command acting the same way (mysql|mariadb).
If you have any pointer/documentation or you know a similar project -
that needs to maintain multiple name/alias for the same service - that
would be a great help.
My recommendation would be, to not create the myslq(d).service alias
dynamically via
[Install]
Alias=mysql.service
Alias=mysqld.service

but ship it as a static symlink in the package
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
Michael Biebl
2018-11-10 18:59:38 UTC
Permalink
Post by Michael Biebl
My recommendation would be, to not create the myslq(d).service alias
dynamically via
[Install]
Alias=mysql.service
Alias=mysqld.service
but ship it as a static symlink in the package
As an example:
Historically, the init script for NetworkManager has been called
/etc/init.d/network-manager but I decided to keep the upstream name
NetworkManager.service for the systemd .service unit.
Which is why I ship

ls -al /lib/systemd/system/network-manager.service
lrwxrwxrwx 1 root root 22 Nov 5 16:05
/lib/systemd/system/network-manager.service -> NetworkManager.service

in the network-manager package.

This way, I always have the proper mapping between the legacy init
script and the service file.
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
Michael Biebl
2018-11-10 19:04:48 UTC
Permalink
Post by Michael Biebl
Post by Michael Biebl
My recommendation would be, to not create the myslq(d).service alias
dynamically via
[Install]
Alias=mysql.service
Alias=mysqld.service
but ship it as a static symlink in the package
Historically, the init script for NetworkManager has been called
/etc/init.d/network-manager but I decided to keep the upstream name
... in Debian, to be clear.
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
Michael Biebl
2018-11-10 19:48:50 UTC
Permalink
Post by Michael Biebl
... in Debian, to be clear.
I updated https://wiki.debian.org/Teams/pkg-systemd/Packaging#systemd_unit_files_naming_and_installation
a bit. Hope it's helpful. Let me know if it needs further clarifications.

Michael
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
Faustin Lammler
2018-11-10 22:48:03 UTC
Permalink
Post by Michael Biebl
I updated https://wiki.debian.org/Teams/pkg-systemd/Packaging#systemd_unit_files_naming_and_installation
a bit. Hope it's helpful. Let me know if it needs further clarifications.
That seems very clear an promising.
I am going to test this!

Thanks

Continue reading on narkive:
Loading...