Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1

    MusicIP Headless not running in Fedora 26 Linux - script/systemd issues

    Has anyone had any success running MusicIP headless in Fedora 26? After doing a clean install of Fedora, I'm unable to get the scripts to run. I have tried running the scripts from /etc/init.d as is, attempted to modify them to work, tried to convert the scripts to pure systemd scripts that don't call the original scripts, and converting them to systemd scripts, but without success.

    I am by no means an expert in Linux, but have had a functioning LMS server on Fedora 4 through 14 with MusicIP for 12 years. Most of the errors have been "file not found" in referencing the original scrip in many locations in many variations, but I've been able to get through these. Much tougher has been the problem where the unit loads and deactivated it self right away. I have tried service types of simple, forking and one shot. The only way I can get it to run is on the command line, changing to the /MusicMagicMixer directory, and running ./MusicMagicServer start/stop.

    When working with systemd to run the scripts in /etc/init.d, my process looks something like this:

    sudo systemctl disable /etc/systemd/system/mmserver.service
    sudo nano /etc/init.d/mmserver
    sudo systemctl enable /etc/systemd/system/mmserver.service
    sudo systemctl daemon-reload

    At this point, either:
    reboot
    Or:
    sudo systemctl start mmserver.service

    I use a similar approach when the systemd script calls the init.d script

    After many days of working with this, I'm at an impass. Anyone had any success with this, or have any suggestions?
    Thanks!

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    South Coast, NSW, Australia
    Posts
    1,151
    matrixed99, have you got any further with this ?

    The only help I can offer is Spicefly - http://www.spicefly.com/article.php?...headless-linux
    and the script that Vortexbox 2.4 supplied for Fedora 23.
    Attached Files Attached Files
    A camel is a racehorse designed by a committee.

    Seen sprayed on the outside wall of the local library -
    Three things I hate in life :
    1. Vandalism
    2. Irony
    3. Lists

  3. #3

    MusicIp Headless not running in Fedora 26 Linux - script/systemd issues

    Wirrunna,

    So kind of you to send the script and links. The good news is, the scripts worked! I previously was only able to load MusicIP by changing to the /MusicMagicMixer directory and inputting ./MusicMagicServer start in the terminal. With the script, I can run the script itself without changing directories and am able to start|stop MusicIP, but a password is requested and required. It will not to run at startup successfully. I've tried a few approaches to correct this, but none have been successful so far.

    1 - The stock init.d script doesn't run successfully after a reboot, or login/logout

    2 - Tried the following to convert original script to system.d
    sysv.init.script.to.systemd.unit.file.md

    Copy the file to /etc/init.d/mmserver.
    Enable the SysV service: chkconfig --add mmserver.
    Enable the SysV service: chkconfig mmserver on.
    Start the service: service mmserver start .


    This is also unsuccessful. The script runs and exits immediately each time it is run, on the command line or after booting.

    3. The creation of a new mmserver.service unit

    I've tried many approaches new systemd scripts, none successfully. I've tried different types (simple, forked, oneshot). All of them seem to fail because the start process exits immediately after running. Even when journalctl shows no errors, this is the case.

    I use the MusicIP gui in Windows, and write the analysis to the flac files before moving them the Linux server running LMS, so I only need the headless MusicIP. I'm going to study systemd more carefully (sadly), but some questions for anyone who might know:

    Can MusicIP be run on Wine on the same machine as LMS and work with it?

    Is Java used in the headless install of MusicIP?

    If all else fails, manually running MusicIP and LMS would work, but after having it run at startup for ten years, not a first choice.

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Location
    South Coast, NSW, Australia
    Posts
    1,151
    matrixed99, you are way beyond my Linux abilities, maybe something inthis thread may help -
    http://forums.slimdevices.com/showth...hlight=musicip
    A camel is a racehorse designed by a committee.

    Seen sprayed on the outside wall of the local library -
    Three things I hate in life :
    1. Vandalism
    2. Irony
    3. Lists

  5. #5
    Senior Member
    Join Date
    Jul 2010
    Location
    Paris, France
    Posts
    145
    Java is not necessary to run MusicIp headless.
    It's only needed if you want to run the gui "MusicMagicMixer" that is located in the MusicIp directory and shows a quite similar to windows gui.
    It can run with java runtime 1.5 (jre 1.5) under linux, but I couldn't get it to work with newer versions of java.

    I think I tried to run windows version of MusicMagicMixer with wine but without success. Anyway, it's not really necessary. Headless MusicIp is enough to create mixes and if you want a gui to create moods and so an, you can use the java gui, I would post the instructions then to have it running, it's quite simple.

    Could you post the mmserver script, so I could have a look at it ?
    Last edited by Antoniop; 2017-09-01 at 06:27.
    LMS 7.9.0
    on Linux Mageia 5 and RPI 3
    1 SB3, 2 radio, 1 touch
    Plugins : Trackstat, Smartmix, MusicIP, ...

  6. #6
    Antoniop,

    Thanks for the Java information. I've been running the MusicMagicMixer GUI on a Windows laptop for years, writing the analysis to the files, and running LMS and MusicIP on Fedora Linux. I'm going to try using Java 1.5 to run the GUI on Linux, as you have recommended.

    The current status of my MusicIP install on Fedora 26 is that I can run it manually successfully after startup, but it starts and then immediately stops without error during startup. There are no errors, at least that I have been able to find, viewing the logs with systemctl and journalctl. Running the service after startup asks for a password, and then loads MusicIP headless successfully. Here are the scripts and logs:

    /etc/init.d/mmserver


    # Provides: mmserver
    # Required-Start:
    # Default-Start: 3 4 5
    # Default-Stop: 0 1 2 6
    # Short-Description: Startup script for the MusicMagic Server
    # Description: MusicMagic Server provides music mixes for Squeezebox Server
    ### END INIT INFO
    # Send output to syslog
    # exec 1> >(logger -s -t $(basename $0)) 2>&1
    # NON-PRIVILEGED USER TO RUN MUSICMAGICSERVER.
    # Doesn't work with user squeezeboxserver, so use root instead.
    USER=m

    # PATH TO THE MUSICMAGICMIXERSERVER
    export MUSICHOME=/opt/MusicMagicMixer/

    case $1 in
    start)
    if pgrep -f MusicMagicServer > /dev/null
    then
    echo "MusicIP Server is already running"
    else
    echo "Starting MusicIP Server"
    su - $USER -c $MUSICHOME"MusicMagicServer start & > /dev/null"
    fi
    ;;
    stop)
    if pgrep -f MusicMagicServer > /dev/null
    then
    echo "Stopping MusicIP Server"
    su - $USER -c $MUSICHOME"MusicMagicServer stop & > /dev/null"
    else
    echo "MusicIP Server is already stopped"
    fi
    ;;
    status)
    if pgrep -f MusicMagicServer > /dev/null
    then
    echo "MusicIP Server is running"
    else
    echo "MusicIP Server is stopped"
    fi
    ;;
    *)
    echo "Usage: service mmserver { start | stop | status }"
    ;;
    esac

    /etc/systemd/system/mmserver.service

    [Unit]
    Description=Start MusicIP Server
    After=network.target
    Before=squeezeboxserver.service

    [Service]
    Type=simple
    # Environment=/opt/MusicMagicMixer
    ExecStart=/bin/bash -c "echo OFF > MusicMagicServer start & > /dev/null"
    RemainAfterExit=yes
    ExecStop=/bin/bash -c "echo ON > MusicMagicServer stop & > /dev/null"

    [Install]
    #WantedBy=basic.target
    WantedBy=multi-user.target

    Output from systemctl status mmserver

    Ô—Ć mmserver.service - Start MusicIP Server
    Loaded: loaded (/etc/systemd/system/mmserver.service; enabled; vendor preset: disabled)
    Active: active (exited) since Fri 2017-09-01 19:53:50 EDT; 38min ago
    Process: 902 ExecStart=/bin/bash -c echo OFF > MusicMagicServer start & > /dev/null (code=exited, status=0/SUCCESS)
    Main PID: 902 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
    CGroup: /system.slice/mmserver.service

    Thanks for the help and for spending the time to look at this!

  7. #7
    Senior Member
    Join Date
    Jul 2010
    Location
    Paris, France
    Posts
    145
    Your mmserver script looks ok.

    But mmserver.service looks wrong.
    Try the following, I don't have fedora, I'm with mageia, which is also rpm-based, I think it should work.
    Make sure that your script mmserver is located in dir /etc/init.d
    And I would also remove all links to mmserver script first.
    You can use this to find them :
    Code:
    $ find /etc/ -name "*mmserver" 2>/dev/null
    Here is my mmserver.service :
    /etc/systemd/system/mmserver.service :
    Code:
    [Unit]
    Description=MusicMagicServer
    After=squeezeboxserver.service
    Requires=squeezeboxserver.service 
    
    [Service]
    Type=oneshot
    RemainAfterExit=no
    ExecStart=/etc/init.d/mmserver start
    ExecStop=/etc/init.d/mmserver stop 
    
    [Install]
    WantedBy=multi-user.target
    To enable it at boot , type as root user :
    Code:
    systemctl enable mmserver.service
    status :

    Code:
     systemctl status mmserver.service
    start mmserver:
    Code:
    systemctl start mmserver.service
    If you can start mmserver as root with the systemctl command, that should be ok.

    To enable the java gui, download the 32 bits version of java jre 1-5 at :
    http://www.oracle.com/technetwork/ja...e5-419410.html
    Its the Linux self-extracting file jre-1_5_0-linux-i586.bin
    copy it in your MusicIp home, /opt/MusicMagicMixer/

    and extract it by running the .bin
    in a terminal :
    Code:
    cd /opt/MusicMagicMixer/
    chmod u+x jre-1_5_0-linux-i586.bin
    ./jre-1_5_0-linux-i586.bin
    it should create a jre1.5.0/ sub-directory
    To run the java gui,
    You'll have to type :
    Code:
    export JAVA_HOME=jre1.5.0/
    ./MusicMagicMixer
    To say the truth, you'll notice the java gui is ugly, but it's quite functional.

    I made this very simple bash to run it easily :
    (don't forget to make it runnable)
    run_musicipgui.bsh
    Code:
    #!/bin/bash
    cd /opt/MusicMagicMixer/
    export JAVA_HOME=jre1.5.0/
    ./MusicMagicMixer
    I hope that it will work. Sorry if my english is not very good.
    Regards
    Last edited by Antoniop; 2017-09-02 at 16:53.
    LMS 7.9.0
    on Linux Mageia 5 and RPI 3
    1 SB3, 2 radio, 1 touch
    Plugins : Trackstat, Smartmix, MusicIP, ...

  8. #8
    I've modified the /etc/systemd/system/mmserver.service but when I enable it, the init.d script fails and causes the mmserver.service to fail:

    mmserver[4797]: /etc/init.d/mmserver: line 27: /opt/MusicMagicMixer/MusicMagicServer start & > /dev/null: No such file or directory
    mmserver.service: Unit entered failed state.
    Sep 04 01:37:12 sagsqueezebox systemd[1]: mmserver.service: Failed with result 'exit-code'.

    I had to take the su - $USER -c part of the mmserver init.d script out because it resulted in the same error

    Sorry my Linux skills are very basic, I can't seem to figure this out. And thanks again for taking the time to help, your English is fine

    matrixed99

  9. #9
    Senior Member
    Join Date
    Jul 2010
    Location
    Paris, France
    Posts
    145
    Quote Originally Posted by matrixed99 View Post
    I've modified the /etc/systemd/system/mmserver.service but when I enable it, the init.d script fails and causes the mmserver.service to fail:

    mmserver[4797]: /etc/init.d/mmserver: line 27: /opt/MusicMagicMixer/MusicMagicServer start & > /dev/null: No such file or directory
    mmserver.service: Unit entered failed state.
    Sep 04 01:37:12 sagsqueezebox systemd[1]: mmserver.service: Failed with result 'exit-code'.

    I had to take the su - $USER -c part of the mmserver init.d script out because it resulted in the same error

    Sorry my Linux skills are very basic, I can't seem to figure this out. And thanks again for taking the time to help, your English is fine

    matrixed99
    I believe it's just a problem of file rights. Maybe you already checked all this and sorry if I'll mention things that you already know.
    The script must be run by a regular user, so the files rights should be set accordingly. I noticed that vortex box uses root as the user to run the script, but it's to be avoided. In case of a problem, a program run by a standard user can't damage too much your system nor can be used as a security breach.
    You can notice that LMS owner is not root, but squeezeboxserver.
    I noticed in your mmserver file you have the line
    USER=m
    I suppose m is not the right name of the user, but it has to be the real user that will run the program. If not, you should correct it.
    You should also leave the line :
    su - $USER -c $MUSICHOME"MusicMagicServer start & > /dev/null"
    as it is, because it's fine.
    It means that the executable MusicMagicServer will be run with user $USER.
    It's a bit strange that you can run it from a terminal but it fails at startup.
    You have to check that all files in /opt/MusicMagicMixer/ either are owned by $USER or this user has read and execute permissions on these files.
    Log in a terminal with the user login and check all files :
    Code:
    cd /opt/MusicMagicMixer/
    ls -la
    gives you files owners and rights. The first field is file rights. the first letter is file type, then you have rights for owner 3 letters (Read, Write, eXecute), group and world. Then you have user owner and group owner. So if owner is $USER, then you should have -rwx...... in rights for scripts and executables, -rw-... for other files, if not you should have ....rwx (rwx at the end, for world). But I recommend to have user owner and group owner is $USER for all files and directories.
    To do this, open a terminal, log as root and type (replacing <user> by the actual user):
    Code:
    cd /opt
    chown -R <user> MusicMagicMixer/
    chgrp -R <user> MusicMagicMixer/
    Hope this could help.
    Regards
    LMS 7.9.0
    on Linux Mageia 5 and RPI 3
    1 SB3, 2 radio, 1 touch
    Plugins : Trackstat, Smartmix, MusicIP, ...

  10. #10
    Ran the code:

    cd /opt/MusicMagicMixer/
    ls -la

    root was the owner, so I ran

    cd /opt
    chown -R <user> MusicMagicMixer/
    chgrp -R <user> MusicMagicMixer/

    Script is now:(User is not just m)

    #! /bin/sh

    # Provides: mmserver
    # Required-Start:
    # Default-Start: 3 4 5
    # Default-Stop: 0 1 2 6
    # Short-Description: Startup script for the MusicMagic Server
    # Description: MusicMagic Server provides music mixes for Squeezebox Server
    ### END INIT INFO
    # Send output to syslog
    # exec 1> >(logger -s -t $(basename $0)) 2>&1
    # NON-PRIVILEGED USER TO RUN MUSICMAGICSERVER.
    # Doesn't work with user squeezeboxserver, so use root instead.
    USER=m

    # PATH TO THE MUSICMAGICMIXERSERVER
    export MUSICHOME="/opt/MusicMagicMixer/"

    case $1 in
    start)
    if pgrep -f MusicMagicServer > /dev/null
    then
    echo "MusicIP Server is already running"
    else
    echo "Starting MusicIP Server"
    su - $USER -c $MUSICHOME"MusicMagicServer start & > /dev/null"
    fi
    ;;
    stop)
    if pgrep -f MusicMagicServer > /dev/null
    then
    echo "Stopping MusicIP Server"
    su - $USER -c $MUSICHOME"/MusicMagicServer stop & > /dev/null"
    else
    echo "MusicIP Server is already stopped"
    fi
    ;;
    status)
    if pgrep -f MusicMagicServer > /dev/null
    then
    echo "MusicIP Server is running"
    else
    echo "MusicIP Server is stopped"
    fi
    ;;
    *)
    echo "Usage: service mmserver { start | stop | status }"
    ;;
    esac

    At the terminal, ran:

    sudo systemctl daemon-reload

    sudo systemctl start mmserver.service

    Receive the following error message:

    Job for mmserver.service failed because the control process exited with error code.
    See "systemctl status mmserver.service" and "journalctl -xe" for details.

    Ran the following:

    journalctl -xe

    Received the following error:

    SELinux is preventing mmserver from read access on the file /usr/bin/su.

    ***** Plugin catchall (100. confidence) suggests **************************

    If you believe that mmserver should be allowed read access on the su file by default.
    Then you should report this as a bug.
    You can generate a local policy module to allow this access.
    Do
    allow this access for now by executing:
    # ausearch -c 'mmserver' --raw | audit2allow -M my-mmserver
    # semodule -X 300 -i my-mmserver.pp

    Followed the suggestion in the error message:

    # ausearch -c 'mmserver' --raw | audit2allow -M my-mmserver
    # semodule -X 300 -i my-mmserver.pp

    Ran the code to systemctl daemon-reload and start mmserver.service and received the same error.

    Some progress here, but still working on it. Is MusicMagicServer a 32-bit app? Could running it on a 64bit system be the problem?

Posting Permissions

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