Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10.04
What's the proper code on configuration file to reference to get Ubuntu 10.04 to autostart the TMS5.x on startup?
I initially added the path,
home/*****/twonkymedia-i386-glibc-2.2.5-5.1.3/twonkymedia
(the *** represent my home folder name)
This is the directory where the twonkymedia and twonkymediaserver applications are.
First test ran, and the server did start, but it didn't remember all the media files it had seen before shut down and only restarted with a handfull and was scanning to find the remaining. I had to restart the server from within the HTML configuration tool to get it to rescan the sharred locations and find all the files again. Repeated shut down, and startup and got the same results.
I figure there something wrong with either the startup application path I selected, or the installation location. Any help is greatly appreciated.
I initially added the path,
home/*****/twonkymedia-i386-glibc-2.2.5-5.1.3/twonkymedia
(the *** represent my home folder name)
This is the directory where the twonkymedia and twonkymediaserver applications are.
First test ran, and the server did start, but it didn't remember all the media files it had seen before shut down and only restarted with a handfull and was scanning to find the remaining. I had to restart the server from within the HTML configuration tool to get it to rescan the sharred locations and find all the files again. Repeated shut down, and startup and got the same results.
I figure there something wrong with either the startup application path I selected, or the installation location. Any help is greatly appreciated.
Last edited by griso8v on Sat Mar 19, 2011 4:28 am, edited 1 time in total.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
Drop the script twonkymedia.sh found inside the twonky directory into /etc/init.d and then run update-rc.d twonkymedia defaults
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
I'm a bit of a newbie to linux. the int.d folder is a Root owned folder. How do I copy the script file from my home directory to the etc/int.d as root? When I "drag" or "copy" the file using Nautilus windows, I get a permissions error. I am an administrator on this system.
Thanks for your help.
Thanks for your help.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
You need to use the command line and the "sudo" command:
Being an "administrator" only means you have access to the real administration account (root), not that you can do anything directly. You probably want to read the basic documentation on Ubuntu and the community documentation.
Code: Select all
sudo cp twonkymedia.sh /etc/init.d
sudo update-rc.d twonkymedia defaults
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
Okay. Thanks. The copy function worked I appreciate the help.
The update command you gave though seemed to not work. it said the twonkymedia file did not exist. I reran the command with the .sh and got the results below...
I posted this before testing the restart. Will update results after that test.
-----------------------------------------------------------------------------------------
desktop:~$ sudo cp twonkymedia.sh /etc/init.d
[sudo] password for :
desktop:~$ sudo update-rc.d twonkymedia defaults
update-rc.d: /etc/init.d/twonkymedia: file does not exist
desktop:~$ sudo update-rc.d twonkymedia.sh defaults
update-rc.d: warning: /etc/init.d/twonkymedia.sh missing LSB keyword 'required-stop'
update-rc.d: warning: twonkymedia.sh start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (3 5)
update-rc.d: warning: twonkymedia.sh stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 1 2 6)
Adding system startup for /etc/init.d/twonkymedia.sh ...
/etc/rc0.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc1.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc6.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc2.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc3.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc4.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc5.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
-----------------------------------------
The update command you gave though seemed to not work. it said the twonkymedia file did not exist. I reran the command with the .sh and got the results below...
I posted this before testing the restart. Will update results after that test.
-----------------------------------------------------------------------------------------
desktop:~$ sudo cp twonkymedia.sh /etc/init.d
[sudo] password for :
desktop:~$ sudo update-rc.d twonkymedia defaults
update-rc.d: /etc/init.d/twonkymedia: file does not exist
desktop:~$ sudo update-rc.d twonkymedia.sh defaults
update-rc.d: warning: /etc/init.d/twonkymedia.sh missing LSB keyword 'required-stop'
update-rc.d: warning: twonkymedia.sh start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (3 5)
update-rc.d: warning: twonkymedia.sh stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 1 2 6)
Adding system startup for /etc/init.d/twonkymedia.sh ...
/etc/rc0.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc1.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc6.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc2.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc3.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc4.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc5.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
-----------------------------------------
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
Okay. After I restarted the server was killed completely. The server had been running after adding it into the startup programs, but just wasn't scanning correctly. Now with the .sh file moved, the server is completely killed and I have to go into home/twonkymedia/ and execute the twonkymediaserver file to kickstart it. Then restart the server.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
You need to ensure that you installed twonkymedia in to the directory that script expects it to be in. I seem to recall that it expects it all in /usr/local/twonkymedia.
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
You are correect. I reinstalled the software under the /usr/local/twonkymedia. The script, twonkymedia.sh is located in the /etc/init.d folder. I re-ran the commands and it still doesn't see the file. Results below.
----------
desktop:~$ sudo update-rc.d twonkymedia defaults
[sudo] password for :
update-rc.d: /etc/init.d/twonkymedia: file does not exist
---------------------------
I appreciate your patience and help. Any other thoughts?
----------
desktop:~$ sudo update-rc.d twonkymedia defaults
[sudo] password for :
update-rc.d: /etc/init.d/twonkymedia: file does not exist
---------------------------
I appreciate your patience and help. Any other thoughts?
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
You've already found and posted the required command yourself:
(remember, I'd posted without the .sh, forgetting that that's the way it's shipped with Twonky)
Code: Select all
sudo update-rc.d twonkymedia.sh defaults
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
Yes, of course, sorry. I get other errors when doing that. So apparently I'm still missing something. I don't understand what these errors mean.
-------------
desktop:~$ sudo update-rc.d twonkymedia.sh defaults
[sudo] password for :
update-rc.d: warning: /etc/init.d/twonkymedia.sh missing LSB keyword 'required-stop'
update-rc.d: warning: twonkymedia.sh start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (3 5)
update-rc.d: warning: twonkymedia.sh stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 1 2 6)
System start/stop links for /etc/init.d/twonkymedia.sh already exist.
----------------------
Thoughts?
-------------
desktop:~$ sudo update-rc.d twonkymedia.sh defaults
[sudo] password for :
update-rc.d: warning: /etc/init.d/twonkymedia.sh missing LSB keyword 'required-stop'
update-rc.d: warning: twonkymedia.sh start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (3 5)
update-rc.d: warning: twonkymedia.sh stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 1 2 6)
System start/stop links for /etc/init.d/twonkymedia.sh already exist.
----------------------
Thoughts?
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
So, what happens if you do:
Code: Select all
sudo /etc/init.d/twonkymedia.sh restart
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10.04
For some reason it seams like it's not seeing the script even though the file is there.
----------
desktop:~$ sudo /etc/init.d/twonkymedia.sh restart
[sudo] password for :
sudo: /etc/init.d/twonkymedia.sh: command not found
desktop:~$ cd /etc/init.d
desktop:/etc/init.d$ ls
acpid irqbalance rsync
acpi-support kerneloops rsyslog
alsa-mixer-save killprocs saned
anacron lm-sensors screen-cleanup
apparmor mediatomb sendsigs
apport module-init-tools single
atd networking skeleton
avahi-daemon network-interface smbd
binfmt-support network-interface-security speech-dispatcher
bluetooth network-manager statd
bootlogd nfs-kernel-server stop-bootlogd
brltty nmbd stop-bootlogd-single
console-setup ondemand twonkymedia.sh
cron pcmciautils udev
cups plymouth udev-finish
dbus plymouth-log udevmonitor
dmesg plymouth-splash udevtrigger
dns-clean plymouth-stop ufw
failsafe-x portmap umountfs
fancontrol pppd-dns umountnfs.sh
gdm procps umountroot
grub-common pulseaudio unattended-upgrades
gssd rc urandom
halt rc.local winbind
hostname rcS wpa-ifupdown
hwclock README x11-common
hwclock-save reboot
idmapd rpc_pipefs
----------
desktop:~$ sudo /etc/init.d/twonkymedia.sh restart
[sudo] password for :
sudo: /etc/init.d/twonkymedia.sh: command not found
desktop:~$ cd /etc/init.d
desktop:/etc/init.d$ ls
acpid irqbalance rsync
acpi-support kerneloops rsyslog
alsa-mixer-save killprocs saned
anacron lm-sensors screen-cleanup
apparmor mediatomb sendsigs
apport module-init-tools single
atd networking skeleton
avahi-daemon network-interface smbd
binfmt-support network-interface-security speech-dispatcher
bluetooth network-manager statd
bootlogd nfs-kernel-server stop-bootlogd
brltty nmbd stop-bootlogd-single
console-setup ondemand twonkymedia.sh
cron pcmciautils udev
cups plymouth udev-finish
dbus plymouth-log udevmonitor
dmesg plymouth-splash udevtrigger
dns-clean plymouth-stop ufw
failsafe-x portmap umountfs
fancontrol pppd-dns umountnfs.sh
gdm procps umountroot
grub-common pulseaudio unattended-upgrades
gssd rc urandom
halt rc.local winbind
hostname rcS wpa-ifupdown
hwclock README x11-common
hwclock-save reboot
idmapd rpc_pipefs
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10
I know this is an old thread but the answer to the issue was simple (I had the same issue). After copying the file to init.d, I had to mark it executable. After that, everything worked.
-
- Posts:4
- Joined:Wed Feb 16, 2011 7:04 am
- AV Hardware:Twonky Server 6.0.3 on Ubuntu Server 10.10
PS3 Slim
Directv HD DVR
Windows 7
HTC EVO
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10
Just as a note...
Ubuntu Server may need another step. To over-simplify the reason: the multiuser nature of Server means TMS may not start until someone physically logs in and starts a session on the Server. The "run level" of the TMS script may not be reached or might be incorrect. This may also be applicable based on which Server release you are running.
First, follow the steps as indicated above. Then from a terminal open /etc/rc.local in a text editor (the second option for gnome if your running a desktop):
sudo vi /etc/rc.local
OR
sudo gedit /etc/rc.local
Add the following after the # comment lines (replace twonkyserver with the name of the script file in /etc/init.d if different):
service twonkyserver start
Make sure the last line is "exit 0", then save and close. Reboot to test. You should see TMS from clients without logging into Server. Scripts inside rc.local always run before any user session which is why this works.
Ubuntu Server may need another step. To over-simplify the reason: the multiuser nature of Server means TMS may not start until someone physically logs in and starts a session on the Server. The "run level" of the TMS script may not be reached or might be incorrect. This may also be applicable based on which Server release you are running.
First, follow the steps as indicated above. Then from a terminal open /etc/rc.local in a text editor (the second option for gnome if your running a desktop):
sudo vi /etc/rc.local
OR
sudo gedit /etc/rc.local
Add the following after the # comment lines (replace twonkyserver with the name of the script file in /etc/init.d if different):
service twonkyserver start
Make sure the last line is "exit 0", then save and close. Reboot to test. You should see TMS from clients without logging into Server. Scripts inside rc.local always run before any user session which is why this works.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10
Having it in /etc/init.d/ and having it added to the startup should be quite sufficient. If you're having to add it to /etc/rc.local then you've got either something wrong with your script in /etc/init.d/ or you've got something wrong with your system.
Startup scripts (those in /etc/init.d/, /etc/init/ and /etc/rc.local) are by their very nature run at startup, which puts them before user sessions.
Startup scripts (those in /etc/init.d/, /etc/init/ and /etc/rc.local) are by their very nature run at startup, which puts them before user sessions.
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10
This post may be old (mine) but I'm glad some people have had the same issue. With having the twonkymedia.sh file in the /etc/init.d/ AND making it executable, I've successfully had the service start through two restarts so far. This seems to have fixed the issue for me. SUPER THANKS for that final suggestion.
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10
Just in case anyone is still following this. After a while, I've noticed that while the server is running, it doesn't see all the media files. For example.
Initial launch server start up. 2600 music files.
Shutdown computer/restart
after restart only sees 700 music files.
Repeat restarts, no change.
Go into TM maintenance and restart server, then server restarts, and eventually sees 2600 music files.
Is there some other piece of code I should adjust somewhere?
Initial launch server start up. 2600 music files.
Shutdown computer/restart
after restart only sees 700 music files.
Repeat restarts, no change.
Go into TM maintenance and restart server, then server restarts, and eventually sees 2600 music files.
Is there some other piece of code I should adjust somewhere?
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10
Does your media exist spread across multiple partitions?
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 5.x in Ubuntu 10
No. Not partitions just separate drives. I have some on an external hard drive, and some on the primary internal hard drive. No partitioning.
Seems strange. When I restart the service or rescan the content, it always finds everything at that point.
Although when I started up this evening it sees everything. just seems to not be consistent.
Seems strange. When I restart the service or rescan the content, it always finds everything at that point.
Although when I started up this evening it sees everything. just seems to not be consistent.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
That's still separate partitions
Do you have them all mounted in the same tree (so that all are under the same directory) or in multiple directories?
Do you have them all mounted in the same tree (so that all are under the same directory) or in multiple directories?
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
I guess that would be separate trees. The external drive is mounted separately from the internal drive. However, under the "file system" tree, the external drive comes under the Media tree and the internal folder locations under the Home tree.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
It could be that there is what's known as a race condition - the external drive doesn't always mount in time for Twonky to scan it. One option might be to add a pause in the Twonky startup script. You could do that by adding the following after line 68 where it says "start)":
That will delay that startup by 20 seconds, which should be all you need.
Code: Select all
sleep 20
No longer running Twonky
- phibertron
- Posts:1566
- Joined:Sun Jan 30, 2011 5:52 pm
- AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000
Encoders
========
Handbrake
x264
ffmpeg
mencoder
Tagging
======
mp3tag
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Out of curiosity, is there anyway that you know of to start twonky with cpu affinity and or prioroty levelDaemonBeetle wrote:
On windows, there are limitations to what and how one can do this
But I know things are done a bit better in the nix world in many regards
I was just wondering if you know of a way to do this is on these nas builds
The reason I go down this path, is there have been previous versions of Twonky
that if they got stuck on scanning, would use 100% cpu resources
and it would be great to set the service to a belownormal priority level
which wouldnt solve the 100% load, but it would allow the box as a whole to operate
without getting hammered
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Why would CPU affinity matter in that case? If it's single threaded it can only consume a core - regardless of which. CPU affinity only matters in edge cases, where the cache miss/refresh is a major impact - this isn't one of those cases.phibertron wrote: Out of curiosity, is there anyway that you know of to start twonky with cpu affinity and or prioroty level
On windows, there are limitations to what and how one can do this
But I know things are done a bit better in the nix world in many regards
I was just wondering if you know of a way to do this is on these nas builds
The reason I go down this path, is there have been previous versions of Twonky
that if they got stuck on scanning, would use 100% cpu resources
and it would be great to set the service to a belownormal priority level
which wouldnt solve the 100% load, but it would allow the box as a whole to operate
without getting hammered
The command, where it's installed, is taskset. To change the priority use nice, a command that is usually available. Note that I don't know if you can launch a process both bound to a particular CPU and at a lower priority.
No longer running Twonky
- phibertron
- Posts:1566
- Joined:Sun Jan 30, 2011 5:52 pm
- AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000
Encoders
========
Handbrake
x264
ffmpeg
mencoder
Tagging
======
mp3tag
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Thanks for the feedback
Im not worried about the affinity anymore, the nice command is the one I was looking for
Thanks again
GotchaDaemonBeetle wrote:Why would CPU affinity matter in that case? If it's single threaded it can only consume a core - regardless of which. CPU affinity only matters in edge cases, where the cache miss/refresh is a major impact - this isn't one of those cases
Based on the single threadingDaemonBeetle wrote:The command, where it's installed, is taskset. To change the priority use nice, a command that is usually available. Note that I don't know if you can launch a process both bound to a particular CPU and at a lower priority.
Im not worried about the affinity anymore, the nice command is the one I was looking for
Thanks again
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Well, you guys are talking a bit beyond my capability, but I think I followed. Adding the delay start appears to be working. I've restarted successfully 4 times, with three of them successfully scanning correctly. I;m trying to allow longer times in between my restarts. I'll run some more restarts over the next couple days.
before this, I have noticed that when I push the manual scan, or server restart my system goes into high CPU use. My fans kick on and usually won't shut down until I stop the machine. I am running this on an older Pentium4 2.8GHz. machine, so that maybe some cause to it as well. But it certainly gets real noisy when I do the manual server start.
Windows was killing me with this older machine, which is why I switched to Ubuntu. Much MUCH happier since. Never going back, even with a newer machine.
before this, I have noticed that when I push the manual scan, or server restart my system goes into high CPU use. My fans kick on and usually won't shut down until I stop the machine. I am running this on an older Pentium4 2.8GHz. machine, so that maybe some cause to it as well. But it certainly gets real noisy when I do the manual server start.
Windows was killing me with this older machine, which is why I switched to Ubuntu. Much MUCH happier since. Never going back, even with a newer machine.
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Okay, I've got a curios result. I've found that when I log off and then login again right away the script runs.
If I restart the system, then login right away the script runs.
However, if I restart, and let the system idle on the login screen (I have multiple users on this box), for a period of time. Later when I go to login, the script does not run. Shows a process status of "sleeping" and a channel of "sys_pause."
If I restart immediately, then the problem resolves itself and the script runs.
So the issues seems to be when the system is left to idle on the login screen for a length of time. This is fairly common for me as it consumes little power, and keeps things quiet.
I think I understand the beast now, and am good going forward. Unless anyone has any suggestions to jump starting the script after a long time of holding on the login screen.
Thanks for everyone's help I really appreciate it.
If I restart the system, then login right away the script runs.
However, if I restart, and let the system idle on the login screen (I have multiple users on this box), for a period of time. Later when I go to login, the script does not run. Shows a process status of "sleeping" and a channel of "sys_pause."
If I restart immediately, then the problem resolves itself and the script runs.
So the issues seems to be when the system is left to idle on the login screen for a length of time. This is fairly common for me as it consumes little power, and keeps things quiet.
I think I understand the beast now, and am good going forward. Unless anyone has any suggestions to jump starting the script after a long time of holding on the login screen.
Thanks for everyone's help I really appreciate it.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Are you sure the script is in /etc/init.d? What does the following show:
Code: Select all
ls -l /etc/rc*.d/*twonky*
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Your code didn't work for me, but i went to the /Etc/init.d and ran the ls -l
Here's the results of that list.
/etc/init.d$ ls -l
total 212
lrwxrwxrwx 1 root root 21 2010-08-28 09:50 acpid -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 652 2010-04-23 08:13 acpi-support
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 alsa-mixer-save -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 anacron -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 6157 2010-04-13 15:27 apache2
-rwxr-xr-x 1 root root 4106 2010-12-03 12:23 apparmor
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 apport -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:22 atd -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-03-08 14:57 avahi-daemon -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1785 2010-02-17 09:00 binfmt-support
-rwxr-xr-x 1 root root 1091 2010-04-09 06:32 bluetooth
-rwxr-xr-x 1 root root 2341 2009-09-07 14:58 bootlogd
-rwxr-xr-x 1 root root 2191 2010-02-16 21:08 brltty
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 console-setup -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 cron -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 3095 2010-04-09 11:06 cups
lrwxrwxrwx 1 root root 21 2011-01-20 00:10 dbus -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 dmesg -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1235 2009-02-20 12:56 dns-clean
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 failsafe-x -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1623 2010-02-15 12:16 fancontrol
-rwxr-xr-x 1 root root 2316 2010-01-26 14:51 freevo_encodingserver
-rwxr-xr-x 1 root root 2122 2010-01-26 14:51 freevo_recordserver
-rwxr-xr-x 1 root root 2078 2010-01-26 14:51 freevo_rssserver
-rwxr-xr-x 1 root root 2077 2010-01-26 14:51 freevo_webserver
-rwxr-xr-x 1 root root 2153 2010-01-26 14:51 freevo_xserver
lrwxrwxrwx 1 root root 21 2011-02-27 11:56 gdm -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1105 2010-04-13 09:40 grub-common
-rwxr-xr-x 1 root root 1329 2009-09-07 14:58 halt
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 hostname -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:30 hwclock -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:30 hwclock-save -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 irqbalance -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1893 2010-04-19 05:06 kerneloops
-rwxr-xr-x 1 root root 1293 2009-09-07 14:58 killprocs
-rwxr-xr-x 1 root root 866 2010-02-15 12:16 lm-sensors
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 module-init-tools -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2256 2009-12-03 11:04 networking
lrwxrwxrwx 1 root root 21 2011-01-07 22:01 network-interface -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-07 22:01 network-interface-security -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 network-manager -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-03-19 01:11 nmbd -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 882 2009-09-07 14:58 ondemand
-rwxr-xr-x 1 root root 2398 2010-03-06 22:49 pcmciautils
lrwxrwxrwx 1 root root 21 2011-01-30 13:31 plymouth -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:31 plymouth-log -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:31 plymouth-splash -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:31 plymouth-stop -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 420 2010-03-06 22:59 pppd-dns
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 procps -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2228 2010-03-26 19:30 pulseaudio
-rwxr-xr-x 1 root root 8863 2009-09-07 14:58 rc
-rwxr-xr-x 1 root root 801 2009-09-07 14:58 rc.local
-rwxr-xr-x 1 root root 117 2009-09-07 14:58 rcS
-rw-r--r-- 1 root root 1510 2009-09-07 14:58 README
-rwxr-xr-x 1 root root 639 2009-09-07 14:58 reboot
-rwxr-xr-x 1 root root 4400 2010-03-30 05:01 rsync
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 rsyslog -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2271 2010-04-14 22:15 saned
lrwxrwxrwx 1 root root 21 2010-10-09 02:41 screen-cleanup -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 3200 2010-03-29 20:20 sendsigs
-rwxr-xr-x 1 root root 590 2009-09-07 14:58 single
-rw-r--r-- 1 root root 4271 2009-09-07 14:58 skeleton
lrwxrwxrwx 1 root root 21 2011-03-19 01:11 smbd -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2014 2010-04-15 09:03 speech-dispatcher
-rwxr-xr-x 1 root root 519 2009-09-07 14:58 stop-bootlogd
-rwxr-xr-x 1 root root 1095 2009-09-07 14:58 stop-bootlogd-single
-rwxr-xr-x 1 root root 3873 2011-03-21 23:03 twonkymedia.sh
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 udev -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 udev-finish -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 udevmonitor -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 udevtrigger -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 ufw -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2787 2009-11-05 08:03 umountfs
-rwxr-xr-x 1 root root 2075 2009-10-14 00:16 umountnfs.sh
-rwxr-xr-x 1 root root 1683 2009-10-14 00:20 umountroot
-rwxr-xr-x 1 root root 810 2010-03-19 04:29 unattended-upgrades
-rwxr-xr-x 1 root root 1997 2009-09-07 14:58 urandom
-rwxr-xr-x 1 root root 1342 2010-03-19 17:16 winbind
-rwxr-xr-x 1 root root 2327 2010-03-07 01:22 wpa-ifupdown
-rwxr-xr-x 1 root root 1777 2008-07-01 13:41 x11-common
Here's the results of that list.
/etc/init.d$ ls -l
total 212
lrwxrwxrwx 1 root root 21 2010-08-28 09:50 acpid -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 652 2010-04-23 08:13 acpi-support
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 alsa-mixer-save -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 anacron -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 6157 2010-04-13 15:27 apache2
-rwxr-xr-x 1 root root 4106 2010-12-03 12:23 apparmor
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 apport -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:22 atd -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-03-08 14:57 avahi-daemon -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1785 2010-02-17 09:00 binfmt-support
-rwxr-xr-x 1 root root 1091 2010-04-09 06:32 bluetooth
-rwxr-xr-x 1 root root 2341 2009-09-07 14:58 bootlogd
-rwxr-xr-x 1 root root 2191 2010-02-16 21:08 brltty
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 console-setup -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 cron -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 3095 2010-04-09 11:06 cups
lrwxrwxrwx 1 root root 21 2011-01-20 00:10 dbus -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 dmesg -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1235 2009-02-20 12:56 dns-clean
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 failsafe-x -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1623 2010-02-15 12:16 fancontrol
-rwxr-xr-x 1 root root 2316 2010-01-26 14:51 freevo_encodingserver
-rwxr-xr-x 1 root root 2122 2010-01-26 14:51 freevo_recordserver
-rwxr-xr-x 1 root root 2078 2010-01-26 14:51 freevo_rssserver
-rwxr-xr-x 1 root root 2077 2010-01-26 14:51 freevo_webserver
-rwxr-xr-x 1 root root 2153 2010-01-26 14:51 freevo_xserver
lrwxrwxrwx 1 root root 21 2011-02-27 11:56 gdm -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1105 2010-04-13 09:40 grub-common
-rwxr-xr-x 1 root root 1329 2009-09-07 14:58 halt
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 hostname -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:30 hwclock -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:30 hwclock-save -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 irqbalance -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 1893 2010-04-19 05:06 kerneloops
-rwxr-xr-x 1 root root 1293 2009-09-07 14:58 killprocs
-rwxr-xr-x 1 root root 866 2010-02-15 12:16 lm-sensors
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 module-init-tools -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2256 2009-12-03 11:04 networking
lrwxrwxrwx 1 root root 21 2011-01-07 22:01 network-interface -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-07 22:01 network-interface-security -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 network-manager -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-03-19 01:11 nmbd -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 882 2009-09-07 14:58 ondemand
-rwxr-xr-x 1 root root 2398 2010-03-06 22:49 pcmciautils
lrwxrwxrwx 1 root root 21 2011-01-30 13:31 plymouth -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:31 plymouth-log -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:31 plymouth-splash -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2011-01-30 13:31 plymouth-stop -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 420 2010-03-06 22:59 pppd-dns
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 procps -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2228 2010-03-26 19:30 pulseaudio
-rwxr-xr-x 1 root root 8863 2009-09-07 14:58 rc
-rwxr-xr-x 1 root root 801 2009-09-07 14:58 rc.local
-rwxr-xr-x 1 root root 117 2009-09-07 14:58 rcS
-rw-r--r-- 1 root root 1510 2009-09-07 14:58 README
-rwxr-xr-x 1 root root 639 2009-09-07 14:58 reboot
-rwxr-xr-x 1 root root 4400 2010-03-30 05:01 rsync
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 rsyslog -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2271 2010-04-14 22:15 saned
lrwxrwxrwx 1 root root 21 2010-10-09 02:41 screen-cleanup -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 3200 2010-03-29 20:20 sendsigs
-rwxr-xr-x 1 root root 590 2009-09-07 14:58 single
-rw-r--r-- 1 root root 4271 2009-09-07 14:58 skeleton
lrwxrwxrwx 1 root root 21 2011-03-19 01:11 smbd -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2014 2010-04-15 09:03 speech-dispatcher
-rwxr-xr-x 1 root root 519 2009-09-07 14:58 stop-bootlogd
-rwxr-xr-x 1 root root 1095 2009-09-07 14:58 stop-bootlogd-single
-rwxr-xr-x 1 root root 3873 2011-03-21 23:03 twonkymedia.sh
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 udev -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 udev-finish -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 udevmonitor -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-12-27 00:12 udevtrigger -> /lib/init/upstart-job
lrwxrwxrwx 1 root root 21 2010-08-28 09:01 ufw -> /lib/init/upstart-job
-rwxr-xr-x 1 root root 2787 2009-11-05 08:03 umountfs
-rwxr-xr-x 1 root root 2075 2009-10-14 00:16 umountnfs.sh
-rwxr-xr-x 1 root root 1683 2009-10-14 00:20 umountroot
-rwxr-xr-x 1 root root 810 2010-03-19 04:29 unattended-upgrades
-rwxr-xr-x 1 root root 1997 2009-09-07 14:58 urandom
-rwxr-xr-x 1 root root 1342 2010-03-19 17:16 winbind
-rwxr-xr-x 1 root root 2327 2010-03-07 01:22 wpa-ifupdown
-rwxr-xr-x 1 root root 1777 2008-07-01 13:41 x11-common
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Unfortunately init.d is just the master list of startup scripts, it doesn't tell us what is scheduled for startup. There should be a number of directories in /etc called rcX.d where X is from 0 to 6 (and S). Those are the scripts that are called at startup (and shutdown). If you didn't see anything then it means Twonky probably isn't scheduled to start on boot.
Try:
Try:
Code: Select all
update-rc.d twonkymedia.sh defaults
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Checked all the rc* folders, and you're right, there weren't any references to TM.
Ran the update code. The codes results are below, went in and checked each of the folders and a file now exists in each one for TM.
update-rc.d: warning: /etc/init.d/twonkymedia.sh missing LSB keyword 'required-stop'
update-rc.d: warning: twonkymedia.sh start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (3 5)
update-rc.d: warning: twonkymedia.sh stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 1 2 6)
Adding system startup for /etc/init.d/twonkymedia.sh ...
/etc/rc0.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc1.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc6.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc2.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc3.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc4.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc5.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
I'll test the results with reboots later this evening.
Ran the update code. The codes results are below, went in and checked each of the folders and a file now exists in each one for TM.
update-rc.d: warning: /etc/init.d/twonkymedia.sh missing LSB keyword 'required-stop'
update-rc.d: warning: twonkymedia.sh start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (3 5)
update-rc.d: warning: twonkymedia.sh stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 1 2 6)
Adding system startup for /etc/init.d/twonkymedia.sh ...
/etc/rc0.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc1.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc6.d/K20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc2.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc3.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc4.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
/etc/rc5.d/S20twonkymedia.sh -> ../init.d/twonkymedia.sh
I'll test the results with reboots later this evening.
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Got my hopes up. Works well when the system is restarted and left at the login screen. After a long period, when I go to login, I check and the TMS is updating and running good.
If I restart and immediately login, same effect. Everything works.
If I shut down the system completely for a few hours, then startup the system and delay a login for a little while, the script doesn't run, and apparently only sees the file on one partition. upon restarting and logging in immediately, script runs just fine and finds everything.
If I restart and immediately login, same effect. Everything works.
If I shut down the system completely for a few hours, then startup the system and delay a login for a little while, the script doesn't run, and apparently only sees the file on one partition. upon restarting and logging in immediately, script runs just fine and finds everything.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Did you chose to encrypt anything during the install process? Are you running Ubuntu Desktop or Server (I'm guessing desktop)?
Please put the following before the "sleep 20":
Then complete your final test - restart and wait a while before logging in. After that review the contents of /tmp/disks.out and check to see if all the disks/partitions are mounted.
Please put the following before the "sleep 20":
Code: Select all
date > /tmp/twonky.started
df -h >/tmp/disks.out
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Okay. Will test tonight. Forgot to mention is I shut down system. for a few hours, then start and immediately login, then the script runs just fine.
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Which supports my theory that it's related to your login process, and that the required drives/partitions aren't mounted until then (for which there are a number of possible reasons).
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
The script ran fine. Started right up after login. Results of temp.out below. Also i the TMP directory there's some TMS log files as well now. My external drive is a Freeagent backup drive 300GB size. It usually is under the media folder I don't think the drive listed below is that drive as the space used/free isn't right, but maybe I'm mis-understanding something. Either way. It appears that it's all working. At least for now.
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 285G 12G 260G 5% /
none 1.5G 292K 1.5G 1% /dev
none 1.5G 0 1.5G 0% /dev/shm
none 1.5G 256K 1.5G 1% /var/run
none 1.5G 0 1.5G 0% /var/lock
none 1.5G 0 1.5G 0% /lib/init/rw
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 285G 12G 260G 5% /
none 1.5G 292K 1.5G 1% /dev
none 1.5G 0 1.5G 0% /dev/shm
none 1.5G 256K 1.5G 1% /var/run
none 1.5G 0 1.5G 0% /var/lock
none 1.5G 0 1.5G 0% /lib/init/rw
- DaemonBeetle
- Posts:305
- Joined:Mon Dec 28, 2009 11:05 am
- AV Hardware:Plex Media Server, Samsung Smart TV (2009 and 2013)
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Ah, stuff under /media is automatically mounted by a daemon, not by the system, after boot (and if you're running the Desktop version it may well require a logon to initiate that process). You'll find things much more reliable if you create an entry in /etc/fstab to mount it (somewhere else) at boot time.
No longer running Twonky
Re: Automatic Startup for TwonkyMediaServer 6.x in Ubuntu 10
Good to know. I think I'll live with it for a while and see how it goes. If becomes an issue I'll see to have it mounted differently.
I really appreciate all the help from DaemonBeetle. On a side note, I really like TMS for my PS3 works great. I also have a TM app for my "Droid" phone, and it allows me to sync/play/swap directly from my phone. It's great.
Again, thanks for all the help. I think I'm good for now.
I really appreciate all the help from DaemonBeetle. On a side note, I really like TMS for my PS3 works great. I also have a TM app for my "Droid" phone, and it allows me to sync/play/swap directly from my phone. It's great.
Again, thanks for all the help. I think I'm good for now.