Bugzilla – Bug 7988
openSUSE 10.3 mysql problem
Last modified: 2009-07-31 10:20:14 UTC
There is a problem with Squeezecenter 7.01 regarding the startup of MySQL. If you have a general MySQL instance already running on the system, Squeezecenter does not start a local mysqld and thus, does not function. On the other hand, if "rcsqueezecenter start" is started before "rcmysql start", the general instance cannot be started. With Slimserver 6.5, this was no problem, since the local mysqld instance was in a local path, whereas now the global binary /usr/sbin/mysqld is being used. Since openSUSE uses "checkproc" to check for running processes, this effectively blocks using multiple instances of the same binary. I suspect, Squeezecenter's startup routines work likewise - or better put: they don't. I know I could use the global instance if I changed the "dbsource" setting accordingly, but I don't want that for security reasons. One possible solution would be to integrate a symbolic link into the RPM in order to link an entry in a Squeezecenter-local binary directory for Squeezeserver to /usr/sbin/mysqld. This would call for changing the function initSearchPath() and thus addFindBinPaths(). Since the same RPM is also used for RH/Fedora, it would have to create the symlink in %post instead of making it part of the RPM file list. Another solution (which I have chosen) is to change Slim/Utils/MySQLHelper.pm to search for "mysqld-squeezecenter" and create a symlink to "mysqld" in /usr/sbin. This way, one could distinguish between mysqld instances by path and use them both.
Oh, BTW, another note on this: When squeezecenter is stopped with "/etc/init.d/squeezecenter stop", the mysqld child process is not stopped. I think the reason is its detachment from the squeezecenter server process.
I finally had some time to test this and I can only partially reproduce the problem: 1) If the system mysql daemon is not running, everything works fine. When I start SC, it properly starts it's own mysqld instance and everything works. When I stop SC, it also properly stops it's mysqld instance. 2) If SC is running first, the system mysql daemon cannot be started. This is likely due to checkproc as described in the initial bug report. I haven't tried it yet, but I agree that this can probably be fixed in the RPM by creating a symlink to /usr/sbin/mysqld, probably in /usr/share/squeezecenter/Bin since SC will already check there first anyway. 3) If the system mysql daemon is running first, everything works fine. When I start SC, it properly starts it's own mysqld instance and everything works. When I stop SC, it also properly stops it's mysqld instance. So, I cannot duplicate the problem when the system mysql daemon is running first and I also cannot duplicate the problem of SC not killing it's own mysqld instance when stopping. I'll work on fixing the RPM with a symlink as described. I'd prefer not to commit the change until we know why my results are different from yours. They may be unrelated issues though...
1) Correct. 2) Correct. This is the real problem. 3) Correct. Maybe I have not waited long enough before re-starting the service. It takes a few seconds to shut down the local mysqld instance after the init script has said that squeezecenter is stopped. Thus, if you try to re-start the service, is sometimes does not function. However, in order to solve problem 2), I have created a symlink with another name (mysqld-squeezecenter) and modified MySQLHelper.pm and then, the local mysqld instance is not stopped correctly. Thus, this is not a complete cure.
I just tried the following: ln -s /usr/sbin/mysqld /usr/share/squeezecenter/Bin/mysqld Unfortunately, the system mysql daemon still won't start. I don't know much about checkproc, but I guess it's smart enough to know it's just a symlink. I guess that's why you needed to change the name. I'll test your fix later. I'm not quite sure how to best do this without impacting Fedora, etc.
FYI, it looks like a hardlink is able to trick checkproc, but a symlink isn't. I'm not sure this helps though. I don't really use hardlinks for anything, but iiuc the hardlink would need to be recreated anytime the mysqld is updated. The fix that changes the filename from mysqld to something else works, but I'm not sure how to implement this without adding some ugly SUSE-specific code to MySQLHelper.pm. Matt, do you have any other ideas?
I hate to add system-specific code ... Andy, Brandon, any ideas? Do you guys have much experience with openSUSE and the checkproc stuff?
Since we don't have a good fix for this yet, I've added a note to the SC RPM wiki page.
Matt/Fletch: are we going to do anything about this for the 7.2 release?
(In reply to comment #8) > Matt/Fletch: are we going to do anything about this for the 7.2 release? > I don't know of any clean way to address this.
Moving to 7.3 ....
Ross: Matt requests that you create a SuSE image, then try to recreate this error. Work with Matt once you have the image up
I'm inclined to agree with Fletch ... a hard-link solves the issue, but isn't a good fix. Uwe, do you have a newer SuSE system to try this on? I'd really like to know if this happens with an updated OS (10.3 is somewhat old). Additionally with the new_schema stuff coming and the likelihood that it will not even use MySQL (by default), this issue may go away with 8.0. I'm not inclined to put in alot of OS specific hacks unless this affects the newer OpenSUSE distros. Ross, Do you have a newer OpenSuSE image handy?
I have tested Squeezecenter 7.2.1 with OpenSUSE 11 under VMware (there is a VMWARE Appliance also). It seems to work with that. Maybe they have fixed it in the MySQL startup script.
Reduce number of active targets for SC