PlayStation Media Server

PlayStation Media Server is a java app that serves up files to your PS3.

  • Installed to /usr/libexec/pms/
  • Fix linux/tsMuxer file permissions
  • link debug.log to /dev/null
    $ ls -l /usr/libexec/pms/debug.log 
    lrwxrwxrwx 1 root root 9 2010-02-16 23:29 /usr/libexec/pms/debug.log -> /dev/null

init script

Crude, but works.

/etc/rc.d/rc.pmsd

#!/bin/sh
#
# PS3 MediaServer Slackware init script
#
# make symlink for debug log:
# /usr/local/bin/pms/debug.log -> /dev/null
#
# stopping works
# starting works (the java_opts work)
# logging added
 
JAVA_HOME=/usr/lib/java
export JAVA_HOME
JAVA_OPTS='-Djava.awt.headless=true'
export JAVA_OPTS
 
PMSDIR=/usr/libexec/pms
#PMSDIR=/home/john/bin/pms/pms-linux-1.10.5
 
PMSLOG=/var/log/pms.log
PMS=$PMSDIR/PMS.sh
PMSJAR=pms.jar
 
NAME='PS3 MediaServer'
 
PMSPID=`pgrep -f "\-jar $PMSDIR/$PMSJAR" || echo 0`
KILLTIME=5
 
start() {
    if [ $PMSPID == 0 ]; then
        if [ -x $PMS ]; then
            echo "Starting $NAME: $PMS"
            cd $PMSDIR
            $PMS >> $PMSLOG 2>&1 &
            sleep 1
        fi
    else
        echo "$NAME already running. pid: $PMSPID"
    fi
}
 
stop() {
    if [ $PMSPID == 0 ]; then
        echo "$NAME not running, no pid to kill"
    else
        echo "Stopping $NAME..."
        killpms
    fi
}
 
killpms() {
    PMSPID=`pgrep -f "\-jar $PMSDIR/$PMSJAR" || echo 0`
    if [ $PMSPID != 0 ]; then
       echo "killing PID $PMSPID"
       kill $PMSPID 2> /dev/null
       sleep $KILLTIME
       killpms
    fi
}
 
# How to call it.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        start
        ;;
    status)
        echo "$NAME pid: $PMSPID"
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart|status}"
        ;;
esac

logrotate script

Put the following into /etc/logrotate.d/pms

/var/log/pms.log {
    sharedscripts
    postrotate
        /etc/rc.d/rc.pmsd restart
    endscript
}

PMS.conf

thumbnails = false
mencoder_ass = true
network_interface = eth0
hostname = 192.168.1.2
mencoder_remux_ac3 = true
folders = \/wspace
minimized = true
linux/server/playstation_media_server.txt · Last modified: 2011/08/30 12:35 by john
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki