4

on a productive server there are (background) processes started by users which connect through SSH and run some scripts. These processes are daemons and keep on running. Each started process is found under the sshd service in systemd.

user@host:~> systemctl status sshd
● sshd.service - OpenSSH Daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: disabled)
   Active: active (running) since Di 2019-10-15 12:25:34 EDT; 1 day 16h ago
  Process: 48099 ExecStartPre=/usr/sbin/sshd-gen-keys-start (code=exited, status=0/SUCCESS)
 Main PID: 48106 (sshd)
    Tasks: 464 (limit: 512)
   CGroup: /system.slice/sshd.service
   |-  ...
   |-  ...

As you can see the number of tasks is quite high and in the last few days the limit was reached multiple times. This led to the problem that nobody was able to connect through SSH anymore. And no new processes could be started using SSH. It also was not possible to kill some of these processes. I kept on receiving bash errors that no processes could be forked.

Is this correct behaviour of systemd?

On a testing machine with identical OS I cannot reproduce this. Each process I start can be found under the user.slice using systemctl.

The sshd service looks quite empty as I would have expect it to be.

● sshd.service - OpenSSH Daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: disabled)
   Active: active (running) since Fr 2019-06-28 07:37:03 CEST; 3 months 19 days ago
  Process: 1925 ExecStartPre=/usr/sbin/sshd-gen-keys-start (code=exited, status=0/SUCCESS)
 Main PID: 1972 (sshd)
    Tasks: 1 (limit: 512)
   CGroup: /system.slice/sshd.service
           └─1972 /usr/sbin/sshd -D

Same happens for the cron service. Each process started by a cronjob is listed under the cron service and sometimes reaches the limit of 512.

My problem is also that I am not identify which configuration parameter causes this behaviour. I tryed comparing all conf files in /etc/systemd/ but find no difference.

I also checked multiple other distributions that use systemd how they behave. Debian 9, SLES12, RHEL 8. None of them behaves like the productive server shown in the first example.

0

You must log in to answer this question.

Browse other questions tagged .