Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Aug 2008
    Posts
    21

    Start MusicIP at boot on Ubuntu

    I've installed MusicIP on my Ubuntu 9.04 Squeezecenter system following the instructions in the wiki. Everything works fine except for the fact that MusicIP won't start on boot. For instance, if after boot I check port 10002, there is nothing there. If I enter "/etc/init.d/mmserver start" and then point my browser to 10002, I get the MusicIP interface. And then if I restart squeezecenter, everything works fine. But without entering the start command, MusicIP won't start at all. It's not even the case that the server is running but SC doesn't recognize it; it just won't start (and I've used BUM to change the start order, but again, it is a matter of not starting at all).

    I think the problem might be related to the fact that starting mmserver requires a password. For instance, if I enter "/etc/init.d/mmserver start" (notice I don't enter sudo) it still asks for a password. I'm wondering whether (a) this is normal behavior (b) if not, is this what is preventing mmserver from starting correctly at boot and (c) how to fix this (whether the password is causing the problem or not).

    Any advice would be appreciated, as the MusicIP/SC system works great otherwise.

  2. #2
    Hi there - I don't know if this is the solution to your problem or not..but when I upgraded from 8.10 to 9.04 my mmserver script, which was pretty much the one from here (and the default that came with MusicIP):

    http://wiki.slimdevices.com/index.ph..._SqueezeCenter

    stopped working, and had the same behavior that you describe.


    To make it work I found a solution on the MusicIP forums...but looks like they are dead now.

    Essentially, I had to place a "nohup" in front of both "su"'s.

    so that it looks like:

    Code:
    #! /bin/sh
    # NON-PRIVIELEGED USER TO RUN MUSICMAGICSERVER.
    USER=
    # PATH TO THE MUSICMAGICMIXERSERVER 
    export MUSICHOME=
    case $1 in
        start)
            nohup su - $USER -c $MUSICHOME"MusicMagicServer start  & > /dev/null" 
            echo "Running MusicMagicServer"
            exit
            ;;
        stop)
            nohup su - $USER -c $MUSICHOME"MusicMagicServer stop  & > /dev/null" 
            echo "Stopped MusicMagicServer"
            exit
            ;;
        *)
            echo "Usage: /etc/rc.d/init.d/mmserver { start | stop }"
            exit
            ;;
    esac
    then everything magically worked.
    Obviously you still need to configure your USER and MUSICHOME (like it says in the wiki..) -- but I'm guessing you already got that far.

    hope this helps!
    -arm
    PS: anyone know what's up with MusicIP? I love (and bought!) the Mixer...hoping not to see it disappear!

  3. #3
    Junior Member
    Join Date
    Aug 2008
    Posts
    21
    Thanks for the suggestion. I tried it, but it didn't work. After running the /etc/init.d/mmserver start command, it didn't ask for a password. Instead I got:

    nohup: ignoring input and appending output to '/home/<my username>/nohup.out'

    The server was not started.

    I looked in nohup.out and there was just one line that said "su: must be run from a terminal"

    As for MusicIP itself, I think they might be dead. Before the forums disappeared, there was a thread about how they hadn't been updating things in a while and how the main developer had left. If I remember correctly, they may have sold the tech to some other company, which may or may not develop it.

  4. #4
    Senior Member
    Join Date
    Mar 2008
    Location
    Netherlands
    Posts
    752
    i'm running debian, which is quite identical to ubuntu and i solved this issue by adding a line to the /etc/rc.local file. the line is:

    /etc/init.d/mmserver start

    if you don't have this file on your system you can create one, mine looks like:

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.

    /etc/init.d/mmserver start

    exit 0

  5. #5
    Junior Member
    Join Date
    Aug 2008
    Posts
    21
    Thanks, I'll try that, though I'm thinking that it might not solve the problem. Even just running "/etc/init.d/mmserver start" from the command line asks for a password, but I think it should not (though anyone who knows better than I do, please correct me if I'm wrong). So I think that if I could get the script to run without asking for the password, it would run at startup as I have it set up. But thanks for the suggestion, I'll give it a try.

  6. #6
    that just jogged my memory, hopefully in a good way :-)

    In your current Ubuntu setup, can you actually run the "su" command from the command line and login as root? I remember when I first set up my ubuntu box they had disabled root logins through "su" and expected "sudo" instead. I re-enabled root logins like this:

    http://www.debianadmin.com/enable-an...-password.html

    For what it's worth, if I "su" to root and run /etc/init.d/mmserver start, it does NOT ask me for a password. It DOES say "nohup: ignoring input and appending output to `nohup.out'", though...but it starts the mmserver just fine. Trying it as a non-privileged user, however, fails to start it.

    -arm

  7. #7
    Junior Member
    Join Date
    Aug 2008
    Posts
    21
    Thanks. I'm not sure I want to enable login as su, as it seems that it is not recommended for security reasons (though I'm still relatively new to Ubuntu, so will read up some more about it).

    Any idea why the script needs to run this command with su in the first place? Although running the script asks me for my password, simply running:

    /path/to/MusicMagicServer start works without needing sudo or a password.

    In fact, if I edit the script so that the line that reads:

    su - <user> -c $MUSICHOME"MusicMagicServer start & > /dev/null"

    now reads

    /path/to/MusicMagicServer start & > /dev/null

    then I can run the script from the command line and it works with no password. It still doesn't run at boot; but this might be progress.

  8. #8
    the reason why it has the "su" in there is to run the mmserver as a nonpriveleged user instead of root. So, it is supposed to switch to that account when it launches mmserver...so, I can see why it would ask for a password if you aren't root to start with when you are playing around with it on the command line.

    I'm kinda of a linux newbie too but as I understand it all the scripts in your /etc/init.d are run by root during bootup. Actually, I think the symlinks that are found in your /etc/rc*.d are run based on the runlevel.

    Maybe there isn't a symlink in your /etc/rc*.d folder prompting it to run at start?

    https://help.ubuntu.com/community/UbuntuBootupHowto

    so, no, you shouldn't have to enable the root login, it was just a way to see if it worked for you that way or not.

    2 other things come to mind:

    1) I also installed BUM to make sure that mmserver started before squeezecenter (just like in that wiki article I linked before)

    2) the reason I had to switch to "nohup su" was because with 9.04 Ubuntu is moving away from the /etc/init.d method to something else, supposedly. They talk about it in that link above. Maybe on a fresh install it just doesn't work anymore and I got lucky with the upgrade?

    Anyway, it sounds like I'm just leading you on a wild goose chase -- maybe someone with more ubuntu knowledge can jump in and solve it better than me!

  9. #9
    Senior Member
    Join Date
    Mar 2008
    Location
    Netherlands
    Posts
    752
    Quote Originally Posted by slamhound View Post
    Thanks. I'm not sure I want to enable login as su, as it seems that it is not recommended for security reasons (though I'm still relatively new to Ubuntu, so will read up some more about it).

    Any idea why the script needs to run this command with su in the first place? Although running the script asks me for my password, simply running:

    /path/to/MusicMagicServer start works without needing sudo or a password.

    In fact, if I edit the script so that the line that reads:

    su - <user> -c $MUSICHOME"MusicMagicServer start & > /dev/null"

    now reads

    /path/to/MusicMagicServer start & > /dev/null

    then I can run the script from the command line and it works with no password. It still doesn't run at boot; but this might be progress.
    Try to add this line to your /etc/rc.local file: /path/to/MusicMagicServer start & > /dev/null

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •