[Tutorial] Installing UMS 4.4.0 on Ubuntu Server 14.04.1
Posted: Wed Jan 14, 2015 8:36 am
This is an update and correction to my original post located here -> viewtopic.php?f=10&t=1519
So, I've just built a truly badass system. I'm talking the whole nine yards, ECC Ram, Xeon Processor... you name it. I'm planning on using FreeNAS once I get the 10 4TB drives. But that's going to take a few months. In the mean time, I'm using Ubuntu 14.04.1. So my Google search pulled up my old instuctions and well... they suck. So here are the new instructions.
I suggest doing this over SSH since it gives the ability to copy paste into the terminal. I'm using putty in Windows 8.1 to interact with my Headless Ubuntu Server.
1. This is going to be done in root, and rather then put sudo in front of every SINGLE line and forget a few times at critical points, we'll just jump into it.
2. The nice people at Web Upd8 have taken the Java headache off our hands and put together nice package for our convenience. That installs Java 7 and sets environmental variables. I suggest doing it one line at a time.
3. Now some pre-reqs. Do we need them all? I have no idea. If you don't have the space for this, why are you setting a streaming service up? Really, get your priorities straight.
4. Lets get UMS 4.4.0. This is going to be downloaded, extracted, and misplaced. I'm putting it into /usr since I have no idea about Linux install policies, and I really don't care. It's like /media vs /mnt arguments.
5. Now lets put together a nice init.d script that will make starting and stopping the media server a breeze.
Put this into the ssh window. Don't even try typing all of this.
Push Ctrl-o to output the file, then Ctrl-x to exit.
6. We need to make it executable so:
7. If you want it to start with Linux, then add it to the rc.
Now let us turn it on:
To stop it:
To edit it's config, the config file is located at
That wraps it up. Enjoy your media streaming server.
Sources:
http://www.webupd8.org/2012/01/install- ... u-via.html <- Java Instuctions
viewtopic.php?f=10&t=1519 <- My older post, plus note on chmod
viewtopic.php?f=10&t=2211#p12013 <- Some newer info
So, I've just built a truly badass system. I'm talking the whole nine yards, ECC Ram, Xeon Processor... you name it. I'm planning on using FreeNAS once I get the 10 4TB drives. But that's going to take a few months. In the mean time, I'm using Ubuntu 14.04.1. So my Google search pulled up my old instuctions and well... they suck. So here are the new instructions.
I suggest doing this over SSH since it gives the ability to copy paste into the terminal. I'm using putty in Windows 8.1 to interact with my Headless Ubuntu Server.
1. This is going to be done in root, and rather then put sudo in front of every SINGLE line and forget a few times at critical points, we'll just jump into it.
Code: Select all
sudo su
Code: Select all
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer
apt-get install oracle-java7-set-default
Code: Select all
sudo apt-get install mediainfo dcraw vlc-nox mplayer mencoder openssh
Code: Select all
cd ~
wget http://sourceforge.net/projects/unimediaserver/files/Official%20Releases/Linux/UMS-4.4.0-Java7.tgz
tar -xvzf UMS-4.4.0-Java7.tgz
mv ums-4.4.0 /usr/ums
rm UMS-4.4.0-Java7.tgz
Code: Select all
sudo nano /etc/init.d/ums
Code: Select all
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: ums
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts UMS program.
# Description: Java Upnp Media Server dedicated to PS3
### END INIT INFO
#set -x
# Author: Papa Issa DIAKHATE <[email protected]>
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="Universal Media Server"
NAME=ums
UMS_PROFILE=/etc/ums
DAEMON=/usr/ums/UMS.sh
DAEMON_OPTS="console"
SCRIPTNAME=/etc/init.d/ums
UMS_START=1 # Wether to start or not UMS ver at boot time.
DODTIME=30 # Time to wait for the server to die, in seconds.
# If this value is set too low you might not
# let the program to die gracefully and 'restart' will not work
test -x $DAEMON || exit 1
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# Include ums defaults if available
if [ -f "/etc/default/$NAME" ] ; then
. /etc/default/$NAME
fi
# May we run the init.d script ?
[ $UMS_START = 1 ] || exit 1
#--------------------------------------------------------------------------
# Some color codes
txtred=$'\e[0;31m' # Red
txtylw=$'\e[0;33m' # Yellow
txtrst=$'\e[0m' # Text Reset
#--------------------------------------------------------------------------
warnout(){
echo >&2 -e ""$txtylw"Warning:$txtrst $1"
}
#--------------------------------------------------------------------------
running(){
pid=`pgrep -f 'java .*ums.jar.*'`
}
#--------------------------------------------------------------------------
do_start(){
running && { warnout "$NAME is already running !"; exit 0; }
echo "Starting $DESC : $NAME"
UMS_PROFILE="$UMS_PROFILE" start-stop-daemon --start --quiet --background --oknodo \
--exec $DAEMON -- $DAEMON_OPTS
}
#--------------------------------------------------------------------------
do_stop(){
running || { warnout "$NAME is NOT running !"; exit 0; }
local countdown="$DODTIME"
echo -e "Stopping $DESC : $NAME \c "
kill -9 $pid
while running; do
if (($countdown >= 0)); then
sleep 1; echo -n .;
((--countdown))
else
break;
fi
done
echo
# If still running, then try to send SIGINT signal
running && { \
echo >&2 "Using kill -s SIGINT instead"; \
echo >&2 "If you see this message again, then you should increase the value of DODTIME in '$0'."; \
kill -2 $pid; \
}
if [ -e "/usr/share/ums/debug.log" ]; then
count=9
while [ $count -ge 1 ]
do
if [ -e "/usr/share/ums/debug.log.$count" ]; then
plus=$((count+1))
mv "/usr/share/ums/debug.log.$count" "/usr/share/ums/debug.log.$plus"
fi
count=$((count-1))
done
if [ -e "/usr/share/ums/debug.log" ]; then
mv "/usr/share/ums/debug.log" "/usr/share/ums/debug.log.1"
fi
fi
return 0
}
#--------------------------------------------------------------------------
do_force-stop(){
running || { warnout "$NAME is NOT running !"; exit 0; }
echo "Stopping $DESC : $NAME"
kill -9 $pid
if [ -e "/usr/share/ums/debug.log" ]; then
count=9
while [ $count -ge 1 ]
do
if [ -e "/usr/share/ums/debug.log.$count" ]; then
plus=$((count+1))
mv "/usr/share/ums/debug.log.$count" "/usr/share/ums/debug.log.$plus"
fi
count=$((count-1))
done
if [ -e "/usr/share/ums/debug.log" ]; then
mv "/usr/share/ums/debug.log" "/usr/share/ums/debug.log.1"
fi
fi
}
#--------------------------------------------------------------------------
do_status(){
echo -n " * $NAME is "
( running || { echo "NOT running "; exit 0; } )
( running && { echo "running (PID -> $(echo $pid))"; exit 0; } )
}
#--------------------------------------------------------------------------
case "$1" in
start|stop|force-stop|status)
do_${1}
;;
restart|reload)
do_stop
do_start
;;
force-restart|force-reload)
do_force-stop
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|force-stop|restart|force-restart|reload|force-reload|status}"
exit 1
;;
esac
6. We need to make it executable so:
Code: Select all
chmod +x /etc/init.d/ums
Code: Select all
update-rc.d ums defaults
Code: Select all
service ums start
Code: Select all
service ums stop
Code: Select all
/usr/ums/UMS.conf
Sources:
http://www.webupd8.org/2012/01/install- ... u-via.html <- Java Instuctions
viewtopic.php?f=10&t=1519 <- My older post, plus note on chmod
viewtopic.php?f=10&t=2211#p12013 <- Some newer info