This shows you the differences between two versions of the page.
install_wd [2012/01/03 07:31] cerberus created |
install_wd [2024/06/07 18:30] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | 1) Go to http:// | ||
- | 2) Log in to through SSH by the IP for the device, then Install Optware | ||
- | |||
- | < | ||
- | wget http:// | ||
- | sh setup-mybooklive.sh | ||
- | echo " | ||
- | echo " | ||
- | logout</ | ||
- | |||
- | |||
- | |||
- | Log back into the SSH | ||
- | |||
- | 3) Test Optware and install a simple text editor | ||
- | |||
- | < | ||
- | ipkg update | ||
- | ipkg install nano | ||
- | nano</ | ||
- | |||
- | |||
- | A basic editor opens, hit ctrl-x to close. | ||
- | |||
- | 4) Install Core-Utils | ||
- | |||
- | < | ||
- | ipkg install coreutils | ||
- | ln -s / | ||
- | |||
- | |||
- | |||
- | 5) Install Java | ||
- | |||
- | < | ||
- | apt-get install openjdk-6-jdk | ||
- | java -version | ||
- | export JAVA_HOME=/ | ||
- | |||
- | |||
- | |||
- | 6) Install Serviio and setup user account to run the program | ||
- | |||
- | < | ||
- | useradd serviio | ||
- | passwd serviio | ||
- | |||
- | mkdir / | ||
- | cd / | ||
- | wget http:// | ||
- | tar -xf serviio-0.6.0.1-linux.tar.gz | ||
- | chown serviio -R / | ||
- | |||
- | |||
- | |||
- | 7) Launch Serviio as a test | ||
- | |||
- | < | ||
- | cd serviio-0.6.0.1/ | ||
- | serviio.sh</ | ||
- | |||
- | |||
- | 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 | ||
- | |||
- | < | ||
- | tail -f / | ||
- | |||
- | |||
- | 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 | ||
- | |||
- | < | ||
- | nano / | ||
- | |||
- | |||
- | 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/ | ||
- | |||
- | < | ||
- | ######################################################### | ||
- | #- Daemon Script Configuration for Serviio Media Server | ||
- | #- By Ian Laird | ||
- | #- / | ||
- | ######################################################### | ||
- | |||
- | NAME=" | ||
- | DAEMON="/ | ||
- | SERVICE_ACCOUNT=" | ||
- | |||
- | |||
- | |||
- | 8b) create serviio | ||
- | |||
- | < | ||
- | #!/bin/sh | ||
- | # | ||
- | ######################################################### | ||
- | #- Daemon script for Serviio media server | ||
- | #- By Ian Laird; converted for Debian by Jacob Lundberg | ||
- | #- / | ||
- | ######################################################### | ||
- | # | ||
- | ### BEGIN INIT INFO | ||
- | # Provides: | ||
- | # Required-Start: | ||
- | # Required-Stop: | ||
- | # Default-Start: | ||
- | # Default-Stop: | ||
- | # X-Interactive: | ||
- | # Short-Description: | ||
- | # Description: | ||
- | # all kinds of networked devices. | ||
- | ### END INIT INFO | ||
- | |||
- | |||
- | . / | ||
- | |||
- | if [ -f / | ||
- | . / | ||
- | fi | ||
- | |||
- | |||
- | DAEMON_STOP=" | ||
- | NAME=" | ||
- | PIDFILE="/ | ||
- | TIMEOUT=10 | ||
- | |||
- | if [ -f / | ||
- | . / | ||
- | fi | ||
- | |||
- | [ -x " | ||
- | |||
- | |||
- | running() { | ||
- | if [ " | ||
- | 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 / | ||
- | . / | ||
- | | ||
- | fi | ||
- | |||
- | log_daemon_msg " | ||
- | start-stop-daemon --start -q -b -p " | ||
- | log_end_msg $? | ||
- | } | ||
- | |||
- | stop() { | ||
- | log_daemon_msg " | ||
- | if [ -r " | ||
- | PIDS=$(pstree -p $(<" | ||
- | if running " | ||
- | " | ||
- | for PID in $PIDS; do | ||
- | if running $PID > /dev/null; then | ||
- | kill -TERM $PID | ||
- | fi | ||
- | done | ||
- | fi | ||
- | COUNTDOWN=$TIMEOUT | ||
- | while let COUNTDOWN--; | ||
- | if ! running " | ||
- | 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 " | ||
- | log_end_msg 1 | ||
- | else | ||
- | rm -f " | ||
- | log_end_msg $? | ||
- | fi | ||
- | } | ||
- | |||
- | status() { | ||
- | echo -n "$NAME should be" | ||
- | if [ -r " | ||
- | echo -n " up with primary PID $(<" | ||
- | PIDS=$(pstree -p $(<" | ||
- | RUNNING=$(running " | ||
- | 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 " | ||
- | start) | ||
- | start | ||
- | ;; | ||
- | stop) | ||
- | stop | ||
- | ;; | ||
- | restart) | ||
- | stop | ||
- | start | ||
- | ;; | ||
- | status) | ||
- | status | ||
- | ;; | ||
- | *) | ||
- | log_success_msg " | ||
- | exit 1 | ||
- | ;; | ||
- | esac | ||
- | |||
- | exit 0</ | ||
- | |||
- | |||
- | |||
- | 8c) Set files to launch on startup | ||
- | |||
- | < | ||
- | chmod 755 / | ||
- | update-rc.d serviio defaults</ | ||
- | |||
- | |||
- | |||
- | Reboot MyBook Live. Check status when back up by using either the tail command above, or | ||
- | |||
- | < | ||
- | |||
- | |||
- | |||
- | 9) Access server through the console, use http:// | ||
- | |||
- | 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. | ||
- | |||
- | < | ||
- | / | ||
- | / | ||
- | | ||
- | <note important> |