Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #228138

Re: kbrequest & openvt

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: kbrequest & openvt
Date 2020-10-23 14:00 +0200
Message-ID <B33TH-71h-7@gated-at.bofh.it> (permalink)
References <B2Rzb-84h-7@gated-at.bofh.it> <B2Rzb-84h-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Oct 22, 2020 at 10:30:17PM +0000, mike.junk.46@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.

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

kbrequest & openvt mike.junk.46@att.net - 2020-10-23 00:50 +0200
  Re: kbrequest & openvt Greg Wooledge <wooledg@eeg.ccf.org> - 2020-10-23 14:00 +0200

csiph-web