Twonky Server Not Running on Startup

Linux and UNIX specific discussions
Post Reply
tododo
Posts: 6
Joined: Sat Jan 03, 2009 10:45 am
AV Hardware: running Ubuntu Ibex

Twonky Server Not Running on Startup

Post by tododo » Sat Jan 03, 2009 1:38 pm

Hi all

Ive updated twonky to the latest version (5) on ubuntu ibex

I havnt installed the program but am running it from an unzipped folder if that makes sense
Everything is working OK however I am unable to run at startup

I have an init script in ini.d with /home/griffithsl/Twonkymedia/twonkymedia -D contained within it

The program does start however I get this in running processes

1000 6050 1 0 09:49 ? 00:00:00 /home/griffithsl/Twonkymedia/twonkymedia -D
1000 6051 6050 0 09:49 ? 00:00:00 [twonkymediaserv] <defunct> <<<<<looks odd

and the web browser doesnt work

when I then sudo /home/griffithsl/Twonkymedia/twonkymedia -D the server starts and all is well

Any ideas

Thanks for any advise guys

User avatar
mgillespie
Posts: 1222
Joined: Fri Jul 08, 2005 1:19 pm
AV Hardware: TwonkyMedia AV UPnP Mediaserver (Marvell Kirkwood ARM Sheevaplug with Debian Squeeze).
2x Noxon V2 audio client
1x PS3 Slim 500GB Audio/Video UPnP client.
1x Sony VGF-CP1 Wireless Photoframe.
Location: UK

Re: Twonky Server Not Running on Startup

Post by mgillespie » Sun Jan 04, 2009 12:47 am

Unfortunately I don't run Ubuntu/Debian, so I can't help too much, but others HAVE got it working in the past. Try this post, see if it helps:

http://www.twonkyforum.com/viewtopic.php?f=22&t=5082
Please note: Moderators here are voluntary and do not work for PacketVideo or Twonky, please do not attack us. Any posts are personal opinion, and may not be those of PV/Twonky.

chris12
Posts: 2
Joined: Wed Jan 07, 2009 1:29 pm
AV Hardware: Playstation 3

Re: Twonky Server Not Running on Startup

Post by chris12 » Wed Jan 07, 2009 1:47 pm

Hi tododo,

there must be a startscript in /etc/init.d/ called twonkyserver
If u can't find it so create it

sudo vim /etc/init.d/twonkyserver

Paste the stuff below

--------------------------------

Code: Select all

#!/bin/sh
#
# MediaServer Control File written by Itzchak Rehberg
# Modified for fedora/redhat by Landon Bradshaw <phazeforward@gmail.com>
# Adapted to TwonkyMedia 3.0 by TwonkyVision GmbH
# Adapted to TwonkyMedia 4.0 by TwonkyVision GmbH
#
# This script is intended for SuSE and Fedora systems. Please report
# problems and suggestions at http://www.twonkyvision.de/mantis/
#
#
###############################################################################
#
### BEGIN INIT INFO
# Provides:       twonkymedia
# Required-Start: $network $remote_fs
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Description:    TwonkyVision UPnP server
### END INIT INFO
#
# Comments to support chkconfig on RedHat/Fedora Linux
# chkconfig: 345 71 29
# description: TwonkyVision UPnP server
#
#==================================================================[ Setup ]===

WORKDIR1="/home/christian/downloads/twonky"
WORKDIR2="`dirname $0`"
PIDFILE=/var/run/twonky.pid

#=================================================================[ Script ]===

# Source function library.
if [ -f /etc/rc.status ]; then
  # SUSE
  . /etc/rc.status
  rc_reset
else
  # Reset commands if not available
  rc_status() {
    case "$1" in
	-v)
	    true
	    ;;
	*)
	    false
	    ;;
    esac
    echo
  }
  alias rc_exit=exit
fi


if [ -x "$WORKDIR1" ]; then
WORKDIR="$WORKDIR1"
else
WORKDIR="$WORKDIR2"
fi

DAEMON=twonkymedia
if [ ! -f "${WORKDIR}/${DAEMON}" ]
then
    DAEMON=twonkymusic
fi
TWONKYSRV="${WORKDIR}/${DAEMON}"

INIFILE="${WORKDIR}/twonkyvision-mediaserver.ini"

cd $WORKDIR

case "$1" in
  start)
    if [ -e $PIDFILE ]; then
      PID=`cat $PIDFILE`
      echo "Twonky server seems already be running under PID $PID"
      echo "(PID file $PIDFILE already exists). Checking for process..."
      running=`ps --no-headers -o "%c" -p $PID`
      if ( [ "${DAEMON}"=="${running}" ] ); then
        echo "Process IS running. Not started again."
      else
        echo "Looks like the daemon crashed: the PID does not match the daemon."
        echo "Removing flag file..."
        rm $PIDFILE
        $0 start
        exit $?
      fi
      exit 0
    else
      if [ ! -x "${TWONKYSRV}" ]; then
	  echo "Twonky servers not found".
	  rc_status -u
	  exit $?
      fi
      echo -n "Starting $TWONKYSRV ... "
      $TWONKYSRV -D -inifile "${INIFILE}"
      rc_status -v
    fi
  ;;
  stop)
    if [ ! -e $PIDFILE ]; then
      echo "PID file $PIDFILE not found, stopping server anyway..."
      killall -s TERM twonkymedia twonkymusic
      rc_status -u
      exit 3
    else
      echo -n "Stopping Twonky MediaServer ... "
      PID=`cat $PIDFILE`
      kill -s TERM $PID
      rm -f $PIDFILE
      rc_status -v
    fi
  ;;
  reload)
    if [ ! -e $PIDFILE ]; then
      echo "PID file $PIDFILE not found, stopping server anyway..."
      killall -s TERM twonkymedia twonkymusic
      rc_status -u
      exit 3
    else
      echo -n "Reloading Twonky server ... "
      PID=`cat $PIDFILE`
      kill -s HUP $PID
      rc_status -v
    fi
  ;;
  restart)
    $0 stop
    $0 start
  ;;
  status)
    if [ ! -e $PIDFILE ]; then
      running="`ps ax --no-headers | grep -e twonkymedia -e twonkymusic | grep -v grep | grep -v twonkymedia.sh | cut -d ' ' -f 1`"
      if [ "${running}" == "" ]; then
        echo "No twonky server is running"
      else
        echo "A twonky server seems to be running (PID: "${running}"), but no PID file exists."
        echo "Probably no write permission for ${PIDFILE}."
      fi
      exit 0
    fi
    PID=`cat $PIDFILE`
    running=`ps --no-headers -o "%c" -p $PID`
    if ( [ "${DAEMON}"=="${running}" ] ); then
      echo "Twonky server IS running."
    else
      echo "Looks like the daemon crashed: the PID does not match the daemon."
    fi
  ;;
  *)
    echo ""
    echo "Twonky server"
    echo "-------------"
    echo "Syntax:"
    echo "  $0 {start|stop|restart|reload|status}"
    echo ""
    exit 3
  ;;
esac

rc_exit
# Dirs
Change WORKDIR1 for ur needs

# mark the file as executeable
sudo chmod 755 /etc/init.d/twonkyserver

# Mark it as start with the system
cd /etc/rc2.d
sudo ln -s ../init.d/twonkyserver S99twonkyserver


It should work now

samantha
Posts: 1
Joined: Sun Jan 24, 2010 12:07 am
AV Hardware: PS3、Bravia

Re: Twonky Server Not Running on Startup

Post by samantha » Sun Jan 24, 2010 12:30 am

Hi

The following confirmations.

tail /tmp/TwonkyMediaServer-log.txt
---
06:37:18:568 createTable(itemTable,"Item") failed
File: ../../../server/sqlite/item.c
Function: dbx_item_init
Line: 153
06:37:18:569 dbx_item_init() failed
File: ../../../server/sqlite/adapter.c
Function: dbx_modules_init
Line: 231
---

Is not such an error output?
next...
When the following are executed, it is repaired.

cd /var
rm -rf twonkymedia
or
mv twonkymedia twonkymedia_back

## It is in a word because you had them dead lock sqlite DB. :?

let's restart twonkymedia!! :mrgreen:

Post Reply