failed to start kernel variables error on boot

When booting, the display briefly shows the message failed to start kernel variables before returning to the graphical splash screen. However, when I check systemctl status systemd-sysctl I get:

● systemd-sysctl.service - Apply Kernel Variables
   Loaded: loaded (/usr/lib/systemd/system/systemd-sysctl.service; static; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/systemd-sysctl.service.d
           └─50-kernel-uname_r.conf
   Active: active (exited) since Fri 2018-08-17 00:20:28 MDT; 9min ago
     Docs: man:systemd-sysctl.service(8)
           man:sysctl.d(5)
 Main PID: 486 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/systemd-sysctl.service

Aug 17 00:20:28 xps systemd[1]: Starting Apply Kernel Variables...
Aug 17 00:20:28 xps systemd[1]: Started Apply Kernel Variables.

I checked /etc/sysctl.conf but everything is commented out in that file. Any ideas?

Is the exited status normal or is it supposed to be running?

Here are the relevant journal logs from the most recent boot:

Aug 19 11:06:12 xps systemd[1]: Started Load Kernel Modules.
Aug 19 11:06:12 xps systemd[1]: Starting Apply Kernel Variables...
Aug 19 11:06:12 xps kernel: device-mapper: uevent: version 1.0.3
Aug 19 11:06:12 xps kernel: device-mapper: ioctl: 4.37.0-ioctl (2017-09-20) initialised: dm-devel@redhat.com
Aug 19 11:06:12 xps systemd-sysctl[208]: Line is not an assignment at '/etc/sysctl.d/99-sysctl.conf:20': (null)
Aug 19 11:06:12 xps systemd-sysctl[208]: Couldn't write '0' to 'dev/cdrom/autoclose', ignoring: No such file or directory
Aug 19 11:06:12 xps systemd[1]: systemd-sysctl.service: Main process exited, code=exited, status=1/FAILURE
Aug 19 11:06:12 xps systemd[1]: Failed to start Apply Kernel Variables.
Aug 19 11:06:12 xps systemd[1]: systemd-sysctl.service: Unit entered failed state.
Aug 19 11:06:12 xps systemd[1]: systemd-sysctl.service: Failed with result 'exit-code'.

But then 8 seconds later:

Aug 19 11:06:20 xps systemd[1]: Started Load Kernel Modules.
Aug 19 11:06:20 xps systemd[1]: Starting Apply Kernel Variables...
Aug 19 11:06:20 xps systemd[1]: Started LVM2 metadata daemon.
Aug 19 11:06:20 xps systemd[1]: Mounted Kernel Debug File System.
Aug 19 11:06:20 xps systemd[1]: Mounted POSIX Message Queue File System.
Aug 19 11:06:20 xps systemd[1]: Mounted Huge Pages File System.
Aug 19 11:06:20 xps systemd[1]: Started Apply Kernel Variables.

From the journal logs indicating failure, it mentions the lack of assignment in

/etc/sysctl.d/99-sysctl.conf:20

however this file only has 19 lines, and all are commented out.

So, anyone know what might be looking for something on line 20 of this file? From what I understand, this file is updated from /etc/sysctl.conf, which is identical.

The status looks normal (the same as I am seeing).

From the journal logs indicating failure, it mentions the lack of assignment in

/etc/sysctl.d/99-sysctl.conf:20

however this file only has 19 lines, and all are commented out.

So, anyone know what might be looking for something on line 20 of this file? From what I understand, this file is updated from /etc/sysctl.conf, which is identical.

I would suggest that you carefully check that file. There might be a bad char, or a missing newline (line termination) at the end.

I’ll note that my file has two lines that are not commented out.

Maybe also check the date of the file. Your error messages probably come from the copy of the file in the “initrd”. If the file is newer than the “/boot/initrd*” (the one corresponding to your kernel), then you could try running “mkinitrd” (as root).