I need to disable all screen blanking/locking as part of os (rhel7.3) install. After searching I have found that
gsettings set org.gnome.desktop.session idle-delay 0
works when testing this from a graphical terminal after install. However, when I do this from the scripts run as initial setup, it fails.
I have tried to do it as part of a script that is run in runlevel 3 at the end of installation, that fails with:
dconf-WARNING **: failed to commit changes to dconf: Error spawning command line 'dbus-launch --autolaunch=(long hex id here) --binary-syntax --close-stderr': Child process exited with code 1
and to make a oneshot systemd service
[Unit] Description=Disable screen blanking [Service] Type=oneshot ExecStart=/usr/bin/gsettings set org.gnome.desktop.session idle-delay 0 [Install] WantedBy=graphical.target
but I get the same error message in the log shown by
systemctl status ssoff.
(I realize that this will run on each boot which is not The Right Way, but I figured if it worked it would be Good Enough.)
It seems that the system is somehow not ready for this command in these situations? How can I achieve this without manually doing it at the end?