Re: kbrequest as in older /etc/inittab

2024-01-05 Thread The Wanderer
(As is sometimes usual, I may well regret this.)

On 2024-01-05 at 07:30, Greg Wooledge wrote:

> On Thu, Jan 04, 2024 at 09:58:38PM -0600, Mike McClain wrote:
>
>> I don't think I can state any more clearly what I'm trying to do than
>> 'to tie a call to openvt to Alt Up'. I'm assuming you don't know how
>> to do that either.
> 
> And ... what does THAT do?
> 
> NAME
>openvt - start a program on a new virtual terminal (VT).
> 
> What program are you trying to start in the new VT?
> 
>> You're quite right you can increase the number of gettys
>> and you can log into every one of them before you can use them.
> 
> How does that FAIL to meet your desired state?  What do you want to do,
> that this doesn't allow?
> 
> Are you trying to "login" to a bunch of VTs as an unprivileged user
> without actually logging in?  Simply for convenience?  (If so, why
> can't you just SAY this so we know?)

I often find that it is useful to consider any given proposed course of
action in terms of three questions:

What goal are you trying to accomplish?

Why do you consider that goal to be worth accomplishing?

How do you propose to accomplish that goal?


The "how" of one goal can also be the "what" of another, and the "what"
of one goal can also be the "why" of another.


Here, the statement "tie a call to openvt to Alt+Up" is presented as the
"what", but we don't know the "why". It could either be because you want
to do this as a means to some other end, or because you want to do it
*for its own sake* - e.g., as Greg puts it, "simply for convenience".

If you want to do this for its own sake - if there is no higher "what"
behind this, if this is the end of the goal chain - then as Greg says,
it would be helpful for us to *know* that, because it will inform the
possible answers. Stating the "why" explicitly would clarify that.

On the other hand, if you want to do this as a means to accomplish some
other end - if the "what" of this goal is also the "how" of some other
goal - then in order to give useful answers, we will need to also know
at least the "what" of that other goal, and possibly also its "why".
(And, yes, that *can* apply recursively - although I would not expect it
to do so here.)

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw



signature.asc
Description: OpenPGP digital signature


Re: kbrequest as in older /etc/inittab

2024-01-05 Thread Greg Wooledge
On Thu, Jan 04, 2024 at 09:58:38PM -0600, Mike McClain wrote:
> I don't think I can state any more clearly what I'm trying to do than
> 'to tie a call to openvt to Alt Up'. I'm assuming you don't know how
> to do that either.

And ... what does THAT do?

NAME
   openvt - start a program on a new virtual terminal (VT).

What program are you trying to start in the new VT?

> You're quite right you can increase the number of gettys
> and you can log into every one of them before you can use them.

How does that FAIL to meet your desired state?  What do you want to do,
that this doesn't allow?

Are you trying to "login" to a bunch of VTs as an unprivileged user
without actually logging in?  Simply for convenience?  (If so, why
can't you just SAY this so we know?)

If that's what you want to do, then I imagine you're looking for some
invocation like:

/usr/bin/openvt -s /usr/bin/setpriv --reuid 1000 --regid 1000 --init-groups 
/bin/bash -l

Obviously change the UID and GID if those aren't right for your user
account.  I haven't tested this, so use at your own risk.  Especially
if it works -- because then anyone who gets hold of your running
system can open a login shell as you without needing your password.

If that's NOT what you're trying to do, then please TELL US what you
are trying to do, because having to guess it is frustrating.



Re: kbrequest as in older /etc/inittab

2024-01-04 Thread Mike McClain
On Mon, Jan 01, 2024 at 10:36:41AM -0600, David Wright wrote:
> Is the history of this issue relevant?
>   https://forums.raspberrypi.com/viewtopic.php?t=282768

David the most relevant part of that old post is the last line.

> On Mon, 1 Jan 2024 13:53:44 -0500 Greg Wooledge wrote:
> Oh, it's the same *name*.  Huh.  So, Mike, whatever you figured out in
> 2020, you entirely forgot, and now you're starting over in a new forum?

Yes, Greg, my name is still Mike. Have you always been Greg?

If you think I figured it out in 2020 you clearly didn't read that
post. I suggest you go back and read the last line at least.

> What are you actually trying to do?  If all you want are a bunch of
> additional text consoles, you can simply increase the number of gettys
> by editing the /etc/systemd/logind.conf file:

I don't think I can state any more clearly what I'm trying to do than
'to tie a call to openvt to Alt Up'. I'm assuming you don't know how
to do that either.

You're quite right you can increase the number of gettys
and you can log into every one of them before you can use them.

I'd like to thank you for the reference to logind.conf. I've been
looking for a while where the login on tty6 was coming from having set
ACTIVE_CONSOLES="/dev/tty[1,3]" in /etc/default/console-setup.
You are often helpful.

One of these days I'll find a solution, I thought triggerhappy might
do but so far haven't made that work either.

Be well fellas,
Still Mike
--
1984 was not meant as a blueprint for democratic governments.



Re: kbrequest as in older /etc/inittab

2024-01-01 Thread Greg Wooledge
On Mon, Jan 01, 2024 at 10:36:41AM -0600, David Wright wrote:
> On Sun 31 Dec 2023 at 23:09:42 (-0600), Mike McClain wrote:
[...]
> Is the history of this issue relevant?
> 
>   https://forums.raspberrypi.com/viewtopic.php?t=282768

Oh, it's the same *name*.  Huh.  So, Mike, whatever you figured out in
2020, you entirely forgot, and now you're starting over in a new forum?

What are you actually trying to do?  If all you want are a bunch of
additional text consoles, you can simply increase the number of gettys
by editing the /etc/systemd/logind.conf file:

...
# See logind.conf(5) for details.

[Login]
#NAutoVTs=6
...

By default, there are 6 gettys available (tty1 through tty6), but you
can increase the number here.  Or decrease it, in theory, but I can't
imagine too many uses for that.



Re: kbrequest as in older /etc/inittab

2024-01-01 Thread David Wright
On Sun 31 Dec 2023 at 23:09:42 (-0600), Mike McClain wrote:
> Prior to the introduction of systemd /etc/inittab had this line in it:
> kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this 
> work."
> and I found it useful to tie a call to openvt to Alt Up which went
> well with ALT Right or Left arrow to move between VTs.
> .
> Has anyone knowledge of how to do this under systemd?

Is the history of this issue relevant?

  https://forums.raspberrypi.com/viewtopic.php?t=282768

Cheers,
David.



Re: kbrequest as in older /etc/inittab

2024-01-01 Thread Curt
On 2024-01-01, Greg Wooledge  wrote:
>
> unicorn:~$ locate kbrequest.target
> unicorn:~$ locate kbrequest
> unicorn:~$ man -k kbrequest
> kbrequest: nothing appropriate.
> unicorn:~$ apt-cache search kbrequest
> unicorn:~$ 
>
> I can't find this in Debian 12.  Do you have more details about it?
>
>


I think it's in systemd.special.




Re: kbrequest as in older /etc/inittab

2024-01-01 Thread Greg Wooledge
On Mon, Jan 01, 2024 at 01:53:56PM +0200, Anssi Saari wrote:
> Mike McClain  writes:
> 
> > Prior to the introduction of systemd /etc/inittab had this line in it:
> > kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this 
> > work."
> > and I found it useful to tie a call to openvt to Alt Up which went
> > well with ALT Right or Left arrow to move between VTs.
> > .
> > Has anyone knowledge of how to do this under systemd?
> 
> Looks like there's a special target, kbrequest.target, which is started
> by alt-up. Some more systemd knowledge than I currently have is needed
> to tie openvt into that.

unicorn:~$ locate kbrequest.target
unicorn:~$ locate kbrequest
unicorn:~$ man -k kbrequest
kbrequest: nothing appropriate.
unicorn:~$ apt-cache search kbrequest
unicorn:~$ 

I can't find this in Debian 12.  Do you have more details about it?



Re: kbrequest as in older /etc/inittab

2024-01-01 Thread Anssi Saari
Mike McClain  writes:

> Prior to the introduction of systemd /etc/inittab had this line in it:
> kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this 
> work."
> and I found it useful to tie a call to openvt to Alt Up which went
> well with ALT Right or Left arrow to move between VTs.
> .
> Has anyone knowledge of how to do this under systemd?

Looks like there's a special target, kbrequest.target, which is started
by alt-up. Some more systemd knowledge than I currently have is needed
to tie openvt into that.



kbrequest as in older /etc/inittab

2023-12-31 Thread Mike McClain
Prior to the introduction of systemd /etc/inittab had this line in it:
kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."
and I found it useful to tie a call to openvt to Alt Up which went
well with ALT Right or Left arrow to move between VTs.
.
Has anyone knowledge of how to do this under systemd?

Thanks,
Mike
--
... what I was born does not matter,
  only what I will make of myself, only what I will become.



Re: kbrequest & openvt

2020-10-23 Thread Greg Wooledge
On Thu, Oct 22, 2020 at 10:30:17PM +, mike.junk...@att.net wrote:
> For years under sysvinit, in /etc/inittab, this line:
> kb::kbrequest:$( [ "`id -u`" -eq 0 ] && /bin/openvt -su || sudo /bin/openvt 
> -su)
> allowed me to open another VT by keying Control-UpArrow.

What a cargo-culted mess.  Mixing both forms of command substitution
syntax is sure sign that someone "borrowed" some code that they don't
understand, and then banged on it with a rock until it appeared to
work some of the time.

Why do you even need a check for the user ID of a program spawned by
init?  It's always root.

> I've had no luck generating that same functionality under systemd.
> If anyone else has managed to do this I'd sure appreciate a primer.

So, I searched google for "systemd equivalent kbrequest", and
it gave me <https://www.freedesktop.org/software/systemd/man/systemd.html>.

It has a section about a unit named kbrequest.target, under the
heading of SIGWINCH (very comparable to what the init/inittab man pages
show).

So, I would imagine what you want to do is place your command in a
customized kbrequest.target unit, which you would create under /etc.
And skip all that dumb ID-checking shell wrapper code, because it
always runs as root anyway.



kbrequest & openvt

2020-10-22 Thread mike . junk . 46
This is a command line related question, not X.

For years under sysvinit, in /etc/inittab, this line:
kb::kbrequest:$( [ "`id -u`" -eq 0 ] && /bin/openvt -su || sudo /bin/openvt -su)
allowed me to open another VT by keying Control-UpArrow.

I've had no luck generating that same functionality under systemd.
If anyone else has managed to do this I'd sure appreciate a primer.

Actually if there is another way to achieve the same results I'll gladly put 
kbrequest aside.

Thanks,
Mike



kbrequest

2006-07-10 Thread Jean-Yves F. Barbier
Bonjour,


est-ce que quelqu'un sait comment activer 'kbrequest';
j'ai bien modifié sa ligne dans '/etc/inittab' (pour
classiquement stopper la machine) mais rien ne se passe.


Jean-Yves


-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench   
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs From et
Reply-To:

To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: kbrequest

2006-07-10 Thread Frédéric Bothamy
* Jean-Yves F. Barbier [EMAIL PROTECTED] [2006-07-10 17:43] :
 Bonjour,
 
 
 est-ce que quelqu'un sait comment activer 'kbrequest';
 j'ai bien modifié sa ligne dans '/etc/inittab' (pour
 classiquement stopper la machine) mais rien ne se passe.

Tu as pensé à forcer init à relire son fichier de configuration avec
init q ?


Fred

-- 
Comment poser les questions intelligemment
http://www.gnurou.org/Writing/SmartQuestionsFr
Comment signaler efficacement un bogue
http://www.chiark.greenend.org.uk/~sgtatham/bugs-fr.html


-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench   
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs From et
Reply-To:

To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: kbrequest

2006-07-10 Thread Jean-Yves F. Barbier
Vi, Fred,

mais même après un reboot, ça ne fonctionne tjrs pas;
en fait, ça ne fonctionne plus depuis le passage de slink à woody
(à moins que ça ne soit de woody à sarge, j'sais plus)

Maintenant, tous mes claviers sont des logitech, ça pourrait
être ça?

ALT-UpArrow me donne le même résultat que UpArrow seul: un rappel
de la dernière ligne d'historique.

JY

Frédéric Bothamy wrote:
 * Jean-Yves F. Barbier [EMAIL PROTECTED] [2006-07-10 17:43] :
 Bonjour,


 est-ce que quelqu'un sait comment activer 'kbrequest';
 j'ai bien modifié sa ligne dans '/etc/inittab' (pour
 classiquement stopper la machine) mais rien ne se passe.
 
 Tu as pensé à forcer init à relire son fichier de configuration avec
 init q ?
 
 
 Fred
 


-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench   
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs From et
Reply-To:

To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: kbrequest [SOLVED]

2006-07-10 Thread Jean-Yves F. Barbier
bon je pense avoir trouvé: '/etc/console/boottime.kmap.gz' ne contient
pas la definition pour ALT-UpArrow :(

JY


-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.net/?DebianFrench   
Vous pouvez aussi ajouter le mot ``spam'' dans vos champs From et
Reply-To:

To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Alt+ArrowUp (inittab kbrequest)

1999-06-22 Thread David Wright
Quoting J Horacio MG ([EMAIL PROTECTED]):
 ~ I think you need to archive your postings and their replies a
 ~ bit more efficiently. I was about to cut and paste a previous
 ~ reply on the subject when I noticed that the question was posed
 ~ by you!
 
 I can assure you they are efficiently enough archived.  I asked why
 Alt+ArrowUp would shutdown the system while it's not configured to
 perform that task, and whether it would be safe to comment the line
 which refers to it in /etc/inittab:
 
 # Action on special keypress (ALT-UpArrow).
 kb::kbrequest:/bin/echo Keyboard Request--edit /etc/inittab to let this
 work.
 
 See?  it doesn't say anywhere to shutdown the system (at least that I
 know), but it does.
 
 The answer I got about a year ago was about configuring Ctrl+Alt+End to
 perform the shutdown task, which works perfectly.
 
 Thank you anyway for your concern

I'm sorry. I thought in light of the previous thread's reply
that you would know to look and see was already defined in
/etc/kbd/default.map.gz to produce KeyboardSignal (which you
yourself must have already made equivalent to shutdown). 
I hope it's all sorted now and you have removed
alt keycode 103 = KeyboardSignal  

Cheers,

-- 
Email:  [EMAIL PROTECTED]   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.


Re: Alt+ArrowUp (inittab kbrequest)

1999-06-22 Thread David Wright
Quoting Matt Folwell ([EMAIL PROTECTED]):
 I could be totally wrong, but I think...
 
 On Mon, Jun 21, 1999 at 12:11:52AM +0200, J Horacio MG wrote:
  I have already pressed by mistake the Alt+ArrowUp key combo, resulting
  in a system shutdown (losing all work done!).
  
  In my /etc/inittab I've got the Ctrl+Alt+End key combo configured for
  shutdowns:
  
  kb:12345:kbrequest:/sbin/shutdown -t1 -a -h now
 
 This line tells init to shutdown whenever it receives a KeyboardSignal
 from the keyboard handler, in runlevels 1-5.
 
  and some kbrequest for the Alt+ArrowUp which reads:
  
  kb::kbrequest:/bin/echo Keyboard Request--edit /etc/inittab to let this
  work.
 
 This line doesn't give any runlevels, so it won't have any effect.

That appears not to be the case. I think most slink users will
have chanced upon this message on their VCs, so it was quite a
good key definition to advertise the facility. OTOH if you
use xdm you may be totally unaware of it because Alt-Up may already
be defined to switch desktops in your window manager.

man inittab (slink) admits to being incomplete and its explanation
of runlevels could be improved.

  which says nothing about shutdown, so, why does Alt+ArrowUp perform a
  system shutdown?  Can I safely comment the line?
 
 Alt+ArrowUp and Ctrl+Alt+End both send KeyboardSignal to init, so hopefully
 you've got the line
   alt keycode 103 = KeyboardSignal
 in /etc/kbd/default.map.gz
 If you remove that it should fix it.

Cheers,

-- 
Email:  [EMAIL PROTECTED]   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.


Re: Alt+ArrowUp (inittab kbrequest)

1999-06-21 Thread David Wright
Quoting J Horacio MG ([EMAIL PROTECTED]):
 I have already pressed by mistake the Alt+ArrowUp key combo, resulting
 in a system shutdown (losing all work done!).
 
 In my /etc/inittab I've got the Ctrl+Alt+End key combo configured for
 shutdowns:
 
 kb:12345:kbrequest:/sbin/shutdown -t1 -a -h now
 
 and some kbrequest for the Alt+ArrowUp which reads:
 
 kb::kbrequest:/bin/echo Keyboard Request--edit /etc/inittab to let this
 work.
 
 which says nothing about shutdown, so, why does Alt+ArrowUp perform a
 system shutdown?  Can I safely comment the line?

I think you need to archive your postings and their replies a
bit more efficiently. I was about to cut and paste a previous
reply on the subject when I noticed that the question was posed
by you!

--8

On Sun, 20 Sep 1998, Horacio M.G. wrote:

 Hi there,
 
 how can I make a key combo work?
 In etc/inittab I get the following line:
 
 # What to do when CTRL-ALT-DEL is pressed.
 ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
 
 which is ok for shutting the system down and rebooting.  But, how
 about shutting down and halting?  I tried adding the line:
 
 # What to do when CTRL-ALT-END is pressed.
 ca:12345:ctrlaltend:/sbin/shutdown -t1 -a -h now
 
 which was just a guess, and obviously didn't work.  I suppose I
 should first of all configure [CtrlAltEnd] as a key combo, but how
 and where?

In /etc/kbd/default.map.gz:

keycode 107 = Select
altgr   control keycode 107 = KeyboardSignal
control alt keycode 107 = KeyboardSignal

and in /etc/inittab:

kb:12345:kbrequest:/sbin/shutdown -t1 -h now

I use Ctrl-Alt-Ins for halt, if you want that, it is this:

keycode 110 = Insert
altgr   control keycode 110 = KeyboardSignal
control alt keycode 110 = KeyboardSignal

That, in theory, and in practice here, works.

Good luck,
Michael Beattie ([EMAIL PROTECTED])

--8

Cheers,

-- 
Email:  [EMAIL PROTECTED]   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.


Re: Alt+ArrowUp (inittab kbrequest)

1999-06-21 Thread J Horacio MG
~ I think you need to archive your postings and their replies a
~ bit more efficiently. I was about to cut and paste a previous
~ reply on the subject when I noticed that the question was posed
~ by you!

I can assure you they are efficiently enough archived.  I asked why
Alt+ArrowUp would shutdown the system while it's not configured to
perform that task, and whether it would be safe to comment the line
which refers to it in /etc/inittab:

# Action on special keypress (ALT-UpArrow).
kb::kbrequest:/bin/echo Keyboard Request--edit /etc/inittab to let this
work.

See?  it doesn't say anywhere to shutdown the system (at least that I
know), but it does.

The answer I got about a year ago was about configuring Ctrl+Alt+End to
perform the shutdown task, which works perfectly.

Thank you anyway for your concern
-- 
Horacio
[EMAIL PROTECTED]
Valencia - ESPAÑA


Re: Alt+ArrowUp (inittab kbrequest)

1999-06-21 Thread Matt Folwell
I could be totally wrong, but I think...

On Mon, Jun 21, 1999 at 12:11:52AM +0200, J Horacio MG wrote:
 I have already pressed by mistake the Alt+ArrowUp key combo, resulting
 in a system shutdown (losing all work done!).
 
 In my /etc/inittab I've got the Ctrl+Alt+End key combo configured for
 shutdowns:
 
 kb:12345:kbrequest:/sbin/shutdown -t1 -a -h now

This line tells init to shutdown whenever it receives a KeyboardSignal
from the keyboard handler, in runlevels 1-5.

 and some kbrequest for the Alt+ArrowUp which reads:
 
 kb::kbrequest:/bin/echo Keyboard Request--edit /etc/inittab to let this
 work.

This line doesn't give any runlevels, so it won't have any effect.

 which says nothing about shutdown, so, why does Alt+ArrowUp perform a
 system shutdown?  Can I safely comment the line?

Alt+ArrowUp and Ctrl+Alt+End both send KeyboardSignal to init, so hopefully
you've got the line
  alt keycode 103 = KeyboardSignal
in /etc/kbd/default.map.gz
If you remove that it should fix it.

-- 
Matt Folwell, Trinity College, Cambridge.  CB2 1TQ
[EMAIL PROTECTED]
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!


Alt+ArrowUp (inittab kbrequest)

1999-06-20 Thread J Horacio MG
I have already pressed by mistake the Alt+ArrowUp key combo, resulting
in a system shutdown (losing all work done!).

In my /etc/inittab I've got the Ctrl+Alt+End key combo configured for
shutdowns:

kb:12345:kbrequest:/sbin/shutdown -t1 -a -h now

and some kbrequest for the Alt+ArrowUp which reads:

kb::kbrequest:/bin/echo Keyboard Request--edit /etc/inittab to let this
work.

which says nothing about shutdown, so, why does Alt+ArrowUp perform a
system shutdown?  Can I safely comment the line?

TIA
-- 
Horacio
[EMAIL PROTECTED]
Valencia - ESPAÑA


kbrequest

1998-12-17 Thread Eugene Sevinian
Hi,
I have read that it is possible to 
run commands using kbrequest. However this does not work 
for me. Here is the corresponding strings from inittab:
kb::kbrequest:/bin/echo abc
... and keybinding from map file:

keycode 103 = Up
alt keycode 103 = KeyboardSignal

Pressing (ALT-UpArrow) simply shows command's history and nothing more.
What is going wrong? 

TIA,

Eugene Sevinian


CRD, YerPhI, 375036, Armenia
Phone: 374-2-344873