Error in Linux 'start as another user' (sudo -u <user>)

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
fboecom
Posts:10
Joined:Wed Mar 03, 2010 6:20 pm
AV Hardware:PC2500 VIA-C7 Ubuntu 10.04, Twonky Server 6.0.28, WD TV Live, AMDX4 Phoenix MSI 890 (Windows Performance index 7.1, Win 7-64 Ultimate)
Error in Linux 'start as another user' (sudo -u <user>)

Post by fboecom » Sun Apr 04, 2010 10:10 pm

In my ultimate desire to make a good Ubuntu twonky install, I hit what I believe is an error in twonkymedia server.
If I start the executable twonkymedia in the install directory, as bare as possible, with

Code: Select all

./twonkymedia
, it will start the daemons twonkymedia and twonkymediaserver that I find in the process list. The owner of the processes is the user who started twonkymedia.
If I start with

Code: Select all

sudo ./twonkymedia
, the daemons are owned by root.
However when I start with

Code: Select all

sudo -u <otherusername> ./twonkymedia
then I receive the message that

Code: Select all

dbx_init failed
. After that, the process list shows twonkymedia as a good process, but also a twonkymediaserv as a defunct process.

I surely need to run twonkymedia as another user, when kicked off /etc/init.d during reboot.

Please advice!

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: Error in Linux 'start as another user' (sudo -u <user>)

Post by mgillespie » Mon Apr 05, 2010 7:52 pm

I think Twonkymedia needs to be run as root.

There are some guidelines for setting up Twonkymedia on Linux in the LinuxHowTo.txt document included with all the Linux/NAS zip files.

fboecom
Posts:10
Joined:Wed Mar 03, 2010 6:20 pm
AV Hardware:PC2500 VIA-C7 Ubuntu 10.04, Twonky Server 6.0.28, WD TV Live, AMDX4 Phoenix MSI 890 (Windows Performance index 7.1, Win 7-64 Ultimate)

Re: Error in Linux 'start as another user' (sudo -u <user>)

Post by fboecom » Thu May 06, 2010 2:23 pm

mgilespie, thanks for the reply, but I don't think TMS needs root permissions.
1) TMS can quite happily run with limited permissions when kicked off by a normal user ("<install dir>twonkymedia start") so why not at boot time from init.d
2) the sudo -u is a normal way of starting processes with limited permissions and should work
3) one of the twonky processes will run OK with "sudo -u" but not the other.

This is quite surely a bug in twonky.
Apart from that it is unthinkable (in my mind) that ANY user can config a root privileged process using html that then can publish ANY content in the filesystem. It is a total amateur solution for what I thought was a professional product.

Further I have read the LinuxHowTo and there is some good but also incorrect text in the file, so that one I don't trust too much. For instance it says: "To enable autostart of the server, you need to be a Linux expert". That is bare nonsense. I have documented the Ubuntu install at http://www.twonkyforum.com/viewtopic.ph ... ide#p28830 and it is really simple, would the TMS guys have paid just a few hours more on documenting their stuff (on Linux) - as I did.

Locked