summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-10-17 10:21:48 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-10-17 14:54:48 +0200
commitc02b6ee49637e0fe086c7ab25a2a9dc9130f5348 (patch)
treec811226a7800853a0afeb9af39fb06794e8ae100
parentc8884aceefc85245b9bdfb626e2daf27521259bd (diff)
downloadsystemd-c02b6ee49637e0fe086c7ab25a2a9dc9130f5348.tar.gz
meson: define @HIGH_RLIMIT_NOFILE@ and use it everywhere
-rw-r--r--meson.build2
-rw-r--r--src/basic/def.h1
-rw-r--r--src/core/system.conf.in2
-rw-r--r--units/systemd-journal-gatewayd.service.in2
-rw-r--r--units/systemd-journal-remote.service.in2
-rw-r--r--units/systemd-journal-upload.service.in2
-rw-r--r--units/systemd-journald.service.in2
-rw-r--r--units/systemd-logind.service.in2
8 files changed, 8 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index ee8ab1ae29..5d5783a591 100644
--- a/meson.build
+++ b/meson.build
@@ -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
@@ -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'))
#####################################################################
diff --git a/src/basic/def.h b/src/basic/def.h
index 65ad659999..005cd8d090 100644
--- a/src/basic/def.h
+++ b/src/basic/def.h
@@ -76,5 +76,4 @@
#define LONG_LINE_MAX (1U*1024U*1024U)
-#define HIGH_RLIMIT_NOFILE (256*1024)
#define HIGH_RLIMIT_MEMLOCK (1024ULL*1024ULL*64ULL)
diff --git a/src/core/system.conf.in b/src/core/system.conf.in
index 639b5818ff..ef1bbbd948 100644
--- a/src/core/system.conf.in
+++ b/src/core/system.conf.in
@@ -53,7 +53,7 @@
#DefaultLimitSTACK=
#DefaultLimitCORE=
#DefaultLimitRSS=
-#DefaultLimitNOFILE=
+#DefaultLimitNOFILE=1024:@HIGH_RLIMIT_NOFILE@
#DefaultLimitAS=
#DefaultLimitNPROC=
#DefaultLimitMEMLOCK=
diff --git a/units/systemd-journal-gatewayd.service.in b/units/systemd-journal-gatewayd.service.in
index 7530d4c2da..a51d59d101 100644
--- a/units/systemd-journal-gatewayd.service.in
+++ b/units/systemd-journal-gatewayd.service.in
@@ -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
diff --git a/units/systemd-journal-remote.service.in b/units/systemd-journal-remote.service.in
index c1de676b5c..fa8682cd28 100644
--- a/units/systemd-journal-remote.service.in
+++ b/units/systemd-journal-remote.service.in
@@ -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
diff --git a/units/systemd-journal-upload.service.in b/units/systemd-journal-upload.service.in
index b6920094fb..1ded990877 100644
--- a/units/systemd-journal-upload.service.in
+++ b/units/systemd-journal-upload.service.in
@@ -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
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
index 2c09a8b352..41cac8cf65 100644
--- a/units/systemd-journald.service.in
+++ b/units/systemd-journald.service.in
@@ -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@
diff --git a/units/systemd-logind.service.in b/units/systemd-logind.service.in
index 8b264ff29d..961263f607 100644
--- a/units/systemd-logind.service.in
+++ b/units/systemd-logind.service.in
@@ -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@