Bug 7988 - openSUSE 10.3 mysql problem
: openSUSE 10.3 mysql problem
Status: RESOLVED WORKSFORME
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 7.2.1
: PC SuSE Linux
: -- normal (vote)
: 7.x
Assigned To: Ross Levine
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-25 16:47 UTC by Uwe Meyer-Gruhl
Modified: 2009-07-31 10:20 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Meyer-Gruhl 2008-04-25 16:47:53 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.
Comment 1 Uwe Meyer-Gruhl 2008-05-01 13:37:07 UTC
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.
Comment 2 Mark Miksis 2008-05-02 09:27:09 UTC
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...
Comment 3 Uwe Meyer-Gruhl 2008-05-02 09:42:31 UTC
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.
Comment 4 Mark Miksis 2008-05-02 09:53:53 UTC
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.
Comment 5 Mark Miksis 2008-05-06 09:59:38 UTC
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?
Comment 6 Matt Wise 2008-06-19 11:05:57 UTC
I hate to add system-specific code ... Andy, Brandon, any ideas? Do you guys have much experience with openSUSE and the checkproc stuff? 
Comment 7 Mark Miksis 2008-06-20 09:47:14 UTC
Since we don't have a good fix for this yet, I've added a note to the SC RPM wiki page.
Comment 8 Blackketter Dean 2008-08-06 12:23:06 UTC
Matt/Fletch: are we going to do anything about this for the 7.2 release?
Comment 9 Mark Miksis 2008-08-06 14:04:08 UTC
(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.
Comment 10 Mickey Gee 2008-08-07 11:42:24 UTC
Moving to 7.3 ....
Comment 11 James Richardson 2008-11-07 09:19:56 UTC
Ross:  Matt requests that you create a SuSE image, then try to recreate this error.

Work with Matt once you have the image up
Comment 12 Matt Wise 2008-11-10 10:06:36 UTC
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? 
Comment 13 Uwe Meyer-Gruhl 2008-11-10 12:01:21 UTC
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.
Comment 14 Chris Owens 2009-07-31 10:20:14 UTC
Reduce number of active targets for SC