On Sun, Jun 8, 2014 at 9:39 PM,  <[email protected]> wrote:
> Hi.  I would like to use my /etc/init.d/numlock script with systemd, but
> systemctl start just says warning numlock is already starting.  I
> thought that if a service  was not there it would use something in
> /etc/init.d and create one, so what am I doing wrong?

That only works for "normal" SysV scripts. OpenRC scripts are similar,
but different enough so that systemd on Gentoo doesn't even tries to
load them.

To do what you want, there are several ways: for example you can
create a service for each terminal and enable all of them, or you can
create a template service, and create instances for all your
terminals.

However, in systemd all the VTs are not started until you switch to
them (except the first one), sou you have the start the services for
each terminal *after* [email protected], with N=1,2,...

I think the easiest option is for you to override [email protected], by
creating /etc/systemd/systemd/[email protected]/numlock.conf, and
putting:

------------------------
ExecStartPost=setleds -D +num < /dev/%I
------------------------

in int. Then you only do "systemctl --system daemon-reload", and if
everything works, you should have numlock activated in each VT when
you switch to them.

Check man 5 systemd.unit; the proper explanation for all the options
is given there.

Regards.
-- 
Canek Peláez Valdés
Profesor de asignatura, Facultad de Ciencias
Universidad Nacional Autónoma de México

Reply via email to