I've been struggling, trying to get my Mediatomb server to start automatically on Upstart run level 2. I can't figure it out. I guess Upstart is still new to me and I don't understand it. I even read the whole manual and it is vague and never mentions any of the inner workings of how things work.
I can obviously run mediatomb with this command and so getting it to run is not my question:
sudo mediatomb --config /etc/mediatomb/config.xmlor
mediatomb --config ~/.mediatomb/config.xmlI know Upstart supposedly will start services as superuser but what happens when running Upstart commands as a normal user? Do priviledges get escalated? I can't seem to figure it out.
These commands don't work:
service mediatomb start
/etc/init.d/mediatomb start
sudo initctl start mediatomb (says it started but not really)To me, this all seems to be some kind of permissions issue but I don't understand enough about Upstart to figure this out. Very frustrating.
me@linux:/etc/init$ start mediatomb
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.58"
(uid=1000 pid=2665 comm="start mediatomb ") interface="com.ubuntu.Upstart0_6.Job"
member="Start" error name="(unset)" requested_reply="0"
destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init") 1 Answer
Re-installed system using Xubuntu. This time Mediatomb autostarts but the port 47152 is only visble on localhost. The service can also be restarted using sudo service mediatomb start. My external media device cannot see mediatomb.
I learned:
- Mediatomb puts the db in the /var/lib/mediatomb.db , owned by the mediatomb user
- The config.xml is owned by root in /etc/mediatomb/config.xml
- The web files are at /usr/share/mediatomb and owned by root.
- The /etc/init directory contains the Upstart script and I made no modifications to it.
- The /etc/init.d directory contains the old, unused init script.
- The media disk I am sharing is auto-mounted by root and has 777 permissions.
At this point I think this may be related to the fact that my Xubuntu is a 64-bit system and that, for some reason the listener binds to localhost rather than my external IP?
UPDATE: finally figured out that it was a misconfiguration in my config.xml that caused the server to think there wasn't any files to serve. My library is all .avi files and I had the .avi profile misconfigured in the config.xml and so it couldn't render anything.