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

Fix issue with CI which cannot install files under /etc/sysctl.d/

This commit is contained in:
Florent 2024-03-05 13:21:14 +01:00
parent 390d5a3d55
commit 3c48c68801
4 changed files with 15 additions and 12 deletions

View file

@ -37,7 +37,9 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/etc/sysctl.d/90-max_map_count-opensearch.conf"
if [ "${container:-}" != "lxc" ]; then # lxc doesn't allow sysctl to play with kernel options.
ynh_backup --src_path="/etc/sysctl.d/90-max_map_count-opensearch.conf"
fi
#=================================================
# BACKUP SYSTEMD

View file

@ -23,7 +23,7 @@ ynh_app_setting_set --app="$app" --key="xmx" --value="$xmx"
ynh_script_progression --message="Setting up source files..." --weight=15
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:$app" "$install_dir"
@ -47,11 +47,11 @@ chown "$app:$app" "$install_dir/config/opensearch.yml" "$install_dir/config/jvm.
#=================================================
ynh_script_progression --message="Increasing maximum map count (sysctl)..."
# Increase the maximum number of files inotify can monitor.
ynh_add_config --template="90-max_map_count-opensearch.conf" --destination="/etc/sysctl.d/"
if [ "${container:-}" != "lxc" ]; then # lxc doesn't allow sysctl to play with kernel options.
# Increase the maximum number of files inotify can monitor.
ynh_add_config --template="90-max_map_count-opensearch.conf" --destination="/etc/sysctl.d/"
# Then, reload the kernel configuration.
if ! [ "${container:-}" = "lxc" ]; then # lxc doesn't allow sysctl to play with kernel options.
# Then, reload the kernel configuration.
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
fi

View file

@ -33,8 +33,8 @@ chown -R "$app:www-data" "$data_dir"
#=================================================
ynh_script_progression --message="Restoring various files..."
ynh_restore_file --origin_path="/etc/sysctl.d/90-max_map_count-opensearch.conf"
if ! [ "${container:-}" = "lxc" ]; then # lxc doesn't allow sysctl to play with kernel options.
if [ "${container:-}" != "lxc" ]; then # lxc doesn't allow sysctl to play with kernel options.
ynh_restore_file --origin_path="/etc/sysctl.d/90-max_map_count-opensearch.conf"
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
fi

View file

@ -46,10 +46,11 @@ chown "$app:$app" "$install_dir/config/opensearch.yml" "$install_dir/config/jvm.
#=================================================
ynh_script_progression --message="Increasing maximum map count (sysctl)..."
# Increase the maximum number of files inotify can monitor.
ynh_add_config --template="90-max_map_count-opensearch.conf" --destination="/etc/sysctl.d/"
# Then, reload the kernel configuration.
if ! [ "${container:-}" = "lxc" ]; then # lxc doesn't allow sysctl to play with kernel options.
if [ "${container:-}" != "lxc" ]; then # lxc doesn't allow sysctl to play with kernel options.
# Increase the maximum number of files inotify can monitor.
ynh_add_config --template="90-max_map_count-opensearch.conf" --destination="/etc/sysctl.d/"
# Then, reload the kernel configuration.
sysctl -p /etc/sysctl.d/90-max_map_count-opensearch.conf
fi