LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 04-13-2018, 06:52 AM   #1
Terry Coats
Member
 
Registered: Mar 2017
Posts: 122

Rep: Reputation: 54
How do I run "kbdrate" as non-root?


I'm having trouble figuring out how to run "kbdrate" as a regular user.
I need this as my keyboard spews out characters like bullets out of a
machine gun if I don't slow it down. It makes it almost impossible to type.
The problem is kbdrate won't run as a regular user. Root runs it fine.
I can put
Code:
kbdrate -r 10 -d 500
into root's .bash_profile and it works fine. For root.
I can insert the same code into /etc/profile and it runs fine. For root.
When I put the same code into my /home/terry/.bash_profile and login as my user
I'm told "operation not permitted."
When
Code:
kbdrate -r 10 -d 500
is placed in system-wide /etc/profile and I log in as my regular user
once again I get a message "operation not permitted."
So root gets to have a behaved keyboard but my regular user does not.
I've worked around this by placing code
Code:
sudo kbdrate -r 10 -d 500
into my regular user's .bash_profile and it works. I've configured sudo so
regular user can run privileged commands with out a password.
I guess my question is how to run "kbdrate" so it works for every user when the
system boots up? It shouldn't be this hard.
 
Old 04-13-2018, 10:59 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
you can try
Code:
xset r rate 500 10
man xset


https://wiki.archlinux.org/index.php...ration_in_Xorg

http://suso.suso.org/xulu/Setting_yo...t_rate_under_X.

Last edited by BW-userx; 04-13-2018 at 11:03 AM.
 
Old 04-13-2018, 12:00 PM   #3
Terry Coats
Member
 
Registered: Mar 2017
Posts: 122

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by BW-userx View Post
Thanks but I don't have x running yet. I'm just starting blfs 8.2.
I probably should have mentioned that. I just have text console.
 
Old 04-13-2018, 12:49 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Terry Coats View Post
Thanks but I don't have x running yet. I'm just starting blfs 8.2.
I probably should have mentioned that. I just have text console.
OIC, well try putting
Code:
kbdrate -r 10 -d 500
in rc.local so when you boot hopefully it sets it system wide. its worth a try.
 
1 members found this post helpful.
Old 04-13-2018, 02:34 PM   #5
Terry Coats
Member
 
Registered: Mar 2017
Posts: 122

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by BW-userx View Post
OIC, well try putting
Code:
kbdrate -r 10 -d 500
in rc.local so when you boot hopefully it sets it system wide. its worth a try.
lfs doesn't have an rc.local but thanks for the idea. I was able to
cook something up by looking at how the system starts things up.

I made a very short script called "kbd"
Code:
#!/bin/sh
#set keyboard rate
kbdrate -r 10 -d 500
and put it in /etc/init.d and made it executable. see "chmod --help"
for how to do this. I then made symlinks from the runlevels I'll be using.
Code:
cd /etc/rc.d/rc3.d
ln -s ../init.d/kbd S999kbd
Code:
cd /etc/rc.d/rc5.d
ln -s ../init.d/kbd S999kbd
Seems to be working ok although I'm not sure this is the professional
solution but whatever works I guess.
The linking looks kind of odd but there's an "/etc/init.d" and an "/etc/rc.d/init.d"
and they are linked together. I've forgotten the reason lfs does this.
I'll mark this solved.
 
Old 04-13-2018, 03:01 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Terry Coats View Post
lfs doesn't have an rc.local but thanks for the idea. I was able to
cook something up by looking at how the system starts things up.

I made a very short script called "kbd"
Code:
#!/bin/sh
#set keyboard rate
kbdrate -r 10 -d 500
and put it in /etc/init.d and made it executable. see "chmod --help"
for how to do this. I then made symlinks from the runlevels I'll be using.
Code:
cd /etc/rc.d/rc3.d
ln -s ../init.d/kbd S999kbd
Code:
cd /etc/rc.d/rc5.d
ln -s ../init.d/kbd S999kbd
Seems to be working ok although I'm not sure this is the professional
solution but whatever works I guess.
The linking looks kind of odd but there's an "/etc/init.d" and an "/etc/rc.d/init.d"
and they are linked together. I've forgotten the reason lfs does this.
I'll mark this solved.
you should be able to create one.
Code:
$ cat /etc/rc.d/rc.local
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
 
Old 04-14-2018, 07:00 AM   #7
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
Would setting the suid bit on the actual /usr/bin/kbdrate binary have also worked?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Alternative of "updatedb" on linux(Ubuntu) or Run "updatedb" without root user(with normal user) rutul.5085 Linux - Newbie 3 05-06-2016 04:08 AM
[SOLVED] "su: must be run from a terminal" How best for root to run command as user simonb Linux - Newbie 1 04-01-2012 02:40 AM
Net-SNMP - Run a command as root with "extend" feature gimpy530 Linux - Software 0 07-13-2010 09:03 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
[SOLVED] Need to recover or change root password. And must run "nano". ShellyCat Linux - Newbie 10 07-14-2007 03:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 03:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration