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 19:46:31
Message-Id: 29353.1403293581@ccs.covici.com
In Reply to: Re: [gentoo-user] trying to turn numlock automatically in my ttys under systemd by "Jc García"
1 Jc García <jyo.garcia@×××××.com> wrote:
2
3 > 2014-06-20 11:26 GMT-06:00 <covici@××××××××××.com>:
4 >
5 > > I tried your idea of a shell script like this
6 > > [Service]
7 > > ExecStartPost=/bin/bash -c "setleds -D -num </dev/%I"
8 > I tried your line on my system, and rebooted, and didn't see any problem.
9 >
10 > I have:
11 >
12 > /etc/systemd/system/getty\@.service.d/numlock.conf:
13 > [Service]
14 > #ExecStartPost=-/bin/sh -c '/usr/bin/setleds -D -num </dev/%I'
15 > ExecStartPost=/bin/bash -c "/usr/bin/setleds -D -num </dev/%I"
16 >
17 >
18 > After reboot I logged in using tty1, here's the output of
19 >
20 > systemctl status -l getty@××××.service:
21 > -----
22 > ● getty@××××.service - Getty on tty1
23 > Loaded: loaded
24 > (/etc/systemd/system/getty.target.wants/../../../../usr/lib/systemd/system/getty@.service;
25 > enabled)
26 > Drop-In: /etc/systemd/system/getty@.service.d
27 > └─numlock.conf
28 > Active: active (running) since vie 2014-06-20 12:04:47 CST; 19min ago
29 > Docs: man:agetty(8)
30 > man:systemd-getty-generator(8)
31 > http://0pointer.de/blog/projects/serial-console.html
32 >
33 > ----->This line:
34 > Process: 625 ExecStartPost=/bin/bash -c /usr/bin/setleds -D -num
35 > </dev/%I (code=exited, status=0/SUCCESS)
36 >
37 >
38 > Main PID: 624 (login)
39 > CGroup: /system.slice/system-getty.slice/getty@××××.service
40 > ‣ 624 /bin/login --
41 >
42 > jun 20 12:05:17 jdesk login[624]: pam_unix(login:session): session
43 > opened for user jc by LOGIN(uid=0)
44 > -----
45 >
46 > > But it did not work, it kept restarting and systemd eventually refused
47 > > to start. When I commented out the line, it started OK.
48 > >
49 >
50 > Post the actual output you get from systemd when is trying to start a
51 > getty@ service, to see what's going on in your machine.
52 OK, here is what I get when I enable the ExecStartPost line:
53
54
55 bash[28875]: KDGKBLED: Inappropriate ioctl for device
56 bash[28875]: Error reading current flags setting. Maybe you are not on
57 the console?
58 bash[28879]: KDGKBLED: Inappropriate ioctl for device
59 bash[28879]: Error reading current flags setting. Maybe you are not on
60 the console?
61 bash[28883]: KDGKBLED: Inappropriate ioctl for device
62 bash[28883]: Error reading current flags setting. Maybe you are not on
63 the console?
64 bash[28887]: KDGKBLED: Inappropriate ioctl for device
65 bash[28887]: Error reading current flags setting. Maybe you are not on
66 the console?
67
68 --
69 Your life is like a penny. You're going to lose it. The question is:
70 How do
71 you spend it?
72
73 John Covici
74 covici@××××××××××.com

Replies

Subject Author
Re: [gentoo-user] trying to turn numlock automatically in my ttys under systemd Michael Cook <mcook@××××××.net>