On Fri, Jun 20, 2014 at 11:40 AM, Jc García <jyo.gar...@gmail.com> wrote: > 2014-06-20 9:06 GMT-06:00 Canek Peláez Valdés <can...@gmail.com>: >> On Fri, Jun 20, 2014 at 4:06 AM, <cov...@ccs.covici.com> wrote: >>> Hi. I want to turn numlock automatically, but I am using systemd and I >>> am having troubles doing this. At someones suggestion in a previous >>> message (I think Canek's) I created >>> /etc/systemd/system/getty@service.d/numlock.conf with the following >>> contents >>> >>> [Service] >>> ExecStartPost=/usr/bin/setleds -D -num </dev/%I >>> >>> >>> However, setleds dies with the following error: >>> Jun 19 14:24:55 ccs.covici.com setleds[4878]: KDGKBLED: Inappropriate >>> ioctl for device >>> Jun 19 14:24:55 ccs.covici.com setleds[4878]: Error reading current >>> flags setting. Maybe you are not on the console? >>> >>> I tried to fool with chvt to make the console current, but no joy there. >>> >>> Any assistance would be appreciated. >> > > This has called my attention as it would be nice to activate numlock > by default on console(altought not that important for me anyway ) > >> Could you post the exact invocation for setleds? It should be on the >> logs. I think the invocation for setleds shuld be: >> >> /usr/bin/setleds -D +num < /dev/%i >> > I have tried this but after skimming trough the manpage > systemd.service(5), I've found this command will not work, as a > parameter for any of ExecStart* since redirection and pipes(these are > mentioned << < | > >> ) are not supported. > I'd like to mention also that not executing setleds as follows, with > '-' before the binary path : > > ExecStartPost=-/usr/bin/setleds -D -num </dev/%i > > breaks the start of the whole getty service, making it unable to login > in into any console > The way to work around this recommended in the manual is instead > invoking a shell and make it run the commands: > > ExecStartPost=-/bin/sh -c 'setleds -D +num < /dev/%i'
You are completely right; I had forgotten about redirection in Exec* directives. Regards. -- Canek Peláez Valdés Profesor de asignatura, Facultad de Ciencias Universidad Nacional Autónoma de México