[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#796603: keyboard-configuration: Has init script in runlevel S but no matching service file



On 10 October 2015 at 09:54, Felipe Sateler <fsateler@debian.org> wrote:
> Control: tags -1 patch
>
> Missed the bug cc, sorry for the duplicate.
>
> On 1 September 2015 at 17:54, Michael Biebl <biebl@debian.org> wrote:
>> Am 01.09.2015 um 19:38 schrieb Felipe Sateler:
>>> On 1 September 2015 at 14:05, Anton Zinoviev <anton@lml.bas.bg> wrote:
>>>> On Thu, Aug 27, 2015 at 03:18:17PM -0300, Felipe Sateler wrote:
>>>>>
>>>>> Does console-setup actually need to be run before user services are
>>>>> started? My guess is that it only needs to run before getty, but it
>>>>> should not block other services that want to start.
>>>>
>>>> It should run before fsck.
>>>
>>> That is definitely not what the init script says[1]:
>>>
>>> # Provides:          console-setup
>>> # Required-Start:    $remote_fs
>>
>> Right, the $remote_fs dependency means it's actually started pretty late.
>> I guess what Anton meant was keyboard-setup.
>
> OK, so I added 2 service files, and preserved the early startup. However:
>
> 1. keyboard-setup is setup very early at boot, before
> local-fs-pre.target so that it occurs before fsck (at least the ones
> that don't happen in the initrd).
> 2. The ordering on console-setup is relaxed so that it starts early,
> but after /usr and /usr/local are mounted and the root fs is remounted
> (so that it can be saved in /etc). At the same time, this will not
> delay any further services except the gettys by being
> Before=system-getty.slice (BTW, maybe we need a getty-pre.target?).

I have attached a new version. Changes:

1. Add ConditionPathExists (because the service is shipped in another package).
2. Add RemainAfterExit=yes. I was getting the service started multiple
times during boot.


-- 

Saludos,
Felipe Sateler
From 7bf25445c6c72e532235448e9342572a138cbccf Mon Sep 17 00:00:00 2001
From: Felipe Sateler <fsateler@debian.org>
Date: Sat, 10 Oct 2015 08:40:50 -0300
Subject: [PATCH] Add systemd units

---
 debian/changelog                                     |  7 +++++++
 debian/keyboard-configuration.console-setup.service  | 16 ++++++++++++++++
 debian/keyboard-configuration.keyboard-setup.service | 16 ++++++++++++++++
 debian/rules                                         |  8 ++++++++
 4 files changed, 47 insertions(+)
 create mode 100644 debian/keyboard-configuration.console-setup.service
 create mode 100644 debian/keyboard-configuration.keyboard-setup.service

diff --git a/debian/changelog b/debian/changelog
index 8c7915f..0a63688 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+console-setup (1.134+nmu1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add systemd units
+
+ -- Felipe Sateler <fsateler@debian.org>  Thu, 08 Oct 2015 20:18:37 -0300
+
 console-setup (1.134) unstable; urgency=medium
 
   [ Colin Watson ]
diff --git a/debian/keyboard-configuration.console-setup.service b/debian/keyboard-configuration.console-setup.service
new file mode 100644
index 0000000..d75c3dd
--- /dev/null
+++ b/debian/keyboard-configuration.console-setup.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Set console font and keymap
+DefaultDependencies=no
+After=console-screen.service kbd.service local-fs.target
+Before=system-getty.slice
+RequiresMountsFor=/usr /usr/local
+ConditionPathExists=/bin/setupcon
+
+[Service]
+Type=oneshot
+EnvironmentFile=-/etc/default/locale
+ExecStart=/bin/setupcon --save
+RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/debian/keyboard-configuration.keyboard-setup.service b/debian/keyboard-configuration.keyboard-setup.service
new file mode 100644
index 0000000..946b91f
--- /dev/null
+++ b/debian/keyboard-configuration.keyboard-setup.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Set preliminary keymap
+DefaultDependencies=no
+Before=local-fs-pre.target
+Wants=local-fs-pre.target
+After=udev.service keymap.service
+ConditionPathExists=/bin/setupcon
+
+[Service]
+Type=oneshot
+EnvironmentFile=-/etc/default/locale
+ExecStart=/bin/setupcon --keyboard-only
+RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/debian/rules b/debian/rules
index d709312..1982d0d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -145,10 +145,18 @@ install-main: build
 		usr/share/console-setup/
 	dh_link -pkeyboard-configuration usr/share/X11/xkb/rules/xorg.lst \
 		usr/share/doc/keyboard-configuration/xorg.lst
+	dh_systemd_enable -pkeyboard-configuration \
+		--name keyboard-setup
+	dh_systemd_enable -pkeyboard-configuration \
+		--name console-setup
 	dh_installinit -pkeyboard-configuration \
 		--no-start --name keyboard-setup -- start 06 S .
 	dh_installinit -pkeyboard-configuration \
 		--no-start --name console-setup -- start 49 S .
+	dh_systemd_start -pkeyboard-configuration \
+		--no-start --name keyboard-setup
+	dh_systemd_start -pkeyboard-configuration \
+		--no-start --name console-setup
 
 .PHONY : install-bdf2psf
 install-bdf2psf: build
-- 
2.6.2


Reply to: