[MDEV-17961] SystemD "Alias=mysql" considered harmful Created: 2018-12-10 Updated: 2020-08-25 Resolved: 2019-04-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Packaging, Platform RedHat |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.4.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
RHEL7 |
||
| Issue Links: |
|
||||||||
| Description |
|
Our SystemD service file contains an "Alias=mysql.service" entry, so that things like
still work when using "mysql" instead of "mariadb". We also still install a "mysql" SysV/LSB init script in /etc/init.d. Now the problem is: the "mysql.service" alias only exists when the "mariadb" service is enabled, when it is disabled the mysql.service symlinks are removed. So when the "mariadb" service is enabled systemctl start mysql is an alias for systemctl start mariadb, when the "mariadb" service is disabled it will fall back to the old SysV script in /etc/init.d/mysql, which still gets installed, but behaves differently than the SystemD service (eg. still uses mysqld_safe). In my opinion the symlink from mariadb.service to mysql.service should be created permanently by the RPM install scriptlet, instead of relying on an Alias= entry in the service file. The alias only being available at some times is already confusing, and in combination with the still distributed SysV init script by the same base name it really becomes harmful. |
| Comments |
| Comment by Daniel Black [ 2019-01-16 ] |
|
Not convinced a symlink provides a safe alternative (https://jira.mariadb.org/browse/MDEV-15526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=121830#comment-121830). Suggest documentation around overwriting the dependency directives for those service that depend on mysql{,d}.service. The overrides are a simple file dropin as the kb systemd indicates. |
| Comment by Sergei Golubchik [ 2019-01-28 ] |
|
I think that the Alias is a standard systemd approach and we shouldn't hack around it with manual symlinks. The problem is that systemd falls back to the SysV script /etc/init.d/mysql. And it will be fixed in |
| Comment by Daniel Black [ 2019-03-13 ] |
|
> And it will be fixed in Not anytime soon |