Files
qt5/coin/provisioning/common/linux/set_ulimit.sh
Lucie Gérard eecfb19548 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.

Pick-to: 6.5 6.6
Task-number: QTBUG-67283
Task-number: QTBUG-108364
Change-Id: If26e4d35c780db4a7982bb84872b251dad24716e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-12 12:10:41 +00:00

33 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (C) 2021 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# This script will set ulimit size for open files
# Linker for Qt Webengine builds needs to open a multiple files. Without this it will hit the limit.
file="/etc/security/limits.conf"
file2="/etc/pam.d/common-session"
sudo sed -i '/End of file/d' $file
sudo tee -a $file <<"EOF"
* soft nproc 4096
* hard nproc 4096
* soft nofile 4096
* hard nofile 4096
root soft nproc 4096
root hard nproc 4096
root soft nofile 4096
root hard nofile 4096
# End of file
EOF
sudo sed -i '/end of pam-auth-update config/d' $file2
sudo tee -a $file2 <<"EOF"
session required pam_limits.so
# end of pam-auth-update config
EOF
# This is required for UI login. Without this the ulimit will be 1024 during graphical login.
sudo tee -a /etc/systemd/user.conf <<"EOF"
DefaultLimitNOFILE=4096
EOF