How to add systemd.setenv in GRUB2

dubis asked:

I would like to add systemd.setenv=NSS_HASH_ALG_SUPPORT=+MD5 parameter in grub2 for centos7?

I don’t know which files I’ve to modify, and which lines I’ve to insert this parameter.

Thaks for your help.

My answer:

The grub configuration is found in /etc/sysconfig/grub on CentOS 7 systems.

Within you will find the default kernel command line parameters, which you can edit.

GRUB_CMDLINE_LINUX=" vconsole.font=latarcyrheb-sun16 crashkernel=auto  vconsole.keymap=us rhgb quiet"

After editing the file, run grub2-mkconfig to regenerate the grub configuration.

grub2-mkconfig > /boot/grub2/grub.cfg

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.