You are not logged in.

#1 2017-06-01 08:07:02

loadlover
Member
Registered: 2017-05-10
Posts: 103

[SOLVED] Suppressing tty cursor during reboot & shut down procedure

Hello all,

Well, along the lines of this Wiki, https://wiki.archlinux.org/index.php/Silent_boot, I have been trying to suppress (hide) the tty cursor as Arch reboots & shuts down. The command itself is not the problem:

setterm -cursor off > /dev/tty1

Works fine. However, getting this command to be issued and responded to in a timely manner seems harder to achieve. I want it to be pretty much the first thing that happens when the user clicks the GNOME shut down or restart options so that it is suppressed (hidden) for the duration of the (sometimes lengthy) reboot & shut down procedure.

I have read quite a bit about several different triggering mechanisms, and tried them all. None seem to work currently. Does anyone know a way off the top of your head?

Thanks,

Loady

Last edited by loadlover (2017-06-16 23:33:50)

Offline

#2 2017-06-01 08:25:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,435

Re: [SOLVED] Suppressing tty cursor during reboot & shut down procedure

loadlover wrote:

I have read quite a bit about several different triggering mechanisms, and tried them all. None seem to work currently. Does anyone know a way off the top of your head?

In order to not unnecessarily provide you with hints that have already been tried, you should elaborate on this. What have you tried? In what way did they not work correctly? Maybe one of them would've been correct but just a tiny configuration error?

Offline

#3 2017-06-01 10:27:07

loadlover
Member
Registered: 2017-05-10
Posts: 103

Re: [SOLVED] Suppressing tty cursor during reboot & shut down procedure

OK, one way I tried was to set up a service to run a script on reboot & shutdown:

/lib/systemd/system/0.service

[Unit]
Description=0.service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/usr/local/bin/0.sh

[Install]
WantedBy=multi-user.target

This is enabled via # systemctl enable 0.service

I also tried enabling using the full path i.e. # systemctl enable /lib/systemd/system/0.service

The script it's supposed to be executing is:

/usr/local/bin/0.sh

setterm -cursor off > /dev/tty1

The script is made executable with # chmod 777. But the overall result is that nothing seems to happen sad. Need to think more..?

EDIT: Oh my God! I have solved it. I changed the 0.sh script to:

#!/bin/bash
echo -e '\033[?17;0;0c' > /dev/tty1

And everything works! Now, there's a couple of things going on here.. but I need to think even more to understand exactly what my conclusions should be.

EDIT FURTHER:

My conclusions, right or wrong, are:
a) The shebang is necessary.
b) setterm doesn't work because.. it is just too late to use when called? Anyone?

Last edited by loadlover (2017-06-16 23:41:42)

Offline

Board footer

Powered by FluxBB