You are here: Home » Topic » Automatically Starting mt-daapd on NSLU2

Automatically Starting mt-daapd on NSLU2

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #311
    Sherlock
    Guest

    I am not a Linux person and I have not been able to learn from my few Linux books what I need to do (or if it is possible) to automatically start mt-daapd when I start up my NSLU2. I made a bad choice for the USB hard drive I have attached and there seems to be no way to get the drive to spin down on no activity (Maxtor Personal Storage 3100). For now while I learn more about the NSLU2 and mt-daapd, I don’t want to figure out how to change to a different drive. I am simply powering down the NSLU2 and unplugging the drive (not even an on/off switch on the drive) overnight.

    I am running the unslung 6.8 on the NSLU2 with the USB drive attached as Disk 2. I am running mt-daapd v0.2.4.

    Thanks in advance for any pointers, etc.

    #4839
    fizze
    Participant

    Its not that hard.
    You just need some redirection scripts.
    If your music library is mounted upon the nslu2 startup and accesible, then a 1 line script would suffize.

    check out
    http://www.nslu2-linux.org/wiki/Unslung/DiversionScripts

    a script would look like this:

    #! /bin/sh
    /opt/etc/init.d/S60mt-daapd
    return 1

    sort of. If your music stuff isnt mounted, you can take care of the mount process here as well. And do various other stuff.

    #4840
    Sherlock
    Guest

    @fizze wrote:

    Its not that hard.
    You just need some redirection scripts.

    Thanks for the pointer and general directions. Half the battle being so new with Linux, etc. is knowing where to look. Once I get it working I will post the code which may help others who follow me. Will also be a chance for those more skilled in Linux to help me make sure I have done it the best way.

    #4841
    fizze
    Participant
    #! /bin/sh

    /bin/mount -t auto -o umask=0000 /dev/sdb1 /share/hdd/data > /dev/null
    swapon /share/hdd/data/swapfile
    sleep 5
    /opt/etc/init.d/S60mt-daapd

    thats my /unslung/rc.local.

    it mounts my NTFS drive which is on port 1, activates a swap file on said drive, and then starts mt-daapd.

    works like a charm.

    #4842
    Sherlock
    Guest

    @Sherlock wrote:

    Once I get it working I will post the code which may help others who follow me.

    As stated above, it was very simple once I knew where to look. Since I still have not been able to get the ‘Joe’ editor working, I used the ‘vi’ editor to create a file called ‘rc.local’ in the ‘/share/flash/data/unslung’ directory. In my case running unslung 6.8 and with the USB drive in Drive 2, this diversion script will only be run with the USB drive plugged in.

    The actual script was exactly as stated above:

    #! /bin/sh
    /opt/etc/init.d/S60mt-daapd
    return 1

    Thanks again to those in the forum who pointed me in the right direction.

    #4843
    Jxn
    Participant

    @Sherlock wrote:

    @Sherlock wrote:

    Once I get it working I will post the code which may help others who follow me.

    As stated above, it was very simple once I knew where to look. Since I still have not been able to get the ‘Joe’ editor working, I used the ‘vi’ editor to create a file called ‘rc.local’ in the ‘/share/flash/data/unslung’ directory. In my case running unslung 6.8 and with the USB drive in Drive 2, this diversion script will only be run with the USB drive plugged in.

    The actual script was exactly as stated above:

    #! /bin/sh
    /opt/etc/init.d/S60mt-daapd
    return 1

    Thanks again to those in the forum who pointed me in the right direction.

    If you have time to try, this should work.

    Ok, first instructions how linux boots SysV-way 🙂
    There is a BSD-way to, but then you don’t have /etc/init.d et al.

    Look in /etc/inittab. This files is the first linux looks into when it starts

    # The default runlevel.
    id:2:initdefault:

    This tells you what run level Linux starts with. In this case 2.

    So when Linux starts, it runs every program in /etc/rc2.d/ that starts with a ‘S’ in alphabetical order. To make it easy to spot the order, the names has two numbers after the ‘S’. All programs in /etc/rc2.d/ that starts with a ‘K’ is run when you tell Linux to stop (kill). Same with the order of programs run.
    When start, the program gets one argument ‘start’ and when stopping one argument ‘stop’.
    All programs are not in /etc/rc?.d/-directories though. There are only alias (symbolic links) to right script in /etc/init.d/.

    So to manually stop nfs, you usally start with command

    /etc/init.d/nfs-common stop

    Becouse that script start and stops nfs. Read it to see what else it can do.
    So as root, you usally do this to start and stop different services. To make nfs to start when linux start, there is an alias from /etc/init.d/nfs-common to /etc/rc2.d/S21nfs-common (or any usabel number, don use this!)
    You can create it with a command like this

    ln -s /etc/init.d/nfs-common /etc/rc2.d/S21nfs-common

    Don’t do this!!! It usally made byt the package you installed it with.

    So, to make mt-daapd start att boot, make this symbolic link (alias)

    ln -s /opt/etc/init.d/S60mt-daapd /etc/rc2.d/S60mt-daapd

    If you can start and stop daapd with that program/script

    When you have started, look in /var/log/messages (and other files in same directory) for messages that say something about daapd. Those log files are important to see what happens when linux starts.

    Hope it gives you some help understand how Linux works.[/code][/quote]

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Setup Issues’ is closed to new topics and replies.