Re: [systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-12-01 Thread Ivan Shapovalov
On Friday 07 November 2014 at 16:45:02, Lennart Poettering wrote:   
 On Fri, 07.11.14 17:45, Ivan Shapovalov (intelfx...@gmail.com) wrote:
 
  On Thursday 06 November 2014 at 11:02:44, David Herrmann wrote: 
   Hi Ray
   
   On Thu, Nov 6, 2014 at 10:40 AM, David Herrmann dh.herrm...@gmail.com 
   wrote:
On Wed, Nov 5, 2014 at 4:11 PM, Ray Strode halfl...@gmail.com wrote:
So if you have no idea how to make that rule be generated only if
ENABLE_VCONSOLE is set by configure, then we probably should take my
patch below.
Your patch seems far better than the options above, but I think it
needs a dracut patch to make sure the new rules file gets in the
initrd too, or it won't work.
   
I will push the patch to systemd and let Harald know. I'm not really
familiar with dracut..
   
   Pushed.
  
  Isn't it ugly to re-runn systemd-vconsole-setup straight from an udev rule?
  I mean, udev has a tendency to kill long-running RUN processes, and I've 
  seen
  systemd-vconsole-setup.service to take 5 seconds on some systems...
  Also, these additional systemd-vconsole-setup instances aren't supervised by
  systemd...
 
 Is systemd-vconsole-setup really long-running? Why would it need that
 long?
 
 To me it appears to be quite OK to be run inside a udev rule.

Well, maybe it is OK to be run from an udev rule, but it is still an
inconsistency between running that binary on boot (via a unit) and
running the same binary when a framebuffer console is added (directly)...

-- 
Ivan Shapovalov / intelfx /

signature.asc
Description: This is a digitally signed message part.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-12-01 Thread Lennart Poettering
On Mon, 01.12.14 17:25, Ivan Shapovalov (intelfx...@gmail.com) wrote:

  To me it appears to be quite OK to be run inside a udev rule.
 
 Well, maybe it is OK to be run from an udev rule, but it is still an
 inconsistency between running that binary on boot (via a unit) and
 running the same binary when a framebuffer console is added (directly)...

Yeah, we do that a couple of times however. For example the alsa
volume restor tools are both run from an udev rule and as unit. The
latter is important since /var (where they store their data) is not
available when udev starts probing things...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-11-07 Thread Ivan Shapovalov
On Thursday 06 November 2014 at 11:02:44, David Herrmann wrote: 
 Hi Ray
 
 On Thu, Nov 6, 2014 at 10:40 AM, David Herrmann dh.herrm...@gmail.com wrote:
  On Wed, Nov 5, 2014 at 4:11 PM, Ray Strode halfl...@gmail.com wrote:
  So if you have no idea how to make that rule be generated only if
  ENABLE_VCONSOLE is set by configure, then we probably should take my
  patch below.
  Your patch seems far better than the options above, but I think it
  needs a dracut patch to make sure the new rules file gets in the
  initrd too, or it won't work.
 
  I will push the patch to systemd and let Harald know. I'm not really
  familiar with dracut..
 
 Pushed.

Isn't it ugly to re-runn systemd-vconsole-setup straight from an udev rule?
I mean, udev has a tendency to kill long-running RUN processes, and I've seen
systemd-vconsole-setup.service to take 5 seconds on some systems...
Also, these additional systemd-vconsole-setup instances aren't supervised by
systemd...

-- 
Ivan Shapovalov / intelfx /

signature.asc
Description: This is a digitally signed message part.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-11-07 Thread Lennart Poettering
On Fri, 07.11.14 17:45, Ivan Shapovalov (intelfx...@gmail.com) wrote:

 On Thursday 06 November 2014 at 11:02:44, David Herrmann wrote:   
  Hi Ray
  
  On Thu, Nov 6, 2014 at 10:40 AM, David Herrmann dh.herrm...@gmail.com 
  wrote:
   On Wed, Nov 5, 2014 at 4:11 PM, Ray Strode halfl...@gmail.com wrote:
   So if you have no idea how to make that rule be generated only if
   ENABLE_VCONSOLE is set by configure, then we probably should take my
   patch below.
   Your patch seems far better than the options above, but I think it
   needs a dracut patch to make sure the new rules file gets in the
   initrd too, or it won't work.
  
   I will push the patch to systemd and let Harald know. I'm not really
   familiar with dracut..
  
  Pushed.
 
 Isn't it ugly to re-runn systemd-vconsole-setup straight from an udev rule?
 I mean, udev has a tendency to kill long-running RUN processes, and I've seen
 systemd-vconsole-setup.service to take 5 seconds on some systems...
 Also, these additional systemd-vconsole-setup instances aren't supervised by
 systemd...

Is systemd-vconsole-setup really long-running? Why would it need that
long?

To me it appears to be quite OK to be run inside a udev rule.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-11-06 Thread David Herrmann
Hi

On Wed, Nov 5, 2014 at 4:11 PM, Ray Strode halfl...@gmail.com wrote:
 Hi,

 On Wed, Nov 5, 2014 at 9:53 AM, David Herrmann dh.herrm...@gmail.com wrote:
 I had that change locally, but didn't push it because vconsole is
 optional. Thus, this rule must be optional, too. I'm now digging into
 autoconf+m4 to see how to do this... but I'm getting nowhere so far...

 Well you could:

 1) rename 99-systemd.rules.in to 99-systemd.rules.in.in and then add
 it to AC_CONFIG_FILES in configure.ac and add substitution variable to
 99-systemd.rules.in.in that expands to the empty string when
 ENABLE_VCONSOLE isn't set and the udev rule when it is set.  I don't
 like that though, it would mean separating the udev rule from the
 file.

 2) Alternatively, you could leave 99-systemd.rules.in as is and hack
 SED_PROCESS stuff in the makefile to remove the line if
 ENABLE_VCONSOLE isn't set. I don't like this either, it's ugly.

E, this does indeed all sound ugly.

 So if you have no idea how to make that rule be generated only if
 ENABLE_VCONSOLE is set by configure, then we probably should take my
 patch below.
 Your patch seems far better than the options above, but I think it
 needs a dracut patch to make sure the new rules file gets in the
 initrd too, or it won't work.

I will push the patch to systemd and let Harald know. I'm not really
familiar with dracut..

Thanks
David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-11-06 Thread David Herrmann
Hi Ray

On Thu, Nov 6, 2014 at 10:40 AM, David Herrmann dh.herrm...@gmail.com wrote:
 On Wed, Nov 5, 2014 at 4:11 PM, Ray Strode halfl...@gmail.com wrote:
 So if you have no idea how to make that rule be generated only if
 ENABLE_VCONSOLE is set by configure, then we probably should take my
 patch below.
 Your patch seems far better than the options above, but I think it
 needs a dracut patch to make sure the new rules file gets in the
 initrd too, or it won't work.

 I will push the patch to systemd and let Harald know. I'm not really
 familiar with dracut..

Pushed.

systemd: 
http://cgit.freedesktop.org/systemd/systemd/commit/?id=f6ba8671d83f9fce9a00045d8fa399a1c07ba7fc
dracut: 
http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=027565d0233f76edf434b63a847a717185d267e2

Thanks
David
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-11-05 Thread Ray Strode
From: Ray Strode rstr...@redhat.com

The initialization performed by systemd-vconsole-setup is reset
when changing console drivers (say from vgacon to fbcon), so we
need to run it in that case.

See
http://lists.freedesktop.org/archives/systemd-devel/2014-October/023919.html
http://lists.freedesktop.org/archives/systemd-devel/2014-October/024423.html
http://lists.freedesktop.org/archives/systemd-devel/2014-November/024881.html

This commit adds a udev rule to 99-systemd.rules to make
systemd-vconsole-setup get run when the fbcon device becomes available.
---
 rules/99-systemd.rules.in | 4 
 1 file changed, 4 insertions(+)

diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
index e30d9a8..4763b65 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -1,39 +1,43 @@
 #  This file is part of systemd.
 #
 #  systemd is free software; you can redistribute it and/or modify it
 #  under the terms of the GNU Lesser General Public License as published by
 #  the Free Software Foundation; either version 2.1 of the License, or
 #  (at your option) any later version.
 
 ACTION==remove, GOTO=systemd_end
 
+# Kernel resets vconsole state when changing console drivers so run
+# systemd-vconsole-setup when fbcon loads
+SUBSYSTEM==graphics, KERNEL==fbcon, 
RUN+=/usr/lib/systemd/systemd-vconsole-setup
+
 SUBSYSTEM==tty, 
KERNEL==tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*, 
TAG+=systemd
 
 KERNEL==vport*, TAG+=systemd
 
 SUBSYSTEM==block, KERNEL!=ram*, TAG+=systemd
 SUBSYSTEM==block, KERNEL!=ram*, 
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}==1, ENV{SYSTEMD_READY}=0
 
 # Ignore encrypted devices with no identified superblock on it, since
 # we are probably still calling mke2fs or mkswap on it.
 SUBSYSTEM==block, KERNEL!=ram*, ENV{DM_UUID}==CRYPT-*, 
ENV{ID_PART_TABLE_TYPE}==, ENV{ID_FS_USAGE}==, ENV{SYSTEMD_READY}=0
 
 # Ignore raid devices that are not yet assembled and started
 SUBSYSTEM==block, ENV{DEVTYPE}==disk, KERNEL==md*, 
TEST!=md/array_state, ENV{SYSTEMD_READY}=0
 SUBSYSTEM==block, ENV{DEVTYPE}==disk, KERNEL==md*, 
ATTR{md/array_state}==|clear|inactive, ENV{SYSTEMD_READY}=0
 
 # Ignore loop devices that don't have any file attached
 SUBSYSTEM==block, KERNEL==loop[0-9]*, ENV{DEVTYPE}==disk, 
TEST!=loop/backing_file, ENV{SYSTEMD_READY}=0
 
 # Ignore nbd devices in the add event, with change the nbd is ready
 ACTION==add, SUBSYSTEM==block, KERNEL==nbd*, ENV{SYSTEMD_READY}=0
 
 # We need a hardware independent way to identify network devices. We
 # use the /sys/subsystem path for this. Current vanilla kernels don't
 # actually support that hierarchy right now, however upcoming kernels
 # will. HAL and udev internally support /sys/subsystem already, hence
 # it should be safe to use this here, too. This is mostly just an
 # identification string for systemd, so whether the path actually is
 # accessible or not does not matter as long as it is unique and in the
 # filesystem namespace.
 #
-- 
2.1.0

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-11-05 Thread David Herrmann
Hi Ray

On Wed, Nov 5, 2014 at 3:48 PM, Ray Strode halfl...@gmail.com wrote:
 From: Ray Strode rstr...@redhat.com

 The initialization performed by systemd-vconsole-setup is reset
 when changing console drivers (say from vgacon to fbcon), so we
 need to run it in that case.

 See
 http://lists.freedesktop.org/archives/systemd-devel/2014-October/023919.html
 http://lists.freedesktop.org/archives/systemd-devel/2014-October/024423.html
 http://lists.freedesktop.org/archives/systemd-devel/2014-November/024881.html

 This commit adds a udev rule to 99-systemd.rules to make
 systemd-vconsole-setup get run when the fbcon device becomes available.
 ---
  rules/99-systemd.rules.in | 4 
  1 file changed, 4 insertions(+)

 diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
 index e30d9a8..4763b65 100644
 --- a/rules/99-systemd.rules.in
 +++ b/rules/99-systemd.rules.in
 @@ -1,39 +1,43 @@
  #  This file is part of systemd.
  #
  #  systemd is free software; you can redistribute it and/or modify it
  #  under the terms of the GNU Lesser General Public License as published by
  #  the Free Software Foundation; either version 2.1 of the License, or
  #  (at your option) any later version.

  ACTION==remove, GOTO=systemd_end

 +# Kernel resets vconsole state when changing console drivers so run
 +# systemd-vconsole-setup when fbcon loads
 +SUBSYSTEM==graphics, KERNEL==fbcon, 
 RUN+=/usr/lib/systemd/systemd-vconsole-setup
 +

I had that change locally, but didn't push it because vconsole is
optional. Thus, this rule must be optional, too. I'm now digging into
autoconf+m4 to see how to do this... but I'm getting nowhere so far...

So if you have no idea how to make that rule be generated only if
ENABLE_VCONSOLE is set by configure, then we probably should take my
patch below.

Thanks
David


diff --git a/Makefile.am b/Makefile.am
index 3686103..f614b86 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4439,6 +4439,9 @@ rootlibexec_PROGRAMS += \
 nodist_systemunit_DATA += \
units/systemd-vconsole-setup.service

+dist_udevrules_DATA += \
+   src/vconsole/90-vconsole.rules
+
 SYSINIT_TARGET_WANTS += \
systemd-vconsole-setup.service
 endif
diff --git a/src/vconsole/90-vconsole.rules b/src/vconsole/90-vconsole.rules
new file mode 100644
index 000..8334979
--- /dev/null
+++ b/src/vconsole/90-vconsole.rules
@@ -0,0 +1,10 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+# re-run vconsole if the VT driver changed
+
+ACTION==add, SUBSYSTEM==graphics, KERNEL==fbcon,
RUN+=/usr/lib/systemd/systemd-vconsole-setup
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] rules: rerun vconsole-setup when switching from vgacon to fbcon

2014-11-05 Thread Ray Strode
Hi,

On Wed, Nov 5, 2014 at 9:53 AM, David Herrmann dh.herrm...@gmail.com wrote:
 I had that change locally, but didn't push it because vconsole is
 optional. Thus, this rule must be optional, too. I'm now digging into
 autoconf+m4 to see how to do this... but I'm getting nowhere so far...

Well you could:

1) rename 99-systemd.rules.in to 99-systemd.rules.in.in and then add
it to AC_CONFIG_FILES in configure.ac and add substitution variable to
99-systemd.rules.in.in that expands to the empty string when
ENABLE_VCONSOLE isn't set and the udev rule when it is set.  I don't
like that though, it would mean separating the udev rule from the
file.

2) Alternatively, you could leave 99-systemd.rules.in as is and hack
SED_PROCESS stuff in the makefile to remove the line if
ENABLE_VCONSOLE isn't set. I don't like this either, it's ugly.

 So if you have no idea how to make that rule be generated only if
 ENABLE_VCONSOLE is set by configure, then we probably should take my
 patch below.
Your patch seems far better than the options above, but I think it
needs a dracut patch to make sure the new rules file gets in the
initrd too, or it won't work.

--Ray
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel