[arch-general] Where can I 'setterm -blank 5 -powerdown 6' as part of the boot process/systemd startup?
All, /sys/module/kernel/parameters/consoleblank is set to 0 by default in a change that occurred a while back. Since then, the normal text console will no longer blank or powerdown leaving your monitor on 24/7. This affects a couple of Arch servers I have. Since then I have just been turning the monitors off. Where in the boot/systemd startup can I call setterm to re-enable to normal console blank and powerdown? Remotely I can call: # TERM=linux setterm -blank 5 -powerdown 6 >/dev/tty0 </dev/tty0 to enable blank and powerdown post-boot, but I simply want to set this to be the default. Where best to set this? (passing the kernel parameter 'consoleblank=300' does not enable powerdown, so both must be set) -- David C. Rankin, J.D.,P.E.
On Fri, 25 May 2018 21:41:06 -0500 "David C. Rankin" <drankinatty@suddenlinkmail.com> wrote:
Where in the boot/systemd startup can I call setterm to re-enable to normal console blank and powerdown?
Put this into /etc/systemd/system/enable-console-blanking.service... ``` [Unit] Description=Enable virtual console blanking and poweroff [Service] Type=oneshot Environment=TERM=linux StandardOutput=tty TTYPath=/dev/console ExecStart=/usr/bin/setterm -blank 5 -powerdown 6 [Install] WantedBy=multi-user.target ``` ...then do `systemctl enable enable-console-blanking.service`. ~Celti
On 05/26/2018 03:30 AM, Celti Burroughs via arch-general wrote:
[Unit] Description=Enable virtual console blanking and poweroff
[Service] Type=oneshot Environment=TERM=linux StandardOutput=tty TTYPath=/dev/console ExecStart=/usr/bin/setterm -blank 5 -powerdown 6
[Install] WantedBy=multi-user.target
Thank you Celti! I'll give it a try. I installed the service file in /usr/lib/systemd/system and then enabled it. (I guess I should create a package for it) Is this the reason console blanking quit working? The default was removed from /sys/module/kernel/parameters/consoleblank to turn it over to systemd, but no one ever implemented the service for systemd? I don't get why for 15 years console blanking worked perfectly and then it just quit working. Now we need to create a new service file just to get the default behavior back? Seems kind of crazy. Oh well, I'll let you know if it works (I just installed 4.16.12, and enabled the service before reboot -- time will tell. If it does, is there any interest in creating a "console-blanking" package to install the service? Seems like it should be there and be set to 600 by default. Thanks again. -- David C. Rankin, J.D.,P.E.
On 05/31/2018 02:39 PM, David C. Rankin wrote:
On 05/26/2018 03:30 AM, Celti Burroughs via arch-general wrote:
[Unit] Description=Enable virtual console blanking and poweroff
[Service] Type=oneshot Environment=TERM=linux StandardOutput=tty TTYPath=/dev/console ExecStart=/usr/bin/setterm -blank 5 -powerdown 6
[Install] WantedBy=multi-user.target
Thank you Celti!
It works! After reboot, $ cat /sys/module/kernel/parameters/consoleblank 300 Awesome... -- David C. Rankin, J.D.,P.E.
Op do 31 mei 2018 21:39 schreef David C. Rankin < drankinatty@suddenlinkmail.com>:
On 05/26/2018 03:30 AM, Celti Burroughs via arch-general wrote:
[Unit] Description=Enable virtual console blanking and poweroff
[...]
I'll give it a try. I installed the service file in /usr/lib/systemd/system and then enabled it. (I guess I should create a package for it)
Indeed, either a package or place it in /etc. /usr/lib is managed by pacman, so custom files there will cause confusion. Also, systemd has an hierarchy in /etc for exactly this reason... Mvg, Guus Snijders
participants (3)
-
Celti Burroughs
-
David C. Rankin
-
Guus Snijders