1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/opensearch_ynh.git synced 2024-09-03 19:46:35 +02:00

Change check before running sysctl (any lxc container)

This commit is contained in:
Florent 2023-01-09 12:40:50 +01:00
parent ae37514c2a
commit 71b792d3fa
5 changed files with 5 additions and 12 deletions

View file

@ -7,14 +7,7 @@
#=================================================
# PERSONAL HELPERS
#=================================================
IS_PACKAGE_CHECK () {
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]
then
return 0
else
return 1
fi
}
#=================================================
# EXPERIMENTAL HELPERS
#=================================================

View file

@ -116,7 +116,7 @@ ynh_script_progression --message="Increasing maximum map count (sysctl)..."
# Increase the maximum number of files inotify can monitor.
cp -a ../conf/90-max_map_count-opensearch.conf /etc/sysctl.d/
# Then, reload the kernel configuration.
if ! IS_PACKAGE_CHECK # LXC doesn't allow sysctl to play with kernel options.
if ! [ "$container" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options.
then
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
fi

View file

@ -113,7 +113,7 @@ ynh_script_progression --message="Removing various files..."
if [ -e "/etc/sysctl.d/90-max_map_count-opensearch.conf" ]; then
ynh_secure_remove --file="/etc/sysctl.d/90-max_map_count-opensearch.conf"
# Reload the kernel configuration.
if ! IS_PACKAGE_CHECK # LXC doesn't allow sysctl to play with kernel options.
if ! [ "$container" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options.
then
sysctl --system
fi

View file

@ -91,7 +91,7 @@ chown $app:$app "/run/$app"
ynh_script_progression --message="Restoring various files..."
ynh_restore_file --origin_path="/etc/sysctl.d/90-max_map_count-opensearch.conf"
if ! IS_PACKAGE_CHECK # LXC doesn't allow sysctl to play with kernel options.
if ! [ "$container" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options.
then
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
fi

View file

@ -120,7 +120,7 @@ ynh_script_progression --message="Increasing maximum map count (sysctl)..."
# Increase the maximum number of files inotify can monitor.
cp -a ../conf/90-max_map_count-opensearch.conf /etc/sysctl.d/
# Then, reload the kernel configuration.
if ! IS_PACKAGE_CHECK # LXC doesn't allow sysctl to play with kernel options.
if ! [ "$container" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options.
then
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
fi