3

I've found this link, showing how to change the ulimits on systemd.

/etc/systemd/system/<servicename>.d/override.conf
[Service]
LimitNOFILE=49152

I found a website suggesting to change the ulimits for systemd in these files:

/etc/systemd/system.conf
/etc/systemd/user.conf

[Manager] 
DefaultLimitNOFILE=49152
  • What's the difference between this two methods?
  • What's best practive?

Thanks for input.

DiViNe
  • 33
  • 1
  • 4

1 Answers1

4

/etc/systemd/[system|user].conf are used to define default values for service unit files.

As I suppose that you only want to change settings for a single unit file, the /etc/systemd/system/<servicename>.d/override.conf is the cleanest method, and definitively a best practice.

Chaoxiang N
  • 1,218
  • 4
  • 10
  • Do you know any way of defining the limits of a specific systemctl service run by a user (--user) ? – secavfr May 13 '20 at 23:21