I tested this in isolation on a Bionic VM and here is what I see:
1) nf_conntrack_max is applied upon reboot if an entry in /etc/modules and there is an entry in one of the files under /etc/sysctl.d/;
2) systemd-sysctl service is the one applying those settings. It is made to run after the systemd-modules-load unit (`After=systemd-modules-load.service`).
Could you provide more information about the status of `systemd-modules-load` and `systemd-sysctl` units: i.e. when they ran and whether the systemd-sysctl failed? Maybe something else is overriding those settings instead?
I tested this in isolation on a Bionic VM and here is what I see:
1) nf_conntrack_max is applied upon reboot if an entry in /etc/modules and there is an entry in one of the files under /etc/sysctl.d/; modules- load unit (`After= systemd- modules- load.service` ).
2) systemd-sysctl service is the one applying those settings. It is made to run after the systemd-
https:/ /github. com/systemd/ systemd/ blob/v237/ units/systemd- sysctl. service. in#L15 (upstream) /github. com/systemd/ systemd/ commit/ 0b73eab7a2185ae 0377650e3fdb820 8347a8a575 (original commit) /git.launchpad. net/ubuntu/ +source/ systemd/ tree/units/ systemd- sysctl. service. in?h=ubuntu/ bionic- updates# n15 (bionic-updates)
https:/
https:/
3) Both systemd- modules- load and systemd-sysctl run as a part of the sysinit.target - so very early in the boot process.
https:/ /www.freedeskto p.org/software/ systemd/ man/bootup. html#System% 20Manager% 20Bootup
Could you provide more information about the status of `systemd- modules- load` and `systemd-sysctl` units: i.e. when they ran and whether the systemd-sysctl failed? Maybe something else is overriding those settings instead?
➜ ~ lxc launch ubuntu:bionic ct-bionic --vm /discuss. linuxcontainers .org/t/ running- virtual- machines- with-lxd- 4-0/7519
# enable LXD agent ... https:/
➜ ~ lxc exec ct-bionic bash
root@ct-bionic:~# modprobe nf_conntrack
root@ct-bionic:~# sysctl net.nf_ conntrack_ max conntrack_ max = 32768
net.nf_
root@ct-bionic:~# echo nf_conntrack >> /etc/modules conntrack_ max = 42424242' > /etc/sysctl. d/10-conntrack. conf d/10-conntrack. conf conntrack_ max = 42424242
root@ct-bionic:~# echo 'net.nf_
root@ct-bionic:~# sysctl -p /etc/sysctl.
net.nf_
root@ct-bionic:~# reboot
# exec again
root@ct-bionic:~# lsmod | grep conntrack
nf_conntrack 135168 0
root@ct-bionic:~# sysctl net.nf_ conntrack_ max conntrack_ max = 42424242
net.nf_
root@ct-bionic:~# sudo systemctl list-dependencies daemon. service manager. service common. service update- utmp-runlevel. service service machine- id-commit. service modules- load.service random- seed.service sysctl. service
default.target
● ├─accounts-
● ├─apport.service
● ├─display-
● ├─grub-
● ├─systemd-
● ├─ureadahead.
● └─multi-user.target
# ...
● ├─basic.target
# ...
● │ ├─sysinit.target
# ...
● │ │ ├─systemd-
● │ │ ├─systemd-
● │ │ ├─systemd-
● │ │ ├─systemd-
root@ct-bionic:~# systemctl cat systemd- sysctl. service man:systemd- sysctl. service( 8) man:sysctl.d(5) cies=no shutdown. target modules- load.service # <----- this sysinit. target shutdown.target ReadWrite= /proc/sys/ net/
[Unit]
Description=Apply Kernel Variables
Documentation=
DefaultDependen
Conflicts=
After=systemd-
Before=
ConditionPathIs
[Service] /lib/systemd/ systemd- sysctl
Type=oneshot
RemainAfterExit=yes
ExecStart=
TimeoutSec=90s
root@ct-bionic:~# systemctl status systemd-sysctl sysctl. service - Apply Kernel Variables system/ systemd- sysctl. service; static; vendor preset: enabled) sysctl. service( 8)
man: sysctl. d(5) /lib/systemd/ systemd- sysctl (code=exited, status=0/SUCCESS)
● systemd-
Loaded: loaded (/lib/systemd/
Active: active (exited) since Mon 2021-05-24 09:53:27 UTC; 28min ago
Docs: man:systemd-
Process: 482 ExecStart=
Main PID: 482 (code=exited, status=0/SUCCESS)
root@ct-bionic:~# systemctl status systemd- modules- load.service modules- load.service - Load Kernel Modules system/ systemd- modules- load.service; static; vendor preset: enabled) modules- load.service( 8)
man: modules- load.d( 5) /lib/systemd/ systemd- modules- load (code=exited, status=0/SUCCESS)
● systemd-
Loaded: loaded (/lib/systemd/
Active: active (exited) since Mon 2021-05-24 09:53:27 UTC; 33min ago
Docs: man:systemd-
Process: 430 ExecStart=
Main PID: 430 (code=exited, status=0/SUCCESS)