Calling for Linux/Unix Experts

soulofmusic

Active Member
Joined
Dec 7, 2011
Messages
156
Points
28
Location
bangalore
Need help from Linux/Unix Experts!

I have been using my Seagate Home NAS to run torrent client independent of PC

But the problem is, everytime the NAS is rebooted, it starts showing rpc whitelist error. I have to stop the transmission daemon. update the settings.json (add the IP) and restart the transmission daemon.

I have been struggling to find a solution, so I came up with a workaround of keeping a settings1.json with required changes ready and copying it to settings.json everytime the nas reboot.

Now I have written a shell script to do this job
=================================================
sudo /etc/init.d/transmission-daemon stop

cp /home/justluvliv/GoFlex\ Home\ Public/Torrent/settings1.json /home/justluvliv/GoFlex\ Home\ Public/Torrent/settings.json

sudo /etc/init.d/transmission-daemon start

=================================================
This shell scripts works well from command line, but I want to call this script at time of boot, so I added this to rc.local. But it doesnt work. I even tried with rc3.d and rc6.d combination. Also tried adding the bash, but no luck.

Experts please help.
 
Need help from Linux/Unix Experts!

I have been using my Seagate Home NAS to run torrent client independent of PC

But the problem is, everytime the NAS is rebooted, it starts showing rpc whitelist error. I have to stop the transmission daemon. update the settings.json (add the IP) and restart the transmission daemon.

I have been struggling to find a solution, so I came up with a workaround of keeping a settings1.json with required changes ready and copying it to settings.json everytime the nas reboot.

Now I have written a shell script to do this job
=================================================
sudo /etc/init.d/transmission-daemon stop

cp /home/justluvliv/GoFlex\ Home\ Public/Torrent/settings1.json /home/justluvliv/GoFlex\ Home\ Public/Torrent/settings.json

sudo /etc/init.d/transmission-daemon start

=================================================
This shell scripts works well from command line, but I want to call this script at time of boot, so I added this to rc.local. But it doesnt work. I even tried with rc3.d and rc6.d combination. Also tried adding the bash, but no luck.

Experts please help.

Remove sudo. you can rewrite the script like this
The shell scripts starts just below this line
#!/bin/sh
(
/etc/init.d/transmission-daemon stop
cp /home/justluvliv/GoFlex\ Home\ Public/Torrent/settings1.json /home/justluvliv/GoFlex\ Home\ Public/Torrent/settings.json
/etc/init.d/transmission-daemon start
) > /tmp/transmission-daemon.log 2>&1
# the shell script ends just above this line

Do the above and if it does not work, you will see everything in /tmp/transmission-daemon.log
 
Mate, its not able to find the settings1.json. Here is the log

Shutting down transmission-daemon: [ OK ]^M
cp: cannot stat `/home/justluvliv/GoFlex Home Public/Torrent/settings1.json': No such file or directory
Starting transmission-daemon: [ OK ]^M

Something to do with environment variable? Gosh, I hv forgotten all of it.
Can help?
 
Mate, its not able to find the settings1.json. Here is the log

Shutting down transmission-daemon: [ OK ]^M
cp: cannot stat `/home/justluvliv/GoFlex Home Public/Torrent/settings1.json': No such file or directory
Starting transmission-daemon: [ OK ]^M

Something to do with environment variable? Gosh, I hv forgotten all of it.
Can help?

Is your disk mounted? You can add debug statements. Output of any command that you put in the above script will be visible in /tmp/transmission-daemon.log. e.g. after the line to stop the transmission-daemon, you can add a line calling the df command

df -k
 
you running which distro? arch or debian. i take it, you know that if you password protect the rpc, then a whitelist can be disabled

Tapatalk on my cdma S2 !!!
 
You need to stop transmission daemon before modifying settings.json, otherwise it gets written over when the daemon actually stops. If it still doesn;t work, disable transmission, reboot system so that settings.json is not cached, modify setiings.json, reboot and enable transmission. No rc.local workaround will be required then.

Out of curiosity, does your NAS have a UPS backup? With indian power conditions, running it 24/7 is putting your disks on fast path to failure. Thats what I realised with experience :mad:
 
I guess, you are right, disk might not be mounted by the time this command is executed.. Now whr else to put it :(

Check in which rc script the mount command is being run. Add it after that script runs. You could also add it in your .profile (after you login). In that case you will require the sudo command. Sorry, I have no idea about what is tranmission-daemon so cannot provide application specific advice.
 
Going out in a few minutes, will look again later, but...

If you want to modify the behaviour of a script in /etc/init.d, you can always edit it. Please note that it is linked to scripts in the various run-level directories.

Anything that happens in those files, or in any /etc/profile or other file that is run during startup is run by root, so sudo is not necessary.

By the way, what is with the "\ Home\ " in your cp command?*

I forgot most of my Unix skill, even though it used to earn my living :o


*Oh wait... ok: the directory is called "Goflex Home Public". You can always put the "/entire path/in/quoation marks". I hate spaces in file/dir names!
 
Last edited:
FINALLY.

Used the same script, called it from rc2.d/S99... script which is one the last scripts to load, that ensured that NFS was loaded by the time my script was called.

Thanks everyone... Now, the download is going to be 24x7.....except 150GB/Month to go to 300GB/Month ;)
 
Last edited:
linux is such a PIA(pain in the a**) .... unless u are fully aware ...
purely hate the network settings in lnx that varies distro to distro ..
never prefer linux for daily use unless unavoidable .

There are people who like opensource stuff.. good for them.. billy has done a pretty good job for me
even if i develop in linux for embedded devs i hate the feel and pain of settings in linux desktops
 
purely hate the network settings in lnx that varies distro to distro ..

:lol:

Yesterday I was cursing the fact the configuration files and how to use them have changed from Ubuntu 11.04 to Ubuntu 12.04.

I mean... Why? Shuttleworth and his gang have, no doubt, done an enormous amount to popularise Linux, and to make it usable by people who just want to install and go, Their madness is change for the sake of change. And I do think it is a madness.
 
A beautiful, well-constructed speaker with class-leading soundstage, imaging and bass that is fast, deep, and precise.
Back
Top