ulimit values for transmission script torrent done

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
WonderSir1234
Posts: 10
Joined: Sun Jan 28, 2018 12:33 am

ulimit values for transmission script torrent done

Post by WonderSir1234 » Sun Feb 11, 2018 12:48 am

I'm running into ulimit problems when trying to run rclone from my script. See herehttps://forum.rclone.org/t/potential-bu ... enwrt/4726

In my script I want virtual memory to be unlimited. When I run the script with ulimit -v in bash to check the limit I get

Code: Select all

+ ulimit -v
250781
Which is odd because

Code: Select all

cat /proc/1970/limits
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            8388608              unlimited            bytes     
Max core file size        0                    0                    bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             4010                 4010                 processes 
Max open files            1024                 4096                 files     
Max locked memory         65536                65536                bytes     
Max address space         256800000            256800000            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       4010                 4010                 signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us  
Doesn't show that limit anywhere. I tried setting ulimit -v unlimited in /etc/init.d/transmission as the very first line (as suggested https://www.dd-wrt.com/phpBB2/viewtopic.php?p=410851 and https://stackoverflow.com/questions/345 ... t-in-linux but I still get

Code: Select all

+ ulimit -v
250781
when I run the script. So I tried setting it directly in the script.

Unfortunately I get this error when trying to set it in the script:

Code: Select all

+ ulimit -v unlimited
sh: error setting limit: Operation not permitted
I am running transmission daemon with the user and would like to continue to do that. Is there any way to set ulimit in the script without running it as root? Thanks for your help.

mike.dld
Transmission Developer
Posts: 283
Joined: Wed Dec 25, 2013 10:56 pm

Re: ulimit values for transmission script torrent done

Post by mike.dld » Mon Feb 12, 2018 8:07 am

Please don't double-post. Previous thread removed.

The limit is clearly shown in "Max address space" line. It's in different units, but if you divide 256800000 by 1024 you'll get exactly 250781.

WonderSir1234
Posts: 10
Joined: Sun Jan 28, 2018 12:33 am

Re: ulimit values for transmission script torrent done

Post by WonderSir1234 » Wed Feb 14, 2018 2:41 pm

mike.dld wrote:Please don't double-post. Previous thread removed.

The limit is clearly shown in "Max address space" line. It's in different units, but if you divide 256800000 by 1024 you'll get exactly 250781.
Thanks, sorry about that. I had more information and realized my last thread was in the wrong place.

Hmm good find, how do I update that to "unlimited" or at least a larger number? And will there be a problem if I set it to unlimited?

mike.dld
Transmission Developer
Posts: 283
Joined: Wed Dec 25, 2013 10:56 pm

Re: ulimit values for transmission script torrent done

Post by mike.dld » Thu Feb 15, 2018 3:53 am

Check the /etc/security/limits.conf (or additional files in /etc/security/limits.d/) to see and adjust the global limits. The "item" (3rd column) will be "as" in your case. If there is no rule for transmission, you could add one; either refer to the comments in the file itself or to `man limits.conf` (if you have the manual pages installed).

WonderSir1234
Posts: 10
Joined: Sun Jan 28, 2018 12:33 am

Re: ulimit values for transmission script torrent done

Post by WonderSir1234 » Fri Feb 16, 2018 2:46 pm

mike.dld wrote:Check the /etc/security/limits.conf (or additional files in /etc/security/limits.d/) to see and adjust the global limits. The "item" (3rd column) will be "as" in your case. If there is no rule for transmission, you could add one; either refer to the comments in the file itself or to `man limits.conf` (if you have the manual pages installed).
Hmm unfortunately in LEDE (https://lede-project.org/) that folder doesn't exist. In fact I don't think we can configure the limits through LEDE.

WonderSir1234
Posts: 10
Joined: Sun Jan 28, 2018 12:33 am

Re: ulimit values for transmission script torrent done

Post by WonderSir1234 » Sat Feb 17, 2018 5:41 pm

I just researched again, I think I can change it from /etc/init.d/transmission

Right now it's sitting here:
https://github.com/openwrt/packages/blo ... ssion.init

But I don't want to change the init file all the time after every update.

Code: Select all

if test -z $USE; then
		procd_set_param limits core="0 0"
	else
		procd_set_param limits core="0 0" as="$USE $USE"
		logger -t transmission "Starting with $USE virt mem"
	f
I think that's what I have to change, but is there a better way to do this?

I also tried asking in the LEDE forum how to set ulimit https://forum.lede-project.org/t/settin ... conf/11731

Post Reply