1 |
Canek Peláez Valdés <caneko@×××××.com> wrote: |
2 |
|
3 |
> On Sun, Jun 8, 2014 at 9:39 PM, <covici@××××××××××.com> wrote: |
4 |
> > Hi. I would like to use my /etc/init.d/numlock script with systemd, but |
5 |
> > systemctl start just says warning numlock is already starting. I |
6 |
> > thought that if a service was not there it would use something in |
7 |
> > /etc/init.d and create one, so what am I doing wrong? |
8 |
> |
9 |
> That only works for "normal" SysV scripts. OpenRC scripts are similar, |
10 |
> but different enough so that systemd on Gentoo doesn't even tries to |
11 |
> load them. |
12 |
> |
13 |
> To do what you want, there are several ways: for example you can |
14 |
> create a service for each terminal and enable all of them, or you can |
15 |
> create a template service, and create instances for all your |
16 |
> terminals. |
17 |
> |
18 |
> However, in systemd all the VTs are not started until you switch to |
19 |
> them (except the first one), sou you have the start the services for |
20 |
> each terminal *after* getty@××××.service, with N=1,2,... |
21 |
> |
22 |
> I think the easiest option is for you to override getty@.service, by |
23 |
> creating /etc/systemd/systemd/getty@.service.d/numlock.conf, and |
24 |
> putting: |
25 |
> |
26 |
> ------------------------ |
27 |
> ExecStartPost=setleds -D +num < /dev/%I |
28 |
> ------------------------ |
29 |
> |
30 |
> in int. Then you only do "systemctl --system daemon-reload", and if |
31 |
> everything works, you should have numlock activated in each VT when |
32 |
> you switch to them. |
33 |
> |
34 |
> Check man 5 systemd.unit; the proper explanation for all the options |
35 |
> is given there. |
36 |
|
37 |
Thanks, I have put it in, we shall see what happens on the next reboot. |
38 |
|
39 |
|
40 |
-- |
41 |
Your life is like a penny. You're going to lose it. The question is: |
42 |
How do |
43 |
you spend it? |
44 |
|
45 |
John Covici |
46 |
covici@××××××××××.com |