Skip to content

Commit

Permalink
meson: define @HIGH_RLIMIT_NOFILE@ and use it everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
keszybz committed Oct 17, 2018
1 parent c8884ac commit c02b6ee
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '',

conf.set10('BUMP_PROC_SYS_FS_FILE_MAX', get_option('bump-proc-sys-fs-file-max'))
conf.set10('BUMP_PROC_SYS_FS_NR_OPEN', get_option('bump-proc-sys-fs-nr-open'))
conf.set('HIGH_RLIMIT_NOFILE', 256*1024)

# join_paths ignore the preceding arguments if an absolute component is
# encountered, so this should canonicalize various paths when they are
Expand Down Expand Up @@ -272,6 +273,7 @@ substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
substs.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'yes' : 'no')
substs.set('HIGH_RLIMIT_NOFILE', conf.get('HIGH_RLIMIT_NOFILE'))

#####################################################################

Expand Down
1 change: 0 additions & 1 deletion src/basic/def.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@

#define LONG_LINE_MAX (1U*1024U*1024U)

#define HIGH_RLIMIT_NOFILE (256*1024)
#define HIGH_RLIMIT_MEMLOCK (1024ULL*1024ULL*64ULL)
2 changes: 1 addition & 1 deletion src/core/system.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#DefaultLimitSTACK=
#DefaultLimitCORE=
#DefaultLimitRSS=
#DefaultLimitNOFILE=
#DefaultLimitNOFILE=1024:@HIGH_RLIMIT_NOFILE@
#DefaultLimitAS=
#DefaultLimitNPROC=
#DefaultLimitMEMLOCK=
Expand Down
2 changes: 1 addition & 1 deletion units/systemd-journal-gatewayd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ LockPersonality=yes

# If there are many split up journal files we need a lot of fds to access them
# all in parallel.
LimitNOFILE=262144
LimitNOFILE=@HIGH_RLIMIT_NOFILE@

[Install]
Also=systemd-journal-gatewayd.socket
2 changes: 1 addition & 1 deletion units/systemd-journal-remote.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LogsDirectory=journal/remote

# If there are many split up journal files we need a lot of fds to access them
# all in parallel.
LimitNOFILE=262144
LimitNOFILE=@HIGH_RLIMIT_NOFILE@

[Install]
Also=systemd-journal-remote.socket
2 changes: 1 addition & 1 deletion units/systemd-journal-upload.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ StateDirectory=systemd/journal-upload

# If there are many split up journal files we need a lot of fds to access them
# all in parallel.
LimitNOFILE=262144
LimitNOFILE=@HIGH_RLIMIT_NOFILE@

[Install]
WantedBy=multi-user.target
2 changes: 1 addition & 1 deletion units/systemd-journald.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ IPAddressDeny=any

# If there are many split up journal files we need a lot of fds to access them
# all in parallel.
LimitNOFILE=262144
LimitNOFILE=@HIGH_RLIMIT_NOFILE@
2 changes: 1 addition & 1 deletion units/systemd-logind.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ FileDescriptorStoreMax=512

# Increase the default a bit in order to allow many simultaneous logins since
# we keep one fd open per session.
LimitNOFILE=262144
LimitNOFILE=@HIGH_RLIMIT_NOFILE@

0 comments on commit c02b6ee

Please sign in to comment.