1

I have a host (Ubuntu 14.04.4 LTS 64 bit, kernel 3.13.0-85-generic) that has a lot of concurrent SSH connections. SSH logins have started to fail recently, and the log says:

sshd[26057]: pam_systemd(sshd:session): Failed to create session: Cannot allocate memory

I cannot figure out even which subsystem is enforcing that limit. The machine itself has 4 GB free RAM and 0 bytes of swap in use (of 8GB):

enter image description here

I wrote a small C program that mallocs a gig of RAM, which it does without issue, so it's not a system RAM thing.

I examined the ulimit settings, and looked at /proc/<pid>/limits to find out if there are OS limits defined, but all is unlimited.

I also looked into systemd's resource limiting, like the MemoryLimit parameter in /etc/systemd/system/sshd.service.

Nothing seems to have any effect. Any idea where this memory limit comes from?

Edit:

it is weird that systemd is installed, actually. These are the systemd packages:

# aptitude search systemd|grep "^i"
i A libpam-systemd                  - system and service manager - PAM module   
i A libsystemd-daemon0              - systemd utility library                   
i A libsystemd-login0               - systemd login utility library             
i A systemd-services                - systemd runtime services                  
i A systemd-shim                    - shim for systemd

It's version 204-5ubuntu20.19.

apt-cache rdepends is not really giving me a clear idea why it's installed. It's also not fully installed. The systemctl command is not available, for one.

Edit2: The systemd components seem to be included because of dbus. If I try to install dbus on another 14.04 system, it indeeds wants to pull in systemd.

7
  • What's all this about systemd? How did it get onto your system? May 2, 2016 at 12:34
  • Ubuntu 14.04 with systemd? What systemd version is there?
    – Jakuje
    May 2, 2016 at 12:35
  • @Jakuje it's indeed weird that systemd is there. I updated the post.
    – Halfgaar
    May 2, 2016 at 13:04
  • My understanding, however, is that unless the systemd-sysv package is also installed it does not replace upstart
    – Colt
    May 2, 2016 at 13:17
  • 1
    pam_systemd should be NOP if you are not using systemd as init system according to man pam_systemd. Does it work if you remove/comment pam_systemd from /etc/pam.d/common-session or where does it come from?
    – Jakuje
    May 2, 2016 at 13:18

0

You must log in to answer this question.

Browse other questions tagged .