A way to run CouchPotato Sickbeard and such source run python scripts


As this is the first time I write in a forum sorry for my mistakes from the start.

Now after getting both from their gits you can make a share folder to hold the scripts and run them from ssh for Sickbeard you need cheetah so i have copied  /usr/lib/modules/python27 to this share and used,

mount -o bind, rw /mnt/HD/HD_a2/*Share Name*/python27 /usr/lib/modules/python27

from ssh to mount python libs from my source and i was able to make cheetah installation to there.

Now i was able to run them both but after reset i need to run them again and CouchPotato settings did not save.

So first i moved .couchpotato to same directory of the script then edited runner.py options.config_file arguments.

data_dir = '/mnt/HD/HD_a2/System/cp/.couchpotato/'

    if not options.config_file:
        options.config_file = '/mnt/HD/HD_a2/System/cp/.couchpotato/settings.conf'

    if not options.pid_file:
        options.pid_file = os.path.join(data_dir, 'couchpotato.pid')

    options.config_file = '/mnt/HD/HD_a2/System/cp/.couchpotato/settings.conf'
    options.pid_file = os.path.expanduser(options.pid_file)

    return options

At last i was trying to write a bash script to run them all in one file but the mount line split into 2 and was unable to mount. Here is the script that i wrote kinda basic but it should work in treory.

mount -o bind,rw /mnt/HD/HD_a2/System/python27 /usr/local/modules/python27
python /mnt/HD/HD_a2/System/cp/CouchPotato.py &
python /mnt/HD/HD_a2/System/sb/SickBeard.py &

If someone help me with that side please do and if anyone have any other suggestions please go. And anyone asks (realy don’t want to maybe someone else can do it better) I can type out step by step instructions. Have fun :laughing:


Hi vesham and welcome to the forum, note that this type of modifications are not supported and could void the warranty. Maybe some of the other users can share some knowledge with you. 

Actually i am not modifying anything all the programs and scripts run in userspace after box a restart everything returns to normal. The modified parts remain only in the hard discs.


vesham wrote:


At last i was trying to write a bash script to run them all in one file but the mount line split into 2 and was unable to mount. Here is the script that i wrote kinda basic but it should work in treory.


mount -o bind,rw /mnt/HD/HD_a2/System/python27 /usr/local/modules/python27

I don’t think this would be possible. There already is a read-only directory at /usr/local/modules/python27, is there not?

Yes actually that is the main problem but with mounting /mnt/HD/HD_a2/System/python27 as rw (system is the share name) you change /usr/local/modules/python27 target to there (in linux you can mount a folder as another, this type of mounting is used in most distro installs) so it is in user space and all changes are made there. Right now im using systems nzbget with couchpotato and sickbeard all in the system not ideal i know but at least till i put together my mini itx for these it works. And the best of all if anyting is unsatisfactory you just restart ex4 and all is back to normal. Actually this way is allot safer than giving user all acess as everything is done wrong is left in the user space. If WD gave a startup script page to users could to this type of modification withouth comprimising whole system and if something whent wrong just reset the system to factory defaults or just delete the folder.

I am fully aware of ability to mount one folder as another in Linux. The only issue is you cannot change /usr/local/modules/python27 - as I mentioned in my last post…it is a READ-ONLY directory.

If you look at /etc/mtab, you will see this line: 

/dev/loop0 /usr/local/modules squashfs loop 0 0

That’s the filesystem stored in the firmware in squashfs format…it is READ-ONLY.

Sorry but you are misunderstadning someting even if that folder is readonly the one in the share is not when you mount it the target attributes are accepted not host. So when i moun t /mnt/HD… as  /usr/local/modules/python27 it skips  /usr/local/modules/python27 alltogeter and looks in mnt/hd… so it doesn’t matter what attributes  /usr/local/modules/python27 have it only checks the ones i put in my share.

You are setting rw (read-write) in your initial mount command, when the existing directory is read-only. See below…but I don’t believe it’ll help anyway.

From man page of Linux’s mount command ( http://linuxcommand.org/lc3_man_pages/mount8.html ):

Note that the filesystem mount options will remain the same as
those on the original mount point, and cannot be changed by
passing the -o option along with --bind/–rbind. The mount
options can be changed by a separate remount command, for exam‐
mount --bind olddir newdir
mount -o remount,ro newdir

“original mount point” is /mnt/HD/… and its rw already maybe ",rw "part was unecessery i didn’t actaully try it without it. You can’t actually use remount as you say it is not a rw file system.

Actually, you are right, I think. I was thinking, /usr/local/modules was the “original mount point” but I think that was wrong inference.

My question is, why are you trying to mount this python directory supplanting the one under modules directory? It’s not quite clear to me…but I have to go now…might not get a chance to look at this thread for some time. Good luck!

Well normaly as the folder is read only you cant install necessary moduls to run some of them but when you make a copy of the modules/phyton27 you can install them as if its normal that makes it possible to run nearly all setup scripts that does not use any other system location. Than it enables you to run any other program that can run from source script.

For example sickbeard needs cheetah module by doing this you install cheetah to your copy of python modules folder and use it to run it. Most of python modules run from there execpt the ones that need other libraries but they are not needed here.

Aah, okay…got it now. I’m not familiar with Python at all, but very familiar with Perl and I understand exactly what you mean about needing additional modules to run these apps…and therefore requiring an alternate Python custom directory.