Bug #74648 | MySQL /etc/init.d/mysqld init file changes cause breakages (yum packaging) | ||
---|---|---|---|
Submitted: | 31 Oct 2014 11:32 | Modified: | 14 Apr 2015 10:17 |
Reporter: | Simon Mudd (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Packaging | Severity: | S2 (Serious) |
Version: | 5.7.5,5.6 | OS: | Linux (CentOS 6) |
Assigned to: | CPU Architecture: | Any | |
Tags: | init scripts, rpm, yum |
[31 Oct 2014 11:32]
Simon Mudd
[31 Oct 2014 11:42]
Simon Mudd
Actually this is not MySQL 5.7 specific but "the yum rpm build system specific", so going to tag as a 5.6 issue. I don't use the yum community 5.6 rpms so haven't been affected by this before.
[31 Oct 2014 11:43]
Simon Mudd
Adjust title to be clearer.
[31 Oct 2014 12:23]
Terje Røsten
Hi Simon, thanks for your report. Sorry, for not documenting this change. Adding the feature back is possible, however it's not a generic solution as with introduction of systemd and service files there are no initscript at all. The need for e.g. --skip-grant-tables clearly exists I agree. An other solution might be to read /etc/sysconfig/mysql Sample contents: OPTS="--skip-grant-tables --skip-networking" What do you think, other ways we can modify mysqld start up without too much trouble?
[31 Oct 2014 13:37]
Simon Mudd
The move to systemd is something which I've not had to look at yet (luckily). It makes a large number of changes everywhere and indeed for many things it's very good. However the need I'm talking about is for a DBA to do "tasks" when setting up or building a server. I gave examples but not the use cases: (1) initial installation (2) upgrades from an older version where the current grant system is now not understood by MySQL. (3) configuration of a slave in a stopped state (4) running special processing on startup (5) starting up a server in read-only mode to prevent applications changing data (6) starting up a server either bound to 127.0.0.1 or with networking disabled so that applications can not access the server while it's configuration is being adjusted. (7) starting up a slave/server after a crash in a way which does / does not clean up old relay log files [2 different use cases here] and these are the ones that come to mind without thinking too hard. These are real use cases which I have on a day to day basis. It's also true that the normal setup is stop or start MySQL and thats it. So if talking about systemd that's fine. You need to make sure the DBA can do these other tasks somehow in a clean and clear fashion. The previously used method which has worked for some time has worked well and given the flexibility to do this. Reading /etc/sysconfig/mysql does not work as we're not talking about static configuration settings. If your suggestion of OPTS="--skip-grant-tables --skip-networking" means doing something like # OPTS="--skip-grant-tables --skip-networking" /etc/init.d/mysqld start Then that at least does follow a more traditional UNIX approach of providing an environment variable to the command which affects it's behaviour. That would work for this sort of case but I'd suggest a more descriptive variable name like MYSQLD_OPTS or similar. I'm not familiar enough with systemd to know how this might work on a server using systemd, so feedback is welcome. I'm not yet using MySQL CentOS 7 and one of the reasons is because of this huge change and the need to adapt current usage to work with systemd. So my current comments are more clearly focused really on CentOS / RHEL 6 (and 5 to some extent) environments where these changes are currently causing problems. If you're familiar enough with systemd and the usage I'm talking about then suggestions on how these sorts of tasks can be done (remember they're part of a large build process) then that sort of feedback would be most welcome.
[3 Nov 2014 20:24]
Terje Røsten
Hi Simon, for platforms using initscript we are likely to add the feature back. For new systemd it seems some research are required, current status is not very user friendly.
[5 Nov 2014 16:27]
Simon Mudd
Thank you for the response. I think that's good news. My thought for the case of systems running systemd might be to simply provide a command line tool (rename the script and put it in /usr/bin/ ?) which behaves the same way as the current /etc/init.d/mysqld and that would allow us to use that tool instead for this type of situations. (mysqld_init ?) I guess the only possible concern would be interference with the existing systemd behaviour, but I'd expect that perhaps that script can interact with systemd in such a way to not make that an issue. I understand this requires some thought, but certainly fixing the issue for OS variants that do not use systemd yet, such as CentOS6/RHEL6/OEL6 etc would be a good start.
[8 Apr 2015 22:24]
Daniel So
The feature has been added back to the init script.
[14 Apr 2015 10:16]
Simon Mudd
Yes, thanks. Works fine now, so thanks for resolving this.
[14 Apr 2015 10:17]
Simon Mudd
Note: fixed in 5.7.6, as that's not shown here.
[14 Apr 2015 10:30]
Terje Røsten
Hi Simon, commit fixing this is here: https://github.com/mysql/mysql-server/commit/8be836297e77b783f5b7b01f5371272907f70004 Note the comment about systemd included in commit message. Also have a look at the MySQL systemd documentation: https://dev.mysql.com/doc/refman/5.7/en/server-management-using-systemd.html