Autostart in ubuntu 9.10

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
gcastell
Posts:4
Joined:Wed May 14, 2008 10:53 am
AV Hardware:XBOX 360
Autostart in ubuntu 9.10

Post by gcastell » Tue Dec 01, 2009 12:38 pm

OK, I just tried to do this using the instructions in the web site:
In the following we assume that your mediaserver (and the .ini file) are located in /opt. You should create the start script in /etc/init.d/rc3.d/S99mediaserver with the following contents:
#!/bin/sh
cd /opt
/opt/twonkymedia -D
The modifications are that since this is ubuntu the rc3.d folder is in /etc/rc3.d and twonky is in /opt/twonkymedia, I created the script put it in the right place.. and nothing, when I run the individual commands they work fine, help?

Here is my modified script:

Code: Select all

#!/bin/sh
cd /opt/twonkymedia
/opt/twonkymedia/twonkymedia -D 

thanks!

gcastell
Posts:4
Joined:Wed May 14, 2008 10:53 am
AV Hardware:XBOX 360

Re: Autostart in ubuntu 9.10

Post by gcastell » Tue Dec 08, 2009 4:07 am

Anyone? help!

PeeBee
Posts:392
Joined:Sat Jun 13, 2009 12:16 pm
AV Hardware:Buffalo LS Pro; PS3; Samsung LE37B650

Re: Autostart in ubuntu 9.10

Post by PeeBee » Tue Dec 08, 2009 9:39 pm

Try running the S99mediaserver script manually.

PB
Samsung LE37B650T2WXXU; Liteon 5055GDL+ HDD/DVD Recorder; Playstation 3; Iomega Screenplay HD 500GB; Buffalo Linkstation Pro LS-320GL (running Twonky 6.0.30, SqueezeBox Server 7.6 and acting as a Print Server)

User avatar
josch.hh
Posts:33
Joined:Tue Sep 01, 2009 6:57 pm
AV Hardware:Twonky Server 5.1.12
Phillips NP2500
Samsung TV LE32B679
Location:Germany

Re: Autostart in ubuntu 9.10

Post by josch.hh » Thu Dec 10, 2009 9:15 am

Forget about SysV Init scripts.
Since Ubuntu 9.10 we can use (thank god) Upstart.

So create a Upstart config file for twonky:

Code: Select all

/etc/init/twonky.conf
with the following in it (modifiy path to twonkymedia):

Code: Select all

# Start Twonky

start on runlevel 2
stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
expect fork
exec /data/twonky/twonkymedia -logfile /var/log/twonky.log

post-stop script
        sleep 5
end script
Now you can simply run the commands: start, stop, status and restart
Example: to restart twonky type:

Code: Select all

restart twonky
-MEDIATOMB- running on Ubuntu 10.10 with Kernel 2.6.35
Client 1: Phillips NP2500
Client 2: Samsung TV LE32B679

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: Autostart in ubuntu 9.10

Post by fboecom » Fri Mar 05, 2010 5:35 pm

I think upstart only works when you have logged in - no good. Should be a system service auto start.

User avatar
DaemonBeetle
Posts:305
Joined:Mon Dec 28, 2009 11:05 am
AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)

Re: Autostart in ubuntu 9.10

Post by DaemonBeetle » Sat Mar 06, 2010 1:03 am

Just a forum over is this thread that provides your answers.

User avatar
josch.hh
Posts:33
Joined:Tue Sep 01, 2009 6:57 pm
AV Hardware:Twonky Server 5.1.12
Phillips NP2500
Samsung TV LE32B679
Location:Germany

Re: Autostart in ubuntu 9.10

Post by josch.hh » Mon May 24, 2010 8:58 am

fboecom wrote:I think upstart only works when you have logged in - no good. Should be a system service auto start.
Why, .... of course not. Do you know what Upstart is?
It is much better then SysV init, and of course it start TMS automatically as you can see in the example Upstart twonky.conf above.
-MEDIATOMB- running on Ubuntu 10.10 with Kernel 2.6.35
Client 1: Phillips NP2500
Client 2: Samsung TV LE32B679

User avatar
josch.hh
Posts:33
Joined:Tue Sep 01, 2009 6:57 pm
AV Hardware:Twonky Server 5.1.12
Phillips NP2500
Samsung TV LE32B679
Location:Germany

Re: Autostart in ubuntu 9.10

Post by josch.hh » Mon May 24, 2010 9:03 am

DaemonBeetle wrote:Just a forum over is this thread that provides your answers.
Nice thread, but why still using the "old" Twonky installer with SysV Init on a modern system like Ubuntu 9.10 or higher?

Forget the mentioned thread and install like that (even less work):
  • Download manual install Twonky zip
  • Extract it in one directory
  • Create the Twonky Upstart ".conf" file (like from the example above in /etc/init (don't forget to customize the Twonky install dir in this script)
Ready to run Twonky!


And additionally next time you want to install a new release just stop Twonky remove old Twonky from install dir and extract new Twonk in install dir, restart Twonky -> Upgrade ready.
-MEDIATOMB- running on Ubuntu 10.10 with Kernel 2.6.35
Client 1: Phillips NP2500
Client 2: Samsung TV LE32B679

Locked