Score:0

I need to enable numlock on the console /dev/tty{1..6} but there is no /etc/rc.local file on ubuntu focal, what is the canonical way to do that?

de flag

I need to enable numlock on the console /dev/tty{1..6} with setleds (numlockx for is dedicated to X11) :

#!/bin/sh -e

# Turn Numlock on for the TTYs:
for tty in /dev/tty[1-6]; do
    /usr/bin/setleds -D +num < $tty
done

But there is no /etc/rc.local file on my system, what is the canonical way to do that ?

muru avatar
us flag
(which in turn links to https://askubuntu.com/questions/886620/how-can-i-execute-command-on-startup-rc-local-alternative-on-ubuntu-16-10)
SebMa avatar
de flag
@muru I want to lock the numeric keypad in the console ttys not in X11/Xorg. The `numlockx` tool you propose in your [first link](https://askubuntu.com/questions/1028428/how-to-set-numlock-on-as-default-at-login-screen) is for X11 : `man numlockx | grep X11` prints ` numlockx is a program to control the NumLock key inside X11 session scripts.`
muru avatar
us flag
Good, so you can followe the second paragraph which goes "The problem is, there is no rc.local to start it anymore. You will need to configure systemd to run numlockx once after startup like rc.local would have done. ..." and then links to the second question I commented above.
SebMa avatar
de flag
@muru Your [second link](https://askubuntu.com/questions/886620) contains the solution in the [first answer](https://askubuntu.com/a/919598/426176), that is to sum things up : `sudo touch /etc/rc.local`, add the commands, and finally `sudo chmod +x /etc/rc.local` , thanks.
SebMa avatar
de flag
@mchid Yes it does. muru already gave it in his second link.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.