-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix LXC installation (fixes #41) #42
base: testing
Are you sure you want to change the base?
Conversation
!testme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly good to me. I suggested an improvement.
@@ -49,7 +49,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-elasticsearch.conf /etc/sysctl.d/ | |||
# Then, reload the kernel configuration. | |||
if ! [ "${container:-}" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. | |||
if ! [ "$(systemd-detect-virt)" == "lxc" ] # lxc doesn't allow sysctl to play with kernel options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that it works? I don't see the ==
operator in man test
page.
Otherwise, I propose this change:
if ! [ "$(systemd-detect-virt)" == "lxc" ] # lxc doesn't allow sysctl to play with kernel options. | |
if [ "$(systemd-detect-virt)" != "lxc" ] # lxc doesn't allow sysctl to play with kernel options. |
Which improves the readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it worked for me, and I just reused what's been done in the mastodon app here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I see that indeed both =
and ==
are equivalent:
https://stackoverflow.com/questions/20449543/shell-equality-operators-eq
@@ -31,7 +31,7 @@ ynh_remove_logrotate | |||
if [ -e "/etc/sysctl.d/90-max_map_count-elasticsearch.conf" ]; then | |||
ynh_secure_remove --file="/etc/sysctl.d/90-max_map_count-elasticsearch.conf" | |||
# Reload the kernel configuration. | |||
if ! [ "${container:-}" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. | |||
if ! [ "$(systemd-detect-virt)" == "lxc" ] # lxc doesn't allow sysctl to play with kernel options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ! [ "$(systemd-detect-virt)" == "lxc" ] # lxc doesn't allow sysctl to play with kernel options. | |
if [ "$(systemd-detect-virt)" != "lxc" ] # lxc doesn't allow sysctl to play with kernel options. |
@@ -37,7 +37,7 @@ chown -R $app:www-data "$data_dir" | |||
ynh_script_progression --message="Restoring various files..." --weight=1 | |||
|
|||
ynh_restore_file --origin_path="/etc/sysctl.d/90-max_map_count-elasticsearch.conf" | |||
if ! [ "${container:-}" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. | |||
if ! [ "$(systemd-detect-virt)" == "lxc" ] # lxc doesn't allow sysctl to play with kernel options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ! [ "$(systemd-detect-virt)" == "lxc" ] # lxc doesn't allow sysctl to play with kernel options. | |
if [ "$(systemd-detect-virt)" != "lxc" ] # lxc doesn't allow sysctl to play with kernel options. |
@@ -65,7 +65,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-elasticsearch.conf /etc/sysctl.d/ | |||
# Then, reload the kernel configuration. | |||
if ! [ "${container:-}" = "lxc" ] # lxc doesn't allow sysctl to play with kernel options. | |||
if ! [ "$(systemd-detect-virt)" == "lxc" ] # lxc doesn't allow sysctl to play with kernel options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ! [ "$(systemd-detect-virt)" == "lxc" ] # lxc doesn't allow sysctl to play with kernel options. | |
if [ "$(systemd-detect-virt)" != "lxc" ] # lxc doesn't allow sysctl to play with kernel options. |
Problem
Solution
PR Status
Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)