2014-06-20 11:26 GMT-06:00  <[email protected]>:

> 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 [email protected]:
-----
● [email protected] - Getty on tty1
   Loaded: loaded
(/etc/systemd/system/getty.target.wants/../../../../usr/lib/systemd/system/[email protected];
enabled)
  Drop-In: /etc/systemd/system/[email protected]
           └─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/[email protected]
           ‣ 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.

>
> --
> Your life is like a penny.  You're going to lose it.  The question is:
> How do
> you spend it?
>
>          John Covici
>          [email protected]
>

Reply via email to