Is there a way to turn off the screen on Truenas Scale?

Hi,
I edited the /etc/systemd/logind.conf to uncomment the following lines but it didn’t succeed to turn the screen off even after a restart.

HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=lock
HandleLidSwitchExternalPower=lock
HandleLidSwitchDocked=lock
IdleAction=lock
IdleActionSec=5min

I took the options possible from this site

I know it’s not optimal to run truenas from a laptop but I don’t have the choice, I don’t have much money but the need for a NAS.

Thank you,
Sincerely,
Olivier

There’s no way anyone can ignore this.

Laptop? I’m guessing with USB drives?

Why TrueNAS, then?

Why not just keep it simple. Plug in your USBs, and share them via SMB.

thanks for your answer,
I needed some services to be setup quickly with minimal effort and with a user friendly interface for my first NAS,
I use 2 SSD, one for the OS and one for the storage, it’s very cheap I know, but for now I only have this solution and don’t want to change the OS.

I know this might be a stupid answer - change the screen brightness via keyboard?

not a stupid question haha, thanks for your answer,
I did it and changed it to be at the minimum setting but it’s not enough and the screen on with the lid closed is still creating a lot of heat and power consumption for nothing

Seeing as this is already janky, I’m not going to comment on the setup :P.

Your options are as follows:
setterm --blank 1 – Will turn off the display after 60 seconds of inactivity, needs a user to be logged in. Recommended See below why this is not recommended.

consoleblank=60 kernel parameter – Will turn off the display after 60 seconds of inactivity, does not require a user to be logged in. I really can not recommend messing around with grub config but I’m not going to tell you explicitly not to do it.

EDIT: Actually have been poking around, you should be able to set the kernel parameter like so:
midclt call system.advanced.update '{ "kernel_extra_options": "consoleblank=60" }'

1 Like

Tested this in my lab and it works perfectly. Set 60 to whatever you want (in seconds).

2 Likes

Which version of SCALE do you have installed?
If you have 23.10 or 24.04 go to System Settings > Advanced, scroll down to Sessions in 23.10 or Access in 24.04. Click Configure on that widget and set the session to timeout after five minutes or less if you want of inactivity.
Making changes in the CLI do not persist after a system reboot. Using the UI does.

Using midclt will though to the best of my knowledge as it interfaces with middleware (and considering I just tested it)

Setting session timeout will not blank the terminal / turn off the laptop display - which appears to be what they want, unless I’m mistaken?

2 Likes

thanks for your replies,
you got it right, I want to turn off the screen, not the timeout session,
but if it’s not possible to turn the screen off, well, having the console to go blank is an improvement to the situation !

But where do you enter this kernel parameter ? in the shell directly ?
I never edited the kernel parameters, do you know if it will stay active after upgrades ?

1 Like

It should persist through upgrades (as you’re making middleware aware). If you’re on SCALE you can enter it via System Settings --> Shell in the WebUI, or via SSH.
As you’re adding an extra kernel parameter, you’ll need to reboot as it will only be applied from the next boot.

1 Like

Okay, I tried this and thank you so much !

Not only the console go blank (as I expected) but the screen actually turn off !
Completely dark, no backlight, nothing ! thank you !
It’s nothing for you but you made my day, internet is magic in that sens.

Btw where did you find all the documentations for the kernel parameter of the truenas OS ?

1 Like

There’s an old community forum which is now read-only that has a wealth of information, was the first google result for “truenas adding kernel parameter”:

I already knew about the param, just didn’t know the midclt call :slight_smile:

2 Likes

okay thanks for your time ! Good to know !
I mark your answer as Solution :wink:

1 Like