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:
parent
ae37514c2a
commit
71b792d3fa
5 changed files with 5 additions and 12 deletions
|
@ -7,14 +7,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
IS_PACKAGE_CHECK () {
|
|
||||||
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -116,7 +116,7 @@ ynh_script_progression --message="Increasing maximum map count (sysctl)..."
|
||||||
# Increase the maximum number of files inotify can monitor.
|
# Increase the maximum number of files inotify can monitor.
|
||||||
cp -a ../conf/90-max_map_count-opensearch.conf /etc/sysctl.d/
|
cp -a ../conf/90-max_map_count-opensearch.conf /etc/sysctl.d/
|
||||||
# Then, reload the kernel configuration.
|
# 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
|
then
|
||||||
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
|
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -113,7 +113,7 @@ ynh_script_progression --message="Removing various files..."
|
||||||
if [ -e "/etc/sysctl.d/90-max_map_count-opensearch.conf" ]; then
|
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"
|
ynh_secure_remove --file="/etc/sysctl.d/90-max_map_count-opensearch.conf"
|
||||||
# Reload the kernel configuration.
|
# 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
|
then
|
||||||
sysctl --system
|
sysctl --system
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -91,7 +91,7 @@ chown $app:$app "/run/$app"
|
||||||
ynh_script_progression --message="Restoring various files..."
|
ynh_script_progression --message="Restoring various files..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/sysctl.d/90-max_map_count-opensearch.conf"
|
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
|
then
|
||||||
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
|
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -120,7 +120,7 @@ ynh_script_progression --message="Increasing maximum map count (sysctl)..."
|
||||||
# Increase the maximum number of files inotify can monitor.
|
# Increase the maximum number of files inotify can monitor.
|
||||||
cp -a ../conf/90-max_map_count-opensearch.conf /etc/sysctl.d/
|
cp -a ../conf/90-max_map_count-opensearch.conf /etc/sysctl.d/
|
||||||
# Then, reload the kernel configuration.
|
# 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
|
then
|
||||||
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
|
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue