upthetoon

Members
  • Posts

    112
  • Joined

  • Last visited

Posts posted by upthetoon

  1. hi

     

    this is an example of the startup button that works

     

    #701-unmenu_user_script_Start_Sabnzbd
    #define USER_SCRIPT_LABEL Start SABNZBD as Nobody
    #define USER_SCRIPT_DESCR start Sabnzbd as user Nobody
    #move to nobody and start SABNZBD
    su nobody -c "python /path/to/where/you/have/SABnzbd.py -d -f /boot/config/SABnzbd.ini -s IP:port"
    

     

     

    Hi sacretagent,

     

    Ii tried creating that button too but it didn't seem to work. 

     

    I tried running the command in by itself and the su command doesn't seem to work.  It's a recognised command but if  do a "whoami" after running su - nobody i'm still root.  Is it working fine on your set?

     

    I'm running 5.0 beta 2

  2. in order to make the files sabnzbd has downloaded have the file permissions i wanted, i just made a script:

     

    #!/bin/bash

    echo "  starting chownchmod script."

    echo "  file permissons of the following user shares on cache drive"

     

    if [ -d /mnt/cache/Games/ ]; then

    chmod -R 775 /mnt/cache/Games/

    chown -R root:pwusers /mnt/cache/Games/

    fi

     

    if [ -d /mnt/cache/Movies/ ]; then

    chmod -R 775 /mnt/cache/Movies/

    chown -R root:pwusers /mnt/cache/Movies/

    fi

     

    if [ -d /mnt/cache/Music/ ]; then

    chmod -R 775 /mnt/cache/Music/

    chown -R root:pwusers /mnt/cache/Music/

    fi

     

    if [ -d /mnt/cache/Videos/ ]; then

    chmod -R 775 /mnt/cache/Videos/

    chown -R root:pwusers /mnt/cache/Videos/

    fi

     

    echo "  chownchmod script complete."

    echo " "

     

    it just checks to see if such a directory exists then changes the permission on each folder (and its contents). the folder names are based on how my Categories are set up to download in sabnzbd. you will need to modify the script to suit your own categories/folders. you also need to specify the username:group since you wont have the same group "pwusers" on your system. or just remove the lines that have "chown" in it and change the lines with "chmod -R 775" to say "chmod -R 777" (this will make all the files accessible to anyone, no security basically).

     

    copy the script (after you modified it) onto your flash drive (eg, /flash/scripts/chownchmod.sh). to make this automatic, I just added a line to crontab to run the script, chownchmod.sh, every 5 minutes. if you dont know how to do this, here is an outline of the steps:

    - at the command prompt, type "crontab -e"

    - use the commands shown here http://www.computerhope.com/unix/uvi.htm#05 to edit the file. google "linux VI editor" for more help on this

    - the line you add will look something like this: */5 * * * * /boot/scripts/chownchmod.sh >/dev/null 2>&1

    - when you are finished, press "SHIFT+q" then type "qw" to save changes

     

    its not an elegant solution but it gets the job done.

     

    helpful links:

    http://www.funtoo.org/en/articles/linux/lpi/3/   search for "chown" to find the relevant part

    http://www.openjs.com/scripts/jslibrary/demos/crontab.php

     

     

    Thanks schmegg.

     

    I made a post-processing script for Sabnzbd that changes the user to nobody after each download.  That seems to work pretty well although it doesn't seem to work in every case.  I think its to do with the sorting the Sab does.  I think I'll use your idea too and run it once a day or something to change any left over folders that are missed by the post-processing script.

     

    @sacretagent

     

    You don't want to be putting it in your GO script.  Your box will take a while to boot and its not persistant, any files created after a boot will not be changed until the next boot.  If you are only using Sabnzbd you could try a post processing script.

     

    The line below will change a downloaded folder and files owner to "nobody" when used in a post-processing script;

     

    chown -R nobody:users "$1"

  3. I was having trouble getting my cache drive to sleep with Sab/SB.  I ended up making sure that any logs are written to /var/log (volatile, so it goes bye-bye after every boot) for both Sab and SB.  I disabled any blackhole checking, and switched the episode search to 4 hours.  It seems that every time I access the web GUI for SB it will spin up my cache drive.  Also, every time it performs a search it appears to spin up my drive as well, likely due to using its cache folder.  Also, if you're using nohup, I believe you have to specify a location to write its output to.  I had it set to /tmp/sb.txt before I switched over to using --daemon mode.

     

    Hope this helps.

     

    Edit: I forgot to mention, I could never get my cache drive to sleep when I was using Couchpotato despite trying just about everything.

     

    It's likely the logs then, that's the difference between my set up and yours.  I'll give that a go tonight, many thanks.

  4. I have sickbeard set up on my cache drive and it works great.  The only issue I have is the cache drive doesn't sleep with it is running.

     

    I have been through the settings a couple of times to try and see if there's a reason why but couldn't find one.  I have set it to scan for new eps every 4 hours and the backlog search every 7 days.  I'm not using the torrent blackhole feature.

     

    I'm running it in nohup mode, I'll give the new daemon mode a try tonight.

     

    Does anyone else have this issue?

  5. I use a disk share for backups and a user share for movies. They use distinct disks. Although if time machine starts working with users shares I may switch to user shares for backups.

     

    You could create a user share called "Backup" and restrict it to a specific disk or set of disks.

     

    If you only allow AFP for user shares then anyone wishing to use AFP with a disk share could just create a user share which only uses the disk they want, much like you have said above.  Wouldn't this be fine?

  6. hmm... I haven't played with the fan speed.  I do recall a screen that mentioned it in the BIOS buy I can't remember the context.

     

    I run my server headless and in a small cupboard so I can't just nip into the BIOS and have a look I'm afraid.

     

    Mine came with a free Asetek Fan Speed Controller Kit so you'd hope it would work with that!  I never bothered trying it though.

  7. I have just put in a new 2TB drive that is pre-clearing now and a 500gig drive that is destined to be a cache drive.

     

    I put the cache drive into one of the 2 sata III slots.  It is seen at the BIOS but not at the OS level.  It could be a driver issue with the sata III controller?

     

    It's a Marvell 91XX controller.  A couple of other threads include comments of people successfully using Marvell 6GB/s controllers but I'm not sure if its the same one.

     

    Any idea's where I can go from here?

     

    EDIT:

     

    A-ha!  After a bit of googling I put the controller into AHCI mode instead of IDE and the drive is now recognised.  Will be able to use it properly once I get my pro license.

     

    Hopefully it will be OK, I've had a look in unmenu and the device isn't properly recognised;

     

    03:00.0 SATA controller: Unknown device 1b4b:9123 (rev 10) (prog-if 01 [AHCI 1.0])

    Subsystem: ASUSTeK Computer Inc. Unknown device 8400

    Flags: bus master, fast devsel, latency 0, IRQ 32

    I/O ports at ec00

    I/O ports at e880

    I/O ports at e800

    I/O ports at e480

    I/O ports at e400

    Memory at f7fff800 (32-bit, non-prefetchable)

    Expansion ROM at f7fe0000 [disabled]

    Capabilities: [40] Power Management version 3

    Capabilities: [50] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable+

    Capabilities: [70] Express Legacy Endpoint, MSI 00

    Capabilities: [100] Advanced Error Reporting

    Kernel driver in use: ahci

    Kernel modules: ahci

  8. Maybe use 'su' instead of 'sudo' ?

     

    I tried running the app with "Su nobody" or "su - nobody" but it didn't do anything. I did a "ps -ef" and it wasn't running.

     

    I then tried "Su nobody" or "su - nobody"  in isolation but when I put them in the terminal if doesn't echo anything back. 

     

    Your script seems good but I'm not 100% sure what I'm doing and couldn't find a ported start-stop-daemon.

     

    I think I'll just run the new perms script against the download folders every now and then.  Thanks for the help.

  9. No. I have these applications tied into /etc/rc.d/rc.local. They automatically start that way. Once again, the handling of running as the user 'downloads' that is handled by the start-stop-daemon utility. The earlier /etc/rc.d/rc.sabnzbd script I posted passes that as a parameter to that utility.

     

    As for my security items, it's not user intensive at all. Its only 1 more step I do after verifying the downloads. I'd rather be secure than slightly less burdened but left vulnerable.

     

    The same can be accomplished by using 'at'/'cron'/'sabnzbd' to schedule the running of 'newperms' script as well.

     

    I am running unRAID 5.0beta2 installed on top of Slackware64 13.2 (Current), so its easier to do setups that persist through reboots as it's a persistent install OS.

     

    In a typical unRAID USB OS, have you tried using 'sudo' to run the files as a different user?

     

     

    The sudo command isn's present in this OS unfortunately. 

     

    Thanks for sharing your config, I'll have a proper sit down and try and set mine up in a similar way soon.

  10. Are you running sabnzbd as it's own user? Are the files it downloads owned by "nobody" still. I'm having issues with files being owned by "root" with 5.0 beta 2.

     

    I have SABnzbd/Transmission running as user 'download' and have the files setup to be owned by user 'download'. The user 'download' is only member of the group 'download'. This is my restricted user account. In this way, if those programs are compromised, then they can not access any of the files in my array. Previously I had them running as user 'nobody', but that user seems too promiscuous especially when all of your files are owned by 'nobody'.

    The files are not written directly to my array. After they are finished and I double-check the files, I do a 'chown nobody.users * && chmod 0660 *' on them before moving them into the array.

     

     

    That is quite user intensive, I admire your dedication!

     

    Do you invoke the application as another user directly from the go script? If so could you post that part of the script please?  I've tried a couple of ways but not managed it. I think I will just run it as nobody if I can manage it.

     

  11. @dimh

     

    I have yet to add a cache drive to my system so I have installed sabnzbd in a folder on my array (using the dependancy package and instructions in this thread) This is also where the temporary files are stored.

     

    My drive does spin down so your cache drive should too, there must be an issue with something.

     

    Moving the cache folder to the flash drive now allows the cache drive to spin down... I'm a happy camper :)

     

    If you use sabnzbd quite a lot this could give excessive read/writes on your flash drive?

  12. @dimh

     

    I have yet to add a cache drive to my system so I have installed sabnzbd in a folder on my array (using the dependancy package and instructions in this thread) This is also where the temporary files are stored.

     

    My drive does spin down so your cache drive should too, there must be an issue with something.