Score:0

/etc/rc.local - is it running?

ar flag

I put the the following in /etc/rc.local, to enable the Scroll Lock LED on my keyboard - it doesn't seem to take effect:

#!/bin/bash

# enable scroll lock LED
xmodmap -e 'add mod3 = Scroll_Lock'

exit 0

I did do sudo chmod a+x /etc/rc.local to make it executable, and the script seems to work OK (makes the Scroll Lock LED work) when I execute /etc/rc.local from the terminal.

I know there are other ways to get scripts to run on boot, but I want to understand why this doesn't work.

cc flag
Does this answer your question? [How can I make /etc/rc.local run on startup?](https://askubuntu.com/questions/9853/how-can-i-make-etc-rc-local-run-on-startup)
cc flag
Look at the systemd answer of 9853.
nerdfever.com avatar
ar flag
@ubfan1: Not directly, anyway. The answer here (from Pilot6) is clear and direct - much better.
Score:1
cn flag

This command won't work for two reasons:

  1. You need to use full path to xmodmap.

  2. The command needs a user session, that is not started yet when rc.local is executed.

You an add the command to "Startup Applications".

nerdfever.com avatar
ar flag
That works - thanks!. For those who want to know how to do it from the command line, "Startup Applications" creates a .desktop folder in "~/.config/autostart".
I sit in a Tesla and translated this thread with Ai:

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.