New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

MediaTomb - autostart

Got problems with Bubba? Then this forum is for you.
Locked
TazUk
Posts: 38
Joined: 11 May 2007, 14:33

MediaTomb - autostart

Post by TazUk »

Hi --

I've had some issues with mediatomb on Bubba recently which led to me uninstalling and reinstalling the package.

However this has led to me being unable to start mediatomb on boot.
When I run

Code: Select all

/etc/init.d/mediatomb start
I get nothing back (whether done as root / user).

I can successfully run

Code: Select all

mediatomb
to run the server manually in process.

Can anyone help me correct this?
My current /etc/init.d/mediatomb reads as follows:

Code: Select all

#! /bin/sh
#
# mediatomb initscript
#
#
# Author:       Tor Krill <tor@excito.com>.
#
#

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="upnp media server"
NAME=Bubba
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
USER=nobody
GROUP=nogroup
LOGFILE=/var/log/mediatomb

# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
        . /etc/default/$NAME
fi

D_ARGS="-c /etc/mediatomb/config.xml -d -u $USER -g $GROUP -P $PIDFILE -l $LOGF$
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

#
#       Function that starts the daemon/service.
#
d_start() {
        touch $PIDFILE
        chown $USER:$GROUP $PIDFILE
        touch $LOGFILE
        chown $USER:$GROUP $LOGFILE
        start-stop-daemon --start --quiet --pidfile $PIDFILE \
                --exec $DAEMON -- $D_ARGS $DAEMON_OPTS
}

#
#       Function that stops the daemon/service.
#
d_stop() {
        start-stop-daemon --stop --signal 2 --retry 5 --quiet --pidfile $PIDFIL$
                --name $NAME
}

#
#       Function that sends a SIGHUP to the daemon/service.
#
d_reload() {
        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
                --name $NAME --signal 1
}
ase "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        /sbin/route add -net 239.0.0.0 netmask 255.0.0.0 eth0 >/dev/null 2>&1 |$
        d_start
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        d_stop
        echo "."
        ;;
#  reload|force-reload)
#        echo -n "Reloading $DESC configuration..."
#        d_reload
#        echo "done."
#       ;;
  restart)
        #
        #       If the "reload" option is implemented, move the "force-reload"
        #       option to the "reload" entry above. If not, "force-reload" is
        #       just the same as "restart".
        #
        echo -n "Restarting $DESC: $NAME"
        d_stop
        sleep 1
        d_start
        echo "."
        ;;
  *)
        # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >$
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0
I have a config file at /etc/mediatomb/config.xml, but I'll hold off on posting that as I think the problem lies above. Of course I'm probably wrong, it's been a long day...

Any help gratefully appreciated.
:?
TazUk
--
The 'Net is a waste of time,
and that's exactly what's right about it.

William Gibson
tor
Posts: 703
Joined: 06 Dec 2006, 12:24
Contact:

Re: MediaTomb - autostart

Post by tor »

Hi Tazuk,

What does running the command, as root:

Code: Select all

mediatomb -c /etc/mediatomb/config.xml -U nobody -g nogroup
Say?

/Tor
Co-founder OpenProducts and Ex Excito Developer
TazUk
Posts: 38
Joined: 11 May 2007, 14:33

Re: MediaTomb - autostart

Post by TazUk »

Hi Tor, thanks for responding.

Output (elevated to root as the command fails as standard user with 'operation not permitted') reads:

Code: Select all

MediaTomb UPnP Server version 0.10.0 - http://mediatomb.cc/

===============================================================================
Copyright 2005-2007 Gena Batsyan, Sergey Bostandzhyan, Leonhard Wimmer.
MediaTomb is free software, covered by the GNU General Public License version 2

2009-06-21 21:08:51    INFO: Loading configuration from: /etc/mediatomb/config.xml
2009-06-21 21:08:51    INFO: UUID generated: 89282a2d-991a-4bd1-903f-173c249d50ff
2009-06-21 21:08:51    INFO: Config: option not found: /server/udn using default value: uuid:89282a2d-991a-4bd1-903f-173c249d50ff
2009-06-21 21:08:51    INFO: Checking configuration...
2009-06-21 21:08:51    INFO: Config: option not found: /server/servedir using default value: 
2009-06-21 21:08:51    INFO: Config: option not found: /server/ui/attribute::poll-when-idle using default value: no
2009-06-21 21:08:51    INFO: Config: option not found: /server/ui/attribute::poll-interval using default value: 2
2009-06-21 21:08:51    INFO: Config: option not found: /server/ui/items-per-page/attribute::default using default value: 25
2009-06-21 21:08:51    INFO: Config: option not found: /import/filesystem-charset using default value: ANSI_X3.4-1968
2009-06-21 21:08:51    INFO: Setting filesystem import charset to ANSI_X3.4-1968
2009-06-21 21:08:51    INFO: Config: option not found: /import/metadata-charset using default value: ANSI_X3.4-1968
2009-06-21 21:08:51    INFO: Setting metadata import charset to ANSI_X3.4-1968
2009-06-21 21:08:51    INFO: Config: option not found: /import/playlist-charset using default value: ANSI_X3.4-1968
2009-06-21 21:08:51    INFO: Setting playlist charset to ANSI_X3.4-1968
2009-06-21 21:08:51    INFO: Config: option not found: /server/pc-directory/attribute::upnp-hide using default value: no
2009-06-21 21:08:51    INFO: Config: option not found: /server/retries-on-timeout using default value: 0
2009-06-21 21:08:51    INFO: Config: option not found: /server/interface using default value: 
2009-06-21 21:08:51    INFO: Config: option not found: /server/ip using default value: 
2009-06-21 21:08:51    INFO: Config: option not found: /server/bookmark using default value: mediatomb.html
2009-06-21 21:08:51    INFO: Config: option not found: /server/modelName using default value: MediaTomb
2009-06-21 21:08:51    INFO: Config: option not found: /server/modelDescription using default value: Free UPnP AV MediaServer, GNU GPL
2009-06-21 21:08:51    INFO: Config: option not found: /server/modelNumber using default value: 0.10.0
2009-06-21 21:08:51    INFO: Config: option not found: /server/serialNumber using default value: 1
2009-06-21 21:08:51    INFO: Config: option not found: /server/presentationURL using default value: 
2009-06-21 21:08:51    INFO: Config: option not found: /server/presentationURL/attribute::append-to using default value: none
2009-06-21 21:08:51    INFO: Config: option not found: /server/upnp-string-limit using default value: -1
2009-06-21 21:08:51    INFO: Config: option not found: /import/scripting/playlist-script/attribute::create-link using default value: yes
2009-06-21 21:08:51    INFO: Config: option not found: /server/port using default value: 0
2009-06-21 21:08:51    INFO: Config: option not found: /server/alive using default value: 180
2009-06-21 21:08:51    INFO: Config: option not found: /import/magic-file using default value: 
2009-06-21 21:08:51    INFO: Configuration check succeeded.
2009-06-21 21:08:51    INFO: database doesn't seem to exist. automatically creating database...
2009-06-21 21:08:52    INFO: database created successfully.
2009-06-21 21:08:52    INFO: Initialized port: 49152
2009-06-21 21:08:52    INFO: Server bound to: 192.168.1.123
2009-06-21 21:08:54    INFO: MediaTomb Web UI can be reached by following this link:
2009-06-21 21:08:54    INFO: http://192.168.1.123:49152/
2009-06-21 21:08:54   ERROR: iconv: Invalid or incomplete multibyte or wide character
2009-06-21 21:08:54   ERROR: iconv: DivX Author – Create DivX Movies.lnk could not be converted to new encoding: invalid character sequence!
2009-06-21 21:08:54   ERROR: iconv: Invalid or incomplete multibyte or wide character
2009-06-21 21:08:54   ERROR: iconv: ?? Create DivX Movies.lnk could not be converted to new encoding: invalid character sequence!
2009-06-21 21:08:54   ERROR: iconv: Invalid or incomplete multibyte or wide character
2009-06-21 21:08:54   ERROR: iconv: Stage6 – Download Free DivX Videos.lnk could not be converted to new encoding: invalid character sequence!
2009-06-21 21:08:54   ERROR: iconv: Invalid or incomplete multibyte or wide character
2009-06-21 21:08:54   ERROR: iconv: ?? Download Free DivX Videos.lnk could not be converted to new encoding: invalid character sequence!
Web GUI then is available online and begins scanning folders (per my original config file from the /etc/mediatomb location.
Bubba is also visible from my (various) media streamers.

NB: The invalid conversion messages are from some synced shortcuts that I'm aware of.
TazUk
--
The 'Net is a waste of time,
and that's exactly what's right about it.

William Gibson
tor
Posts: 703
Joined: 06 Dec 2006, 12:24
Contact:

Re: MediaTomb - autostart

Post by tor »

Am i correct in interpreting your answer that it worked when starting mediatomb as described above?

Have you edited the /etc/init.d/mediatomb there seems to be a typo after the d_reload function. It reads:

Code: Select all

ase "$1" in
which really should read

Code: Select all

case "$1" in
Does that change anything?

/Tor
Co-founder OpenProducts and Ex Excito Developer
TazUk
Posts: 38
Joined: 11 May 2007, 14:33

Re: MediaTomb - autostart

Post by TazUk »

Yes Tor - it started up okay.

The typo after the d_reload function is just a cut / paste mistake - the full

Code: Select all

case "$1" in
is present in the actual file.
TazUk
--
The 'Net is a waste of time,
and that's exactly what's right about it.

William Gibson
TazUk
Posts: 38
Joined: 11 May 2007, 14:33

Re: MediaTomb - autostart

Post by TazUk »

Still no clues how to get this automatically starting? :(
TazUk
--
The 'Net is a waste of time,
and that's exactly what's right about it.

William Gibson
baba74
Posts: 2
Joined: 01 Jul 2009, 02:39

Re: MediaTomb - autostart

Post by baba74 »

I also have messed up the database, can anyone tell me how to reset it or reinstall mediatomb.

Thanks
tor
Posts: 703
Joined: 06 Dec 2006, 12:24
Contact:

Re: MediaTomb - autostart

Post by tor »

@baba74,

If this is on a Bubba|SERVER it should be enough to stop mediatomb, remove the database file located at /var/db/sqlite3.db and then restart mediatomb. It then should be regenerated.

@TazUk

You seem to have edited the /etc/init.d/mediatomb file manually? There is a

Code: Select all

NAME=Bubba
in your example file. This will prevent mediatomb to start since it then will verify that

Code: Select all

DAEMON=/usr/bin/$NAME
.
.
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
exists and if not will terminate.

Fix that or move back to the shipped version and then it most likely will work.

/Tor
Co-founder OpenProducts and Ex Excito Developer
TazUk
Posts: 38
Joined: 11 May 2007, 14:33

Re: MediaTomb - autostart

Post by TazUk »

Aha ! - that got it..

Many thanks for the help
TazUk
--
The 'Net is a waste of time,
and that's exactly what's right about it.

William Gibson
baba74
Posts: 2
Joined: 01 Jul 2009, 02:39

Re: MediaTomb - autostart

Post by baba74 »

Thanks Tor.... you fixed my problem too!!!
Locked