User Tools

Site Tools


install_wd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

install_wd [2012/01/03 07:31]
cerberus created
install_wd [2024/06/07 18:30]
Line 1: Line 1:
-1) Go to http://mybooklive/UI/ssh (case sensitive) replace "mybooklive" if you have renamed it to something else, or replace it with its IP address. It's a hidden UI menu to enable SSH. 
  
-2) Log in to through SSH by the IP for the device, then Install Optware 
- 
-<code> 
-    wget http://mybookworld.wikidot.com/local--files/optware/setup-mybooklive.sh 
-    sh setup-mybooklive.sh 
-    echo "export PATH=$PATH:/opt/bin:/opt/sbin:." >> /root/.bashrc 
-    echo "export PATH=$PATH:/opt/bin:/opt/sbin:." >> /etc/profile 
-    logout</code> 
- 
- 
- 
-Log back into the SSH 
- 
-3) Test Optware and install a simple text editor 
- 
-<code> 
-    ipkg update 
-    ipkg install nano 
-    nano</code> 
- 
- 
-A basic editor opens, hit ctrl-x to close. 
- 
-4) Install Core-Utils 
- 
-<code> 
-    ipkg install coreutils 
-    ln -s /opt/bin/coreutils-dirname /usr/bin/dirname</code> 
- 
- 
- 
-5) Install Java 
- 
-<code> 
-    apt-get install openjdk-6-jdk 
-    java -version 
-    export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/jre/bin/java</code> 
- 
- 
- 
-6) Install Serviio and setup user account to run the program 
- 
-<code> 
-    useradd serviio 
-    passwd serviio 
- 
-    mkdir /usr/local/serviio/ 
-    cd /usr/local/serviio/ 
-    wget http://download.serviio.org/releases/serviio-0.6.0.1-linux.tar.gz 
-    tar -xf serviio-0.6.0.1-linux.tar.gz 
-    chown serviio -R /usr/local/serviio</code> 
- 
- 
- 
-7) Launch Serviio as a test 
- 
-<code> 
-    cd serviio-0.6.0.1/bin 
-    serviio.sh</code> 
- 
- 
-You will be at a blank line, it appears like nothing is happening, yet the server is starting. One way to confirm is to open another ssh window, log in and run 
- 
-<code> 
-    tail -f /usr/local/serviio/serviio-0.6.0.1/log/serviio.log</code> 
- 
- 
-This will show a live output of the serviio log file. When you are satisfied that it's launching, hit ctrl-c in both ssh windows. 
- 
-8) Setup Daemon to launch serviio upon bootup of your MyBook Live. 
-8a) create serviiod 
- 
-<code> 
-    nano /etc/default/serviiod</code> 
- 
- 
-Copy following code, the service account is the name of the account we created in step 6. Also, the Daemon is the path to the serviio.sh file, update if you use a different version/location. 
- 
-<code> 
-    ######################################################### 
-    #- Daemon Script Configuration for Serviio Media Server 
-    #- By Ian Laird 
-    #- /etc/default/serviiod 
-    ######################################################### 
- 
-    NAME="Serviio Media Server" 
-    DAEMON="/usr/local/serviio/serviio-0.6.0.1//bin/serviio.sh"    ## Update this to point at serviio_root/bin/serviio.sh 
-    SERVICE_ACCOUNT="serviio" ## DON'T RUN UNDER ROOT!</code> 
- 
- 
- 
-8b) create serviio 
- 
-<code> 
-        #!/bin/sh 
-        # 
-        ######################################################### 
-        #- Daemon script for Serviio media server 
-        #- By Ian Laird; converted for Debian by Jacob Lundberg 
-        #- /etc/init.d/serviio 
-        ######################################################### 
-        # 
-        ### BEGIN INIT INFO 
-        # Provides:          serviio 
-        # Required-Start:    $local_fs $remote_fs $network $syslog 
-        # Required-Stop:     $local_fs $remote_fs $network $syslog 
-        # Default-Start:     2 3 4 5 
-        # Default-Stop:      0 1 6 
-        # X-Interactive:     true 
-        # Short-Description: Start/stop serviio media server 
-        # Description:       The Serviio media server makes your media available to 
-        #                    all kinds of networked devices. 
-        ### END INIT INFO 
- 
- 
-        . /lib/lsb/init-functions 
- 
-        if [ -f /etc/default/rcS ]; then 
-                . /etc/default/rcS 
-        fi 
- 
- 
-        DAEMON_STOP=" -stop" 
-        NAME="$(basename $0)" 
-        PIDFILE="/var/run/serviiod.pid" 
-        TIMEOUT=10 
- 
-        if [ -f /etc/default/serviiod ]; then 
-                . /etc/default/serviiod 
-        fi 
- 
-        [ -x "$DAEMON" ] || exit 0 
- 
- 
-        running() { 
-                if [ "x$1" == "x" ]; then 
-                        echo 0 
-                        return 1 
-                fi 
- 
-                PS=$(ps h -p $(echo $1 | sed -r 's/[\t \n]+/ -p /') | wc -l) 
-                echo $PS 
- 
-                if [ $PS -gt 0 ]; then 
-                        return 0 
-                else 
-                        return 1 
-                fi 
-        } 
- 
- 
-        start() { 
-           # Set up correct LANG 
-              if [ -r /etc/default/locale ]; then 
-                 . /etc/default/locale 
-                 export LANG LANGUAGE LC_MESSAGES LC_ALL LC_CTYPE 
-              fi 
- 
-                log_daemon_msg "Starting Serviio media server daemon" "$NAME" 
-                start-stop-daemon --start -q -b -p "$PIDFILE" -m -c "${SERVICE_ACCOUNT}" -x "${DAEMON}" 
-                log_end_msg $? 
-        } 
- 
-        stop() { 
-                log_daemon_msg "Stopping Serviio media server daemon" "$NAME" 
-                if [ -r "$PIDFILE" ]; then 
-                        PIDS=$(pstree -p $(<"$PIDFILE") | awk -F'[\(\)]' '/^[A-Za-z0-9]/ { print $2" "$4; }') 
-                        if running "$PIDS" > /dev/null; then 
-                                "${DAEMON}" "${DAEMON_STOP}" 
-                                for PID in $PIDS; do 
-                                        if running $PID > /dev/null; then 
-                                                kill -TERM $PID 
-                                        fi 
-                                done 
-                        fi 
-                        COUNTDOWN=$TIMEOUT 
-                        while let COUNTDOWN--; do 
-                                if ! running "$PIDS" > /dev/null; then 
-                                        break 
-                                fi 
-                                if [ $COUNTDOWN -eq 0 ]; then 
-                                        for PID in $PIDS; do 
-                                                if running $PID > /dev/null; then 
-                                                        kill -KILL $PID 
-                                                fi 
-                                        done 
-                                else 
-                                        echo -n . 
-                                        sleep 1 
-                                fi 
-                        done 
-                fi 
- 
-                if running "$PIDS" > /dev/null; then 
-                        log_end_msg 1 
-                else 
-                        rm -f "$PIDFILE" 
-                        log_end_msg $? 
-                fi 
-        } 
- 
-        status() { 
-                echo -n "$NAME should be" 
-                if [ -r "$PIDFILE" ]; then 
-                        echo -n " up with primary PID $(<"$PIDFILE")" 
-                        PIDS=$(pstree -p $(<"$PIDFILE") | awk -F'[\(\)]' '/^[A-Za-z0-9]/ { print $2" "$4; }') 
-                        RUNNING=$(running "$PIDS") 
-                        if [[ $RUNNING && $RUNNING -gt 0 ]]; then 
-                                echo -n " and $RUNNING processes are running." 
-                        else 
-                                echo -n " but it is not running." 
-                        fi 
-                else 
-                        echo -n " stopped." 
-                fi 
-                echo 
-        } 
- 
- 
-        case "${1:-}" in 
-                start) 
-                        start 
-                ;; 
-                stop) 
-                        stop 
-                ;; 
-                restart) 
-                        stop 
-                        start 
-                ;; 
-                status) 
-                        status 
-                ;; 
-                *) 
-                        log_success_msg "Usage: /etc/init.d/$NAME {start|stop|restart|status}" 
-                        exit 1 
-                ;; 
-        esac 
- 
-        exit 0</code> 
- 
- 
- 
-8c) Set files to launch on startup 
- 
-<code> 
-    chmod 755 /etc/init.d/serviio 
-    update-rc.d serviio defaults</code> 
- 
- 
- 
-Reboot MyBook Live. Check status when back up by using either the tail command above, or 
- 
-<code>    /etc/init.d/serviio status</code> 
- 
- 
- 
-9) Access server through the console, use http://www.serviio.org/component/content/article/21#q2 as a reference. With respect to Mac, when entering the propertly, I placed them with the 3rd <dict> section, the one located after the property key. 
- 
-10) Two other commands to stop or start the service when signed into the ssh, though you could use the console to do the same. 
- 
-<code> 
-    /etc/init.d/serviio start 
-    /etc/init.d/serviio stop</code> 
-     
-<note important>FFmpeg may require updating as it seems an old version is contain in the APT get so read this on how to manually upgrade it http://wiki.serviio.org/doku.php?id=build_ffmpeg_linux</note> 
install_wd.txt ยท Last modified: 2024/06/07 18:30 (external edit)