0

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 ssoff.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?

0

Both gsettings and dconf need to have DBus active.

I guess it might work like this (not tested though):

[Unit]
Description=Disable screen blanking
[Service]
Type=dbus
Busname=org.example.ssoff
ExecStart=/usr/bin/gsettings set org.gnome.desktop.session idle-delay 0
[Install]
WantedBy=graphical.target

Also available to do is dconf write /org/gnome/desktop/session/idle-delay 'uint32 0'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.