FAQ  •  Register  •  Login

unable to start/stop serviio

<<

Zikofski

Serviio newbie

Posts: 6

Joined: Mon Aug 12, 2013 10:43 am

Post Thu Aug 06, 2015 11:34 am

unable to start/stop serviio

okay so serviio is running, and i tried to stop it so i can make a change to the Profiles.xml page but it won't let me stop serviio

i get this error,
Error: Could not find or load main class org.serviio.MediaServer

so i thought okay, reboot my server still no luck, serviio is now not running anymore so il upgrade so i have upgraded to the latest version 1.5.2 and I'm still getting the same error to start the service,

root@zikofski:/opt# serviio start
Error: Could not find or load main class org.serviio.MediaServer

serviio has been running fine for about 2 to 3 years no problems until today >_< am i missing something? this is a ubuntu server, i installed the latest version by moving the old serviio folder to serviio.old and then moving over library and plugins folder i think that was the correct way to do it.
<<

pepa.sajdler

Serviio newbie

Posts: 14

Joined: Tue Nov 15, 2011 7:24 pm

Post Tue Aug 11, 2015 6:22 pm

Re: unable to start/stop serviio

Since you didn't post your start script, I can only guess what needs to be done, but upgrading java might do the trick. And I'm not sure of OpenJDK, I'm using Sun's.

It might be a good idea to run it as a service (you just need to figure out the right type: systemd, upstart or sysv init), there might be the right script on the forum (at least upstart should be).

Also running it as a different user than root is recommended.

Odesláno z mého A0001 pomocí Tapatalk
<<

Zikofski

Serviio newbie

Posts: 6

Joined: Mon Aug 12, 2013 10:43 am

Post Tue Aug 11, 2015 9:20 pm

Re: unable to start/stop serviio

thank you for replying, the strange thing is it was working fine up until recently, this is my Java version i think it is upto date but maybe someone can confirm that

  Code:
andrew@zikofski:/$ java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)


even if i type in serviio in the terminal i get the error message :S

  Code:
andrew@zikofski:/$ serviio
Error: Could not find or load main class org.serviio.MediaServer


this is the start script found in /etc/init.d/serviio


  Code:
. /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/serviio ]; then
        . /etc/default/serviio
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() {
        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 $?
}

top() {
        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
<<

pepa.sajdler

Serviio newbie

Posts: 14

Joined: Tue Nov 15, 2011 7:24 pm

Post Sat Aug 15, 2015 1:50 pm

Re: unable to start/stop serviio

Your java seems to be the latest one - I have the same version installed.

Have you tried the /serviio/bin/serviio.sh file to run serviio? Looks like there are some important looking parameters - e.g. the `-classpath "$SERVIIO_CLASS_PATH"` part (SERVIIO_CLASS_PATH is set to "$SERVIIO_HOME/lib/*:$SERVIIO_HOME/config" in the script) - I think this is the reason for the "Error: Could not find or load main class org.serviio.MediaServer" error.

I've just tried to run the serviio via it, and it worked. Mayby I would redownload first (wget http://download.serviio.org/releases/se ... nux.tar.gz) and follow this: http://www.serviio.org/component/conten ... e?id=21#q8

Not sure about the init script - looks like the first from here: viewtopic.php?f=6&t=71 - and I guess you'll find one more suitable - but I would still start via /serviio/bin/serviio.sh file (you can symlink it to /usr/bin/serviio...) That topis is a gold mine :)

Return to Serviio Support & Help

Who is online

Users browsing this forum: Google [Bot] and 27 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.