From: "Jc García" <jyo.garcia@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] trying to turn numlock automatically in my ttys under systemd
Date: Fri, 20 Jun 2014 14:04:31 -0600 [thread overview]
Message-ID: <CAGQH77d3ep8Jpt=cYHswji-bWCrGvPqnEq-M7vEDH7kv9XAdfQ@mail.gmail.com> (raw)
In-Reply-To: <53A490EC.4070507@mackal.net>
2014-06-20 13:52 GMT-06:00 Michael Cook <mcook@mackal.net>:
> On 06/20/2014 03:46 PM, covici@ccs.covici.com wrote:
>>
>> Jc García <jyo.garcia@gmail.com> wrote:
>>
>>> 2014-06-20 11:26 GMT-06:00 <covici@ccs.covici.com>:
>>>
>>>> I tried your idea of a shell script like this
>>>> [Service]
>>>> ExecStartPost=/bin/bash -c "setleds -D -num </dev/%I"
>>>
>>> I tried your line on my system, and rebooted, and didn't see any problem.
>>>
>>> I have:
>>>
>>> /etc/systemd/system/getty\@.service.d/numlock.conf:
>>> [Service]
>>> #ExecStartPost=-/bin/sh -c '/usr/bin/setleds -D -num </dev/%I'
>>> ExecStartPost=/bin/bash -c "/usr/bin/setleds -D -num </dev/%I"
>>>
>>>
>>> After reboot I logged in using tty1, here's the output of
>>>
>>> systemctl status -l getty@tty1.service:
>>> -----
>>> ● getty@tty1.service - Getty on tty1
>>> Loaded: loaded
>>>
>>> (/etc/systemd/system/getty.target.wants/../../../../usr/lib/systemd/system/getty@.service;
>>> enabled)
>>> Drop-In: /etc/systemd/system/getty@.service.d
>>> └─numlock.conf
>>> Active: active (running) since vie 2014-06-20 12:04:47 CST; 19min ago
>>> Docs: man:agetty(8)
>>> man:systemd-getty-generator(8)
>>> http://0pointer.de/blog/projects/serial-console.html
>>>
>>> ----->This line:
>>> Process: 625 ExecStartPost=/bin/bash -c /usr/bin/setleds -D -num
>>> </dev/%I (code=exited, status=0/SUCCESS)
>>>
>>>
>>> Main PID: 624 (login)
>>> CGroup: /system.slice/system-getty.slice/getty@tty1.service
>>> ‣ 624 /bin/login --
>>>
>>> jun 20 12:05:17 jdesk login[624]: pam_unix(login:session): session
>>> opened for user jc by LOGIN(uid=0)
>>> -----
>>>
>>>> But it did not work, it kept restarting and systemd eventually refused
>>>> to start. When I commented out the line, it started OK.
>>>>
>>>
>>> Post the actual output you get from systemd when is trying to start a
>>> getty@ service, to see what's going on in your machine.
>>
>> OK, here is what I get when I enable the ExecStartPost line:
>>
>>
>> bash[28875]: KDGKBLED: Inappropriate ioctl for device
>> bash[28875]: Error reading current flags setting. Maybe you are not on
>> the console?
>> bash[28879]: KDGKBLED: Inappropriate ioctl for device
>> bash[28879]: Error reading current flags setting. Maybe you are not on
>> the console?
>> bash[28883]: KDGKBLED: Inappropriate ioctl for device
>> bash[28883]: Error reading current flags setting. Maybe you are not on
>> the console?
>> bash[28887]: KDGKBLED: Inappropriate ioctl for device
>> bash[28887]: Error reading current flags setting. Maybe you are not on
>> the console?
After I tried to switch back to setleds +num, in numlock.conf ,
without rebooting, I got into errors too.
>>
> % cat /etc/systemd/system/getty@.service.d/activate-numlock.conf
> [Service]
> ExecStartPre=/bin/sh -c 'setleds +num < /dev/%I'
But this ^ solved it, thanks for posting it Michael.
>
>
> That works here to turn numlock on (source ArchLinux wiki)
>
prev parent reply other threads:[~2014-06-20 20:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 9:06 [gentoo-user] trying to turn numlock automatically in my ttys under systemd covici
2014-06-20 15:06 ` Canek Peláez Valdés
2014-06-20 16:40 ` Jc García
2014-06-20 17:08 ` Canek Peláez Valdés
2014-06-20 16:53 ` covici
2014-06-20 17:01 ` Jc García
2014-06-20 17:26 ` covici
2014-06-20 18:43 ` Jc García
2014-06-20 19:46 ` covici
2014-06-20 19:52 ` Michael Cook
2014-06-20 20:04 ` Jc García [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGQH77d3ep8Jpt=cYHswji-bWCrGvPqnEq-M7vEDH7kv9XAdfQ@mail.gmail.com' \
--to=jyo.garcia@gmail.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox