Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] numlock script and systemd
Date: Mon, 09 Jun 2014 04:01:20
Message-Id: CADPrc81n63d7r=jmR738ch6hmF7SpqtiqZwipcZ-ox539OB2QA@mail.gmail.com
In Reply to: [gentoo-user] numlock script and systemd by covici@ccs.covici.com
1 On Sun, Jun 8, 2014 at 9:39 PM, <covici@××××××××××.com> wrote:
2 > Hi. I would like to use my /etc/init.d/numlock script with systemd, but
3 > systemctl start just says warning numlock is already starting. I
4 > thought that if a service was not there it would use something in
5 > /etc/init.d and create one, so what am I doing wrong?
6
7 That only works for "normal" SysV scripts. OpenRC scripts are similar,
8 but different enough so that systemd on Gentoo doesn't even tries to
9 load them.
10
11 To do what you want, there are several ways: for example you can
12 create a service for each terminal and enable all of them, or you can
13 create a template service, and create instances for all your
14 terminals.
15
16 However, in systemd all the VTs are not started until you switch to
17 them (except the first one), sou you have the start the services for
18 each terminal *after* getty@××××.service, with N=1,2,...
19
20 I think the easiest option is for you to override getty@.service, by
21 creating /etc/systemd/systemd/getty@.service.d/numlock.conf, and
22 putting:
23
24 ------------------------
25 ExecStartPost=setleds -D +num < /dev/%I
26 ------------------------
27
28 in int. Then you only do "systemctl --system daemon-reload", and if
29 everything works, you should have numlock activated in each VT when
30 you switch to them.
31
32 Check man 5 systemd.unit; the proper explanation for all the options
33 is given there.
34
35 Regards.
36 --
37 Canek Peláez Valdés
38 Profesor de asignatura, Facultad de Ciencias
39 Universidad Nacional Autónoma de México

Replies

Subject Author
Re: [gentoo-user] numlock script and systemd covici@××××××××××.com