PS3 Media Server as a Linux Service

For help and support with issues specific to Linux/Unix
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

Re: PS3 Media Server as a Linux Service

Postby wonslung » Tue Feb 17, 2009 7:33 pm

ok, i don't know what i did wrong but i keep getting this error
Couldn't find /usr/local/sbin/PMS_FOLDER/PMS.sh

let me just post my script...
Code: Select all
#Modify path as per your need..here is default for me..
PATH=/usr/local/sbin/PMS_FOLDER:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin

DESC="PS3 UPnP Media Server"
NAME=PMS.sh
#Don't forget to put proper PMS folder name here.
DAEMON=/usr/local/sbin/PMS_FOLDER/PMS.sh

# replace userid with the one ,with which access you want to run PMS..This user and group # should exist in /etc/passwd and /etc/group...
PMSUSER=1000
PMSGROUP=1000

# Exit if the package is not installed
if [ ! -x "$DAEMON" ]; then
{
echo "Couldn't find $DAEMON"
exit 99
}
fi

#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
cd PMS_FOLDER
start-stop-daemon --start --quiet --chuid $PMSUSER:$PMSGROUP --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --chuid $PMSUSER:$PMSGROUP --exec $DAEMON \
|| return 2
}


#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --signal 2 --retry 5 --quiet --name java
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
return "$RETVAL"
}

case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop}" >&2
exit 3
;;
esac

:


my folder is at /usr/local/sbin/PMS_FOLDER
the folder has a valid conf, i edited the last line of the PMS.sh with
Code: Select all
cd /usr/local/sbin/PMS_FOLDER/
exec "$JAVA" $JAVA_OPTS -Xmx768M -Djava.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -jar "$PMS_JAR" "$@" &


i have no idea where i'm going wrong but i'm sure it's something stupid
wonslung
 
Posts: 20
Joined: Tue Feb 17, 2009 7:17 am

Re: PS3 Media Server as a Linux Service

Postby sanju » Wed Feb 18, 2009 6:15 am

I guess you would have already checked these things..but let me ask anyway

When you say:

"my folder is at /usr/local/sbin/PMS_FOLDER
the folder has a valid conf, i edited the last line of the PMS.sh with"

do you mean folder "pms-linux-1.04" is inside /usr/local/sbin/PMS_FOLDER, if yes then you should replace "/usr/local/sbin/PMS_FOLDER" with "/usr/local/sbin/PMS_FOLDER/pms-linux-1.04" in PS3MediaServerd and PMS.sh.
sanju
 
Posts: 19
Joined: Wed Jan 28, 2009 10:31 am

Re: PS3 Media Server as a Linux Service

Postby wonslung » Wed Feb 18, 2009 6:48 am

man, i'm so sorry for the confusion...i actually renamed the folder to PMS_FOLDER because i thought that was what i needed to do....then when i kept getting errors i kept changing the script...ok, so i'm going to change the folder name to pms the path for PMS.sh and PMS.conf and all the other stuff will now be: /usr/local/sbin/pms/
so...heres what keeps confusing me

do i replace the words PMS_FOLDER with the folder or do i replace it with the path? or do i leave it alone and then put the path AFTER that...also where it asked for userid do i use the uid number or name

what should this line say?
PATH=PMS_FOLDER:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin

then, what should this line be

DAEMON=PMS_FOLDER/PMS.sh

again just for clarification, the problem i was having i think, was due to confusion, i thought you said to replace every instance of PMS_FOLDER with the actual PMS_FOLDER
then when that didnt' work i tried other stuff but nothing worked....any help would be greatly appreciated
wonslung
 
Posts: 20
Joined: Tue Feb 17, 2009 7:17 am

Re: PS3 Media Server as a Linux Service

Postby sanju » Wed Feb 18, 2009 9:45 am

wonslung wrote:do i replace the words PMS_FOLDER with the folder or do i replace it with the path? or do i leave it alone and then put the path AFTER that...also where it asked for userid do i use the uid number or name


You should replace the words PMS_FOLDER with complete path (which is "/usr/local/sbin/pms" in your case). userid is valid user name on the system.

wonslung wrote:what should this line say?
PATH=PMS_FOLDER:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin


This line should say:
PATH=/usr/local/sbin/pms:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin

wonslung wrote:then, what should this line be

DAEMON=PMS_FOLDER/PMS.sh


This should be
DAEMON=/usr/local/sbin/pms/PMS.sh

-sanju.
sanju
 
Posts: 19
Joined: Wed Jan 28, 2009 10:31 am

Re: PS3 Media Server as a Linux Service

Postby wonslung » Wed Feb 18, 2009 10:29 am

man, this is getting seriously frustrating....i had everything right the first time and it didn't work, you confirmed it...i just deleted everything and started from scratch and it still wont' work
my path is /usr/local/sbin/pms/
in that directory i have everything, and i can run it manually from there if i do sh PMS.sh

i set the script up exactly like you said and every time, no matter what i get this error

Couldn't find /usr/local/sbin/pms/PMS.sh

i'm running ubuntu server 8.10 amd64
does this make a difference

also, when i run this manually i have to type

sudo sh PMS.sh

i have a valid config file
i changed the lines in PMS.sh

i'm pulling my hair out here
wonslung
 
Posts: 20
Joined: Tue Feb 17, 2009 7:17 am

Re: PS3 Media Server as a Linux Service

Postby wonslung » Wed Feb 18, 2009 10:40 am

ok, i'm officially an idiot....

i forgot to
sudo chmod +x PMS.sh

the script is starting to work but now i'm getting this error

java.io.IOException: Temp folder is not writeable: /tmp/javaps3media
at net.pms.configuration.TempFolder.assertFolderIsValid(TempFolder.java:76)
at net.pms.configuration.TempFolder.getSystemTempFolder(TempFolder.java:66)
at net.pms.configuration.TempFolder.getTempFolder(TempFolder.java:40)
at net.pms.configuration.TempFolder.getTempFolder(TempFolder.java:32)
at net.pms.configuration.PmsConfiguration.getTempFolder(PmsConfiguration.java:156)
at net.pms.PMS.init(PMS.java:301)
at net.pms.PMS.get(PMS.java:895)
at net.pms.PMS.main(PMS.java:957)


well, i temporarily fixed this by setting user as root in the script...if anyone knows how to get another user able to write to java's temp directories let me know

also, went back and read the original guide...it never says to chmod +x PMS.sh
it doesn't come like this by default when you download it so it might be worth adding to the guide, it would have saved me LOTS of trouble
just to be fair, i should have known thouhg, when it said to chmod +x the init.d script itself

thanks again for all your patience and help...i'm new and struggling
wonslung
 
Posts: 20
Joined: Tue Feb 17, 2009 7:17 am

Re: PS3 Media Server as a Linux Service

Postby BlueBus » Wed Feb 18, 2009 12:44 pm

Hello,

Alternatively you can set the PMS_FOLDER prior to its usage.

In your case something like the following should be inserted in the top of the script file:

Code: Select all
PMS_FOLDER= /usr/local/sbin/PMS


ant then you can use the variable thorough the script like this:

Code: Select all
$PMS_FOLDER
BlueBus
 
Posts: 6
Joined: Thu Jan 22, 2009 4:32 pm

Re: PS3 Media Server as a Linux Service

Postby sanju » Wed Feb 18, 2009 2:56 pm

wonslung wrote:i forgot to
sudo chmod +x PMS.sh


How did you run in GUI mode without doing this :)

for the current error..just do

sudo chown userid /tmp/javaps3media

"userid" is the user which you would have set in PS3Mediaserverd.

-sanju.
sanju
 
Posts: 19
Joined: Wed Jan 28, 2009 10:31 am

Re: PS3 Media Server as a Linux Service

Postby wonslung » Thu Feb 19, 2009 11:49 am

i don't run in gui mode, it's on a headless server. i ran with sudo sh PMS.sh
wonslung
 
Posts: 20
Joined: Tue Feb 17, 2009 7:17 am

Re: PS3 Media Server as a Linux Service

Postby Brumle » Thu Feb 19, 2009 2:32 pm

I keep getting this error message
Code: Select all
(.:7558): Gtk-WARNING **: cannot open display:


Any suggestions?
I'm trying to run it on a server without any display.
Brumle
 
Posts: 1
Joined: Thu Feb 19, 2009 2:30 pm

PreviousNext

Return to Linux/Unix Support

Who is online

Users browsing this forum: No registered users and 2 guests