Gentoo Archives: gentoo-user

From: covici@××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] trying to turn numlock automatically in my ttys under systemd
Date: Fri, 20 Jun 2014 16:54:02
Message-Id: 5147.1403283232@ccs.covici.com
In Reply to: Re: [gentoo-user] trying to turn numlock automatically in my ttys under systemd by "Canek Peláez Valdés"
1 Canek Peláez Valdés <caneko@×××××.com> wrote:
2
3 > On Fri, Jun 20, 2014 at 4:06 AM, <covici@××××××××××.com> wrote:
4 > > Hi. I want to turn numlock automatically, but I am using systemd and I
5 > > am having troubles doing this. At someones suggestion in a previous
6 > > message (I think Canek's) I created
7 > > /etc/systemd/system/getty@service.d/numlock.conf with the following
8 > > contents
9 > >
10 > > [Service]
11 > > ExecStartPost=/usr/bin/setleds -D -num </dev/%I
12 > >
13 > >
14 > > However, setleds dies with the following error:
15 > > Jun 19 14:24:55 ccs.covici.com setleds[4878]: KDGKBLED: Inappropriate
16 > > ioctl for device
17 > > Jun 19 14:24:55 ccs.covici.com setleds[4878]: Error reading current
18 > > flags setting. Maybe you are not on the console?
19 > >
20 > > I tried to fool with chvt to make the console current, but no joy there.
21 > >
22 > > Any assistance would be appreciated.
23 >
24 > Could you post the exact invocation for setleds? It should be on the
25 > logs. I think the invocation for setleds shuld be:
26 >
27 > /usr/bin/setleds -D +num < /dev/%i
28 >
29 > The difference between %I (capital "i") and %i is only that %i escapes
30 > special symbols, but since it's only the string tty[1-N], I don't
31 > think it matters much.
32 >
33 > The exact invocation of setleds matters, so we can see if the template
34 > unit is generating the correct one.
35
36 Thanks for your response, First of all I want -num and not +num, but
37 that does not make any difference. I am using your unit from
38 /usr/lib/systemd/system/getty@.service and add the following in the
39 .conf file
40 [Service]
41 ExecStartPost=/usr/bin/setleds -D -num </dev/%I
42 The invocation is not in the logs, all I get is the following:
43 Jun 19 14:26:26 ccs.covici.com systemd[1]: Started Getty on tty8.
44 Jun 19 14:26:26 ccs.covici.com setleds[5100]: KDGKBLED: Inappropriate
45 ioctl for device
46 Jun 19 14:26:26 ccs.covici.com setleds[5100]: Error reading current
47 flags setting. Maybe you are not on the console?
48 Jun 19 14:26:26 ccs.covici.com systemd[1]: getty@××××.service: control
49 process exited, code=exited status=1
50 Jun 19 14:26:26 ccs.covici.com systemd[1]: Unit getty@××××.service
51 entered failed state.
52
53 But I know that %I is tty8 or whatever the device is. I checked with a
54 shell script to make sure.
55
56
57
58 --
59 Your life is like a penny. You're going to lose it. The question is:
60 How do
61 you spend it?
62
63 John Covici
64 covici@××××××××××.com

Replies

Subject Author
Re: [gentoo-user] trying to turn numlock automatically in my ttys under systemd "Jc García" <jyo.garcia@×××××.com>