supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Vincent Danen <vdanen@linsec.ca>
To: supervision@list.skarnet.org
Subject: Re: problem with chpst and memory locking
Date: Fri, 21 Dec 2007 19:34:59 -0700	[thread overview]
Message-ID: <20071222023459.GD394@linsec.ca> (raw)
In-Reply-To: <20071222015848.GC394@linsec.ca>

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]

* Vincent Danen <vdanen@linsec.ca> [2007-12-21 18:58:48 -0700]:

[...]
> That memory setting should be well under the established limits.  An
> strace shows me:
>
> [root@artemis log]# strace chpst -m 100000 -u vdanen /bin/sh
> execve("/sbin/chpst", ["chpst", "-m", "100000", "-u", "vdanen", "/bin/sh"], [/* 41 vars */]) = 0
> open("/dev/urandom", O_RDONLY)          = 3
> read(3, "\216\266\246\243\vp\245\242", 8) = 8
> close(3)                                = 0
> open("/etc/passwd", O_RDONLY)           = 3
> lseek(3, 0, SEEK_END)                   = 1486
> mmap(NULL, 1486, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b5440b0a000
> close(3)                                = 0
> munmap(0x2b5440b0a000, 1486)            = 0
> setgroups(1, [1001])                    = 0
> setgid(1001)                            = 0
> setuid(1001)                            = 0
> getrlimit(RLIMIT_DATA, {rlim_cur=12288*1024, rlim_max=RLIM_INFINITY}) = 0
> setrlimit(RLIMIT_DATA, {rlim_cur=100000, rlim_max=RLIM_INFINITY}) = 0
> getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
> setrlimit(RLIMIT_STACK, {rlim_cur=100000, rlim_max=RLIM_INFINITY}) = 0
> getrlimit(RLIMIT_MEMLOCK, {rlim_cur=32*1024, rlim_max=32*1024}) = 0
> setrlimit(RLIMIT_MEMLOCK, {rlim_cur=32*1024, rlim_max=32*1024}) = 0
> getrlimit(RLIMIT_AS, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
> setrlimit(RLIMIT_AS, {rlim_cur=100000, rlim_max=RLIM_INFINITY}) = 0
> execve("/bin/sh", ["/bin/sh"], [/* 41 vars */]) = -1 ENOMEM (Cannot allocate memory)
> +++ killed by SIGKILL +++
>
>
> Does anyone know why this is happening?  If I'm recalling correctly, I
> think dietlibc or a change in dietlibc was the culprit before, but I
> can't remember.
>
> Removing the memory restrictions to the chpst calls works well enough,
> but it would be nice to be able to use them since they are there.

/me feels stupid

The problem is bash has been updated and apparently requires more
memory.  Time to replace those scripts with execline-based ones I think.

Sorry for the noise.

-- 
Vincent Danen @ http://linsec.ca/

[-- Attachment #2: Type: application/pgp-signature, Size: 194 bytes --]

      reply	other threads:[~2007-12-22  2:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-22  1:58 Vincent Danen
2007-12-22  2:34 ` Vincent Danen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071222023459.GD394@linsec.ca \
    --to=vdanen@linsec.ca \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).