Update of Twonky daemon Mgt script for clean stop & restart
- View SourceI have update my twonky mediaserver daemon management script.(see
the file section)
Basically there was an issue during stop that would cause flaky
I do not use "killall 'mediaserver'" because this kills all the many
children processes and the server parent process does not like to
have the rung pulled from under- Therefore it takes more time to
stop and is not always successful to stop that way, so it does not
restart well afterwards.
If you really mean to kill a process you think about
SIGKILL: "killall KILL 'mediaserver'" that really stops because
instead of SIGTERM you send SIGKILL but that shoots the server in
it's tracks... not good for saving things on the fly!
The solution that seams best so far:
Look for the parent process ID and send a SIGTERM to request a
polite "please stop your all your horses". The parent process will
then speak to all it's children so they stop properly(not shot)
Here: /bin/kill $(cat /var/run/mediaserver.pid)
It shines by it's simplicity.
Buffalo/Melco as a binary they use to manage daemons which is
basically a wrapper around Linux "kill" "killall" cmds. The
string "kill $(cat /var/run/mediaserver.pid)" may be the same thing
unwrapped and better documented from Linux.
Further more if you use the Twonky server web interface,
the "Restart" button does not work too well on Linkstations... they
are not using the /bin/kill $(cat /var/run/mediaserver.pid) string -
To monitor that problem use "top" and you'll see.
Since the server is ported on many platforms the button action is
not really tuned for Linkstations.