LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-15-2005, 05:49 AM   #1
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Rep: Reputation: 30
Arrow Loopback Device - memlock: Cannot allocate memory


Hi all....

I have a chroot jail setup where I want the user to be able to create and mount a loopback device. The block loop device is correct and all needed commands etc are in place (as far as I know)

I try the following:

$ losetup /dev/loop0 /home/jaileduser/data.crypt
memlock: Cannot allocate memory
Couldn't lock into memory, exiting.

So I check the memory allocation
$ ulimit -l
32

so I try:
$ulimit -l unlimited

but get the error:
ulimit: max locked memory: cannot modify limit: Operation not permitted

How can i modify this value for each chroot user or am I being mislead by the error and have forgotted something that I need to have this setup work?

Thanks in advance for any help
 
Old 12-15-2005, 08:46 AM   #2
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Original Poster
Rep: Reputation: 30
I found that this only happens when I use ssh - if I su to the account then the ulimit is set to unlimited (if this matters).
Is there a limit on the mem that ssh can use and can it be changed?
 
Old 12-15-2005, 12:07 PM   #3
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Original Poster
Rep: Reputation: 30
If I set the ulimit -l unlimited as root then su it keeps the settings - how can I change this so it uses it for all users/logons etc?

I also tried creating a etc/security/limits.conf with memloch set hard to a high value then added ulimit -l unlimited in the bashrc script - still doesn't change the memlock value when ssh/su into chroot account
Is it this that I need to change or am I on a false lead??

Anybody any ideas?
 
Old 12-15-2005, 12:21 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
only root can use memlock
 
Old 12-15-2005, 12:29 PM   #5
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by foo_bar_foo
only root can use memlock
Thanks for the reply....

How can I set this system wide so it is higher for all sessions - inc ssh etc?
Do you think this is what is causing the problem?
 
Old 12-15-2005, 05:42 PM   #6
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Original Poster
Rep: Reputation: 30
Set ulimit -l unlimited in /etc/profile
Then you can set on a per user basis by adding ulimit -l 32 (or whatever) to .bashrc in the users home
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SIOCSIFFLAGS: cannot allocate memory spage0506 Linux - Software 11 07-17-2015 09:43 PM
Cannot allocate memory Terroth Linux - General 13 02-09-2005 05:22 AM
allocate more memory? sockknitter Debian 3 11-06-2004 05:23 PM
Error: cannot allocate memory ion111 Linux - Software 7 07-04-2004 06:33 AM
unable to allocate memory vedant Linux - Hardware 0 07-15-2003 07:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration