Gentoo Archives: gentoo-user

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

Replies