Bugzilla – Bug 17967
Updated Debian service control script
Last modified: 2014-03-28 14:28:17 UTC
Created attachment 7673 [details] Re-written Debian init script for logitechmediaserver The init.d service control script for logitechmediaserver is getting a little long in the tooth. It would be nice if the init script adhered to modern standards like those published at http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html. I'll attach a rewritten init script to this bug that uses the lsb init-functions and tries to be compliant with current standards. Additionally, this script implements a "status" command and re-implements the "start-direct" command. Finally, this script doesn't address the longer-term issue of the desirability of changing the Debian install package to switch the 'squeezeboxserver' user to 'logitechmediaserver' and the /usr/sbin/squeezeboxserver script name to /usr/sbin/logitechmediaserver. Making those changes would solve the problem with sbs to lms upgrades being broken by subsequent apt-get --purge attempts.
Gordon - is this something you've been using successfully for all this time? Only recently I came to realize how broken our script on eg. ReadyNAS is, when my playback stopped whenever I powered up a new device: the old script does a forced stop even on a "start" only request... which happened in my case whenever the NAS got a WOL packet.
Yes, I've been using an expanded version of this script for the past two years to run code from the git repo. On my ubuntu 12.04 server box, this script has been bullet proof. The expanded version implements additional commands like: service lms git-update ..and.. service lms rescan ..etc. The rescan command is a bit of a kludge. It just stops the service, deletes the *.db sqlite files and then restarts the service. None of those additions would be very useful in a release version of the script. But I'm willing to share it with you if you're interested.
Yes, please upload it here. I think that after discovering how badly broken the current script is, I'm willing to give yours a try in 7.8.1 or similar.
It's great to see someone with the time and knowledge to clean this up. The redhat/fedora init script could also use some love. :) Question: Is there any reason to continue having a separate squeezeboxserver_safe script? AFAIK, this is not needed since the debian package does not use mysql.
Re redhat / fedora script: are we ready to make the transition from sysv init scripts to systemd unit files? I'm a fedora user and I use a unit file to run the git code on that platform. The unit file that JackOfAll has put together for the Community Squeeze software repo at http://www.communitysqueeze.org/repo.jsp is superior to my unit file and I'm in the process of rewriting mine to more closely follow his model. I haven't kept track of what CentOS or openSUSE are using. Are there any rpm based distros that haven't made the transition to systemd? I'll try to do some research on this and what has to happen to support both init scripts & unit files in a release.
Re updated debian script & need for SAFE script: is anyone successfully using mysql with 7.8?
Created attachment 7718 [details] Zipfile of init script for running from git code
OK, I've uploaded the version of the init script that I'm currently using to run the git code as a service. One other feature: it makes it easy to switch the branch you're running a la: service lms switch-branch 'public/7.7' --or-- service lms switch-branch 'public/7.8' ..etc. The script keeps the library data separate for each branch via symlinks. Again, this is intended for running lms from the git code, not for release. My original posted script attachment is, I think, a working drop-in replacement for the current released script. About the only thing that I ought to look at, though, is if it's necessary to put in some fall-back code if the LSB functions aren't available on an ancient distro.
(In reply to comment #6) > Re updated debian script & need for SAFE script: is anyone successfully > using mysql with 7.8? Probably a few, yes. But it takes some knowledge and manual configuration. I would argue that unless it's actually being supported and maintained by someone, all of the mysql cruft could be removed from the Linux packages. I should add that the SAFE script has been there as-is for so long that I'm not even sure it's necessary even with mysql.
Easy enough to test with my replacement script. The 'start-direct' command starts the service without the safe script.
My vague recollection is that the SAFE script was intended to solve some problem triggered when the mysqld service was restarted during log rotation. Perhaps Michael can shed some light.
Gordon - I looked into this. But tbh. I don't want to commit it. There are too many changes and unnecessary features, and I do understand too little to know what I'd be doing, that I can't use it, I'm sorry. Could you please simplify the diff: - remove all features related to git/svn/whatever - don't rename anything (LMS vs. logitechmediaserver) - no whitespace or comment changes (feel free to add yours, though) Thanks!