zebra1122 / snake-os

Automatically exported from code.google.com/p/snake-os
0 stars 0 forks source link

transmission-2.73-1 restarts every minute #351

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. FW version SNAKE OS V1.3.2 (20111019)
2. Transmission: transmission-2.73-1.opk
3. Set "Restart every 12 hours:" checkbox on Services\transmission screen of 
Snake-OS's administrative WEB UI.
4. Observe problem:
4.1. Go to transmission WEB UI and wait at least 1 minute -> connection lost 
dialog appears every 1 minute
4.2. Return to Snake-OS's administrative WEB UI and visit System\Log screen: 
browsing for "crond" messages like
... 12:59:01 crond[...]: crond: USER root pid ... cmd sh 
/opt/etc/init.d/transmission restart
...
... 12:59:02 crond[...]: crond: USER root pid ... cmd sh 
/opt/etc/init.d/transmission restart

What is the expected output? What do you see instead?
/transmission restart should appear every 12 hours.

What version of the product are you using? On what operating system?
FW version SNAKE OS V1.3.2 (20111019)
Transmission: transmission-2.73-1.opk

Please provide any additional information below.

DS: crond job incorrectly configured by transmission.

EXPL: unpack transmission-2.73-1.opk and examine function update_cronjob() of 
data.tar/etc/init.d/transmission: first asterisk of crontab's config file means 
ANY minute of period.

RCPT: do not use "Restart every 12 hours:" option of transmission-2.73-1.opk 

SUGGESTION:
if You need to "Restart every 12 hours:" then:

Do not forget to uncheck the "Restart every 12 hours:" first.

Than apply ONE of:

A. (every time (!) after (re)installation of transmission-2.73-1.opk)
fix /opt/etc/init.d/transmission functions update_cronjob() and 
remove_cronjob() respectively: 
(beware of extra line-feeds)
search for:
remove_cronjob() {
    sed -i /"\* \*\/12 \* \* \* sh \/opt\/etc\/init.d\/transmission restart"/d /etc/cron.d/root /etc/cron.d/root
}

replace with:
remove_cronjob() {
    sed -i /"0 \*\/12 \* \* \* sh \/opt\/etc\/init.d\/transmission restart"/d /etc/cron.d/root /etc/cron.d/root
}

search for:
update_cronjob() {
    remove_cronjob
    echo "* */12 * * * sh /opt/etc/init.d/transmission restart" >>  /etc/cron.d/root
}

replace with:
update_cronjob() {
    remove_cronjob
    echo "0 */12 * * * sh /opt/etc/init.d/transmission restart" >>  /etc/cron.d/root
}

B. preferred solution for advanced users:
 - unpack transmission-2.73-1.opk
 - unpack data.tar
 - apply above replacements to etc/init.d/transmission
 - repack to new data.tar than - transmission-2.73-xx.opk
 - install custom transmission-2.73-xx.opk with opkg

Now You can use "Restart every 12 hours:".

Original issue reported on code.google.com by Andrej.S...@gmail.com on 4 Feb 2013 at 12:18

GoogleCodeExporter commented 8 years ago
Whoops.. thanks. I should test this better.

Maybe this would be even more appropriate (without the minutes).

remove_cronjob() {
    sed -i /" \*\/12 \* \* \* sh \/opt\/etc\/init.d\/transmission restart"/d /etc/cron.d/root /etc/cron.d/root
}

Otherwise it would not remove the faulty cronjob if it somehow got saved 
permanently.

I'll put up a new package soonish. There's a new version of transmission out 
anyway.

Original comment by stefansc...@googlemail.com on 4 Feb 2013 at 5:30

GoogleCodeExporter commented 8 years ago
Appreciate the wisdom.
I removed wrong job manually than inserted 'Do not forget to uncheck the 
"Restart every 12 hours:" first.' into my SUGGESTION. But your solution is 
better. 

Original comment by Andrej.S...@gmail.com on 4 Feb 2013 at 8:36

GoogleCodeExporter commented 8 years ago
New package up:

http://code.google.com/p/snake-os/downloads/detail?name=transmission-2.76-1.opk

Original comment by stefansc...@googlemail.com on 4 Feb 2013 at 11:34