nestybox / nestybox/sysbox

Redundant setting of sysctls in sysbox package install postinst script

Open
#371 0 comments 0 reactions 1 assignee View on GitHub

@rodnymolina is already working on this.

Since Jul 31, 2021.

bug
Dominant language
Shell
Stars
3.9k
Forks
230
Avg merge
7h 48m
Merged PRs (30d)
3

Description

The sysbox-ce debian package contains the /lib/sysctl/99-sysbox-sysctl.conf file configuring inotify and keys kernel values.

But the postinst script runs this section too:

# Ensure kernel's 'inotify' resources meet sysbox requirements -- default values
# in most distros are too low for decent-size scenarios.
function define_inotify_resources() {

    val=$(sysctl fs.inotify.max_queued_events)
    if [[ "${val##* }" -lt ${inotify_pool_size} ]]; then
        sysctl -w fs.inotify.max_queued_events=${inotify_pool_size} >/dev/null 2>&1
    fi

    val=$(sysctl fs.inotify.max_user_watches)
    if [[ "${val##* }" -lt ${inotify_pool_size} ]]; then
        sysctl -w fs.inotify.max_user_watches=${inotify_pool_size} >/dev/null 2>&1
    fi

    val=$(sysctl fs.inotify.max_user_instances)
    if [[ "${val##* }" -lt ${inotify_pool_size} ]]; then
        sysctl -w fs.inotify.max_user_instances=${inotify_pool_size} >/dev/null 2>&1
    fi
}

# Ensure kernel's 'keyring' resources meet sysbox requirements --
# default values in most distros are too low for decent-size
# scenarios. See definition of keyring_maxkeys variable above for
# details.
function define_keyring_resources() {

    val=$(sysctl kernel.keys.maxkeys)
    if [[ "${val##* }" -lt ${keyring_maxkeys} ]]; then
        sysctl -w kernel.keys.maxkeys=${keyring_maxkeys} >/dev/null 2>&1
    fi
}

Couln't this replaced by calling /lib/systemd/systemd-sysctl or restarting systemd-sysctl.service which should pickup /lib/sysctl/99-sysbox-sysctl.conf? Maybe there is a debhelper/systemd helper function too but i havn't found it yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.