[systemd-devel] About systemd in initrd support

2014-08-23 Thread Luca Bruno
I'm going to do an experiment with NixOS: replace the whole current initrd
process made of scripts and hooks with systemd.

Before doing any work however I'd like to hear whether systemd in initrd is
still wanted in the future, or there's any possible idea about dropping
this support.

Also, apart arch linux, is there any other OS that you know using systemd
for the whole initrd process?

Thanks for you work.

Best regards,

-- 
www.debian.org - The Universal Operating System
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [RFC] [PATCH 3/3] resume-generator: add a generator for instantiating the resume unit.

2014-08-23 Thread Ivan Shapovalov
resume-generator understands resume= kernel command line parameter and
instantiates the systemd-resume@.service accordingly if it is passed.

This enables resume from hibernation using device specified on the kernel
command line, where the device path may point to an arbitrary udev-created
symlink, not only /dev/sdXY which is understood by the in-kernel
implementation.
---
 man/kernel-command-line.xml | 13 -
 man/systemd-resume-generator.xml| 91 +
 src/resume-generator/Makefile   |  1 +
 src/resume-generator/resume-generator.c | 89 
 4 files changed, 193 insertions(+), 1 deletion(-)
 create mode 100644 man/systemd-resume-generator.xml
 create mode 12 src/resume-generator/Makefile
 create mode 100644 src/resume-generator/resume-generator.c

diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml
index f244bfc..4bc6cee 100644
--- a/man/kernel-command-line.xml
+++ b/man/kernel-command-line.xml
@@ -351,6 +351,16 @@
 /listitem
 /varlistentry
 
+varlistentry
+termvarnameresume=/varname/term
+
+listitem
+paraEnables resume from hibernation
+using the specified device. For
+details, see
+
citerefentryrefentrytitlesystemd-resume-generator/refentrytitlemanvolnum8/manvolnum/citerefentry./para
+/listitem
+/varlistentry
 /variablelist
 
 /refsect1
@@ -373,7 +383,8 @@
   
citerefentryrefentrytitlesystemd-gpt-auto-generator/refentrytitlemanvolnum8/manvolnum/citerefentry,
   
citerefentryrefentrytitlesystemd-modules-load.service/refentrytitlemanvolnum8/manvolnum/citerefentry,
   
citerefentryrefentrytitlesystemd-backlight@.service/refentrytitlemanvolnum8/manvolnum/citerefentry,
-  
citerefentryrefentrytitlesystemd-rfkill@.service/refentrytitlemanvolnum8/manvolnum/citerefentry
+  
citerefentryrefentrytitlesystemd-rfkill@.service/refentrytitlemanvolnum8/manvolnum/citerefentry,
+  
citerefentryrefentrytitlesystemd-resume-generator/refentrytitlemanvolnum8/manvolnum/citerefentry
   /para
 /refsect1
 
diff --git a/man/systemd-resume-generator.xml b/man/systemd-resume-generator.xml
new file mode 100644
index 000..7962534
--- /dev/null
+++ b/man/systemd-resume-generator.xml
@@ -0,0 +1,91 @@
+?xml version=1.0?
+!--*-nxml-*--
+!DOCTYPE refentry PUBLIC -//OASIS//DTD DocBook XML V4.2//EN 
http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd;
+!--
+  This file is part of systemd.
+
+  Copyright 2014 Ivan Shapovalov
+
+  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.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see http://www.gnu.org/licenses/.
+--
+refentry id=systemd-resume-generator
+
+refentryinfo
+titlesystemd-resume-generator/title
+productnamesystemd/productname
+
+authorgroup
+author
+contribDeveloper/contrib
+firstnameIvan/firstname
+surnameShapovalov/surname
+emailintelfx...@gmail.com/email
+/author
+/authorgroup
+/refentryinfo
+
+refmeta
+refentrytitlesystemd-resume-generator/refentrytitle
+manvolnum8/manvolnum
+/refmeta
+
+refnamediv
+refnamesystemd-resume-generator/refname
+refpurposeUnit generator for resume= kernel 
parameter/refpurpose
+/refnamediv
+
+refsynopsisdiv
+
parafilename/usr/lib/systemd/system-generators/systemd-resume-generator/filename/para
+/refsynopsisdiv
+
+refsect1
+titleDescription/title
+
+parafilenamesystemd-resume-generator/filename is
+a generator that instantiates
+
citerefentryrefentrytitlesystemd-resume@.service/refentrytitlemanvolnum8/manvolnum/citerefentry
+unit 

[systemd-devel] [RFC] [PATCH 2/3] resume: add a tool to write a device node's major:minor to /sys/power/resume.

2014-08-23 Thread Ivan Shapovalov
This can be used to initiate a resume from hibernation by path to a swap
device containing the hibernation image.

The respective templated unit is also added. It is instantiated using
path to the desired resume device.
---
 Makefile-man.am  |  9 +
 Makefile.am  | 28 --
 man/systemd-res...@.service.xml  | 81 +++
 src/resume/Makefile  |  1 +
 src/resume/resume.c  | 82 
 units/systemd-res...@.service.in | 23 +++
 6 files changed, 220 insertions(+), 4 deletions(-)
 create mode 100644 man/systemd-res...@.service.xml
 create mode 12 src/resume/Makefile
 create mode 100644 src/resume/resume.c
 create mode 100644 units/systemd-res...@.service.in

diff --git a/Makefile-man.am b/Makefile-man.am
index 5c289dd..00daae2 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -76,6 +76,8 @@ MANPAGES += \
man/systemd-nspawn.1 \
man/systemd-path.1 \
man/systemd-remount-fs.service.8 \
+   man/systemd-resume-generator.8 \
+   man/systemd-resume@.service.8 \
man/systemd-run.1 \
man/systemd-shutdownd.service.8 \
man/systemd-sleep.conf.5 \
@@ -206,6 +208,7 @@ MANPAGES_ALIAS += \
man/systemd-poweroff.service.8 \
man/systemd-reboot.service.8 \
man/systemd-remount-fs.8 \
+   man/systemd-resume.8 \
man/systemd-shutdown.8 \
man/systemd-shutdownd.8 \
man/systemd-shutdownd.socket.8 \
@@ -311,6 +314,7 @@ man/systemd-kexec.service.8: man/systemd-halt.service.8
 man/systemd-poweroff.service.8: man/systemd-halt.service.8
 man/systemd-reboot.service.8: man/systemd-halt.service.8
 man/systemd-remount-fs.8: man/systemd-remount-fs.service.8
+man/systemd-resume.8: man/systemd-resume@.service.8
 man/systemd-shutdown.8: man/systemd-halt.service.8
 man/systemd-shutdownd.8: man/systemd-shutdownd.service.8
 man/systemd-shutdownd.socket.8: man/systemd-shutdownd.service.8
@@ -592,6 +596,9 @@ man/systemd-reboot.service.html: 
man/systemd-halt.service.html
 man/systemd-remount-fs.html: man/systemd-remount-fs.service.html
$(html-alias)
 
+man/systemd-resume.html: man/systemd-res...@.service.html
+   $(html-alias)
+
 man/systemd-shutdown.html: man/systemd-halt.service.html
$(html-alias)
 
@@ -1626,6 +1633,8 @@ EXTRA_DIST += \
man/systemd-readahead-replay.service.xml \
man/systemd-remount-fs.service.xml \
man/systemd-resolved.service.xml \
+   man/systemd-resume-generator.xml \
+   man/systemd-res...@.service.xml \
man/systemd-rfk...@.service.xml \
man/systemd-run.xml \
man/systemd-shutdownd.service.xml \
diff --git a/Makefile.am b/Makefile.am
index e238cde..820d082 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -371,13 +371,15 @@ rootlibexec_PROGRAMS = \
systemd-sleep \
systemd-bus-proxyd \
systemd-socket-proxyd \
-   systemd-update-done
+   systemd-update-done \
+   systemd-resume
 
 systemgenerator_PROGRAMS = \
systemd-getty-generator \
systemd-fstab-generator \
systemd-system-update-generator \
-   systemd-debug-generator
+   systemd-debug-generator \
+   systemd-resume-generator
 
 dist_bashcompletion_DATA = \
shell-completion/bash/busctl \
@@ -509,7 +511,8 @@ nodist_systemunit_DATA = \
units/initrd-udevadm-cleanup-db.service \
units/initrd-switch-root.service \
units/systemd-nspawn@.service \
-   units/systemd-update-done.service
+   units/systemd-update-done.service \
+   units/systemd-resume@.service
 
 dist_userunit_DATA = \
units/user/basic.target \
@@ -556,7 +559,8 @@ EXTRA_DIST += \
units/initrd-udevadm-cleanup-db.service.in \
units/initrd-switch-root.service.in \
units/systemd-nsp...@.service.in \
-   units/systemd-update-done.service.in
+   units/systemd-update-done.service.in \
+   units/systemd-res...@.service.in
 
 CLEANFILES += \
units/console-shell.service.m4 \
@@ -1930,6 +1934,14 @@ systemd_delta_LDADD = \
libsystemd-shared.la
 
 # 
--
+systemd_resume_SOURCES = \
+   src/resume/resume.c
+
+systemd_resume_LDADD = \
+   libsystemd-internal.la \
+   libsystemd-shared.la
+
+# 
--
 systemd_getty_generator_SOURCES = \
src/getty-generator/getty-generator.c
 
@@ -1962,6 +1974,14 @@ systemd_system_update_generator_LDADD = \
libsystemd-label.la \
libsystemd-shared.la
 
+# 
--
+systemd_resume_generator_SOURCES = \
+   src/resume-generator/resume-generator.c
+
+systemd_resume_generator_LDADD = \
+   libsystemd-label.la \
+   libsystemd-shared.la
+
 if ENABLE_EFI
 

[systemd-devel] [RFC] [PATCH 1/3] units: order systemd-fsck@.service after local-fs-pre.target.

2014-08-23 Thread Ivan Shapovalov
With this change, it becomes possible to order a unit to activate before any
modifications to the file systems. This is especially useful for supporting
resume from hibernation.
---
 units/systemd-f...@.service.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/units/systemd-f...@.service.in b/units/systemd-f...@.service.in
index c12efa8..d2cda6a 100644
--- a/units/systemd-f...@.service.in
+++ b/units/systemd-f...@.service.in
@@ -10,7 +10,7 @@ Description=File System Check on %f
 Documentation=man:systemd-fsck@.service(8)
 DefaultDependencies=no
 BindsTo=%i.device
-After=systemd-readahead-collect.service systemd-readahead-replay.service 
%i.device systemd-fsck-root.service
+After=systemd-readahead-collect.service systemd-readahead-replay.service 
%i.device systemd-fsck-root.service local-fs-pre.target
 Before=shutdown.target
 
 [Service]
-- 
2.1.0

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


[systemd-devel] [RFC] [PATCH 0/3] resume: implement support for resuming from hibernation

2014-08-23 Thread Ivan Shapovalov
This patchset allows systemd to parse resume= kernel command line parameter
and initiate resume from the specified device.

It adds:
- a 'systemd-resume' tool which takes path to a device node and
  writes its major:minor to /sys/power/state;
- a corresponding 'systemd-resume@.service' templated unit;
- a 'systemd-resume-generator' generator which parses the kernel command line
  and instantiates the unit as necessary.

This functionality already exists in-kernel, but only for /dev/sdXY-style
pathes. Implementing it in userspace allows to use arbitrary udev-created
symlinks, e. g. persistent block device pathes (/dev/disk/by-foo/bar).

Userspace parsing of resume= kernel command line parameter has been
traditionally done in initramfs via shell scripts (for Arch Linux, this is
resume mkinitcpio hook), so I feel that this feature has its place within
systemd.

Due to the nature of hibernation, the resume unit must be activated before
any modifications to filesystems take place. This can happen
1) in initramfs before mounting anything, and
2) without initramfs before remounting rootfs read-write (provided that it is
   mounted RO initially).

So, first patch orders all non-root fsck after local-fs-pre.target, which in
turn allows to order the resume unit before those fsck instances.

Second and third patches add the tool, the unit and the generator.

There are some issues with this implementation:

- legacy usr.mount is not automatically ordered after local-fs-pre.target,
  so systemd-resume@.service has to be manually ordered before it;
- systemd-udevd.service, which is needed for creating persistent block device
  symlinks, is transitively ordered after systemd-remount-fs.service via at
  least systemd-udev-hwdb-update.service and systemd-sysusers.service.
  Hence, if these units are present (at least initramfs-less case), an ordering
  cycle happens and resume is impossible.

So, I would like someone to comment on these.

This is my first patch to this project, so feel free to flak me for missing
something obvious :)

Thanks for reviewing!

Ivan Shapovalov (3):
  units: order systemd-fsck@.service after local-fs-pre.target.
  resume: add a tool to write a device node's major:minor to /sys/power/resume.
  resume-generator: add a generator for instantiating the resume unit.

 Makefile-man.am |  9 
 Makefile.am | 28 --
 man/kernel-command-line.xml | 13 -
 man/systemd-resume-generator.xml| 91 +
 man/systemd-res...@.service.xml | 81 +
 src/resume-generator/Makefile   |  1 +
 src/resume-generator/resume-generator.c | 89 
 src/resume/Makefile |  1 +
 src/resume/resume.c | 82 +
 units/systemd-f...@.service.in  |  2 +-
 units/systemd-res...@.service.in| 23 +
 11 files changed, 414 insertions(+), 6 deletions(-)
 create mode 100644 man/systemd-resume-generator.xml
 create mode 100644 man/systemd-res...@.service.xml
 create mode 12 src/resume-generator/Makefile
 create mode 100644 src/resume-generator/resume-generator.c
 create mode 12 src/resume/Makefile
 create mode 100644 src/resume/resume.c
 create mode 100644 units/systemd-res...@.service.in

-- 
2.1.0

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


Re: [systemd-devel] About systemd in initrd support

2014-08-23 Thread Simon Peeters
Hej,

2014-08-23 13:46 GMT+02:00 Luca Bruno lethalma...@gmail.com:
 I'm going to do an experiment with NixOS: replace the whole current initrd
 process made of scripts and hooks with systemd.

 Before doing any work however I'd like to hear whether systemd in initrd is
 still wanted in the future, or there's any possible idea about dropping this
 support.

I think this is definitly still wanted.

 Also, apart arch linux, is there any other OS that you know using systemd
 for the whole initrd process?

Every distribution that uses dracut as an initramfs, including mageia,
fedora and RHEL.

 Thanks for you work.

 Best regards,




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


Re: [systemd-devel] [RFC] [PATCH 2/3] resume: add a tool to write a device node's major:minor to /sys/power/resume.

2014-08-23 Thread Andrei Borzenkov
В Sat, 23 Aug 2014 16:47:53 +0400
Ivan Shapovalov intelfx...@gmail.com пишет:

 diff --git a/units/systemd-res...@.service.in 
 b/units/systemd-res...@.service.in
 new file mode 100644
 index 000..f760f16
 --- /dev/null
 +++ b/units/systemd-res...@.service.in
 @@ -0,0 +1,23 @@
 +#  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.
 +
 +[Unit]
 +Description=Resume from hibernation using device %f
 +Documentation=man:systemd-resume@.service(8)
 +DefaultDependencies=no
 +Conflicts=shutdown.target
 +BindsTo=%i.device
 +Wants=local-fs-pre.target
 +After=%i.device systemd-udevd.service
 +Before=local-fs-pre.target systemd-remount-fs.service 
 systemd-fsck-root.service usr.mount shutdown.target
 +ConditionPathIsReadWrite=|!/
 +ConditionPathExists=|/etc/initrd-release
 +
 +[Service]
 +Type=oneshot
 +RemainAfterExit=yes

Actually that's interesting. As it stands now, it will be impossible to
get information whether resume actually happened from service status.
It will always reflect the very first invocation, when no resume image
was still present.

To this extent using RemainAfterExit is probably misleading here. There
is no persistent information that's worth keeping.

 +ExecStart=@rootlibexecdir@/systemd-resume %f

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


Re: [systemd-devel] [RFC] [PATCH 0/3] resume: implement support for resuming from hibernation

2014-08-23 Thread Andrei Borzenkov
В Sat, 23 Aug 2014 16:47:51 +0400
Ivan Shapovalov intelfx...@gmail.com пишет:

 This patchset allows systemd to parse resume= kernel command line parameter
 and initiate resume from the specified device.
 
 It adds:
 - a 'systemd-resume' tool which takes path to a device node and
   writes its major:minor to /sys/power/state;
 - a corresponding 'systemd-resume@.service' templated unit;
 - a 'systemd-resume-generator' generator which parses the kernel command line
   and instantiates the unit as necessary.
 
 This functionality already exists in-kernel, but only for /dev/sdXY-style
 pathes. Implementing it in userspace allows to use arbitrary udev-created
 symlinks, e. g. persistent block device pathes (/dev/disk/by-foo/bar).
 
 Userspace parsing of resume= kernel command line parameter has been
 traditionally done in initramfs via shell scripts (for Arch Linux, this is
 resume mkinitcpio hook), so I feel that this feature has its place within
 systemd.
 
 Due to the nature of hibernation, the resume unit must be activated before
 any modifications to filesystems take place. This can happen
 1) in initramfs before mounting anything, and
 2) without initramfs before remounting rootfs read-write (provided that it is
mounted RO initially).
 

Your patch has

+ConditionPathExists=|/etc/initrd-release

Which excludes non-initrd usage, right? Also some filesystems (reiserfs
comes in mind) replayed journal even when mounted read-only. So may be
it should explicitly state initrd-only support and name units
accordingly.

 So, first patch orders all non-root fsck after local-fs-pre.target, which in
 turn allows to order the resume unit before those fsck instances.
 
 Second and third patches add the tool, the unit and the generator.
 
 There are some issues with this implementation:
 
 - legacy usr.mount is not automatically ordered after local-fs-pre.target,
   so systemd-resume@.service has to be manually ordered before it;
 - systemd-udevd.service, which is needed for creating persistent block device
   symlinks, is transitively ordered after systemd-remount-fs.service via at
   least systemd-udev-hwdb-update.service and systemd-sysusers.service.
   Hence, if these units are present (at least initramfs-less case), an 
 ordering
   cycle happens and resume is impossible.
 
 So, I would like someone to comment on these.
 
 This is my first patch to this project, so feel free to flak me for missing
 something obvious :)
 
 Thanks for reviewing!
 
 Ivan Shapovalov (3):
   units: order systemd-fsck@.service after local-fs-pre.target.
   resume: add a tool to write a device node's major:minor to 
 /sys/power/resume.
   resume-generator: add a generator for instantiating the resume unit.
 
  Makefile-man.am |  9 
  Makefile.am | 28 --
  man/kernel-command-line.xml | 13 -
  man/systemd-resume-generator.xml| 91 
 +
  man/systemd-res...@.service.xml | 81 +
  src/resume-generator/Makefile   |  1 +
  src/resume-generator/resume-generator.c | 89 
  src/resume/Makefile |  1 +
  src/resume/resume.c | 82 +
  units/systemd-f...@.service.in  |  2 +-
  units/systemd-res...@.service.in| 23 +
  11 files changed, 414 insertions(+), 6 deletions(-)
  create mode 100644 man/systemd-resume-generator.xml
  create mode 100644 man/systemd-res...@.service.xml
  create mode 12 src/resume-generator/Makefile
  create mode 100644 src/resume-generator/resume-generator.c
  create mode 12 src/resume/Makefile
  create mode 100644 src/resume/resume.c
  create mode 100644 units/systemd-res...@.service.in
 

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


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury
 I understand from loginctl(1) I have to first create 1 new seat with
 loginctl using 1 existing graphic device:
 $ attach seat1 /sys/bus/pci/device/:00:01.0@ (my graphic card as
 listed by $lspci).

Not a very good start :-(

$ lspci
01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce
GTX 770] (rev a1)

# loginctl attach seat1 /sys/bus/pci/devices/:01:00.0
Could not attach device: No such device

$ ls -al /sys/bus/pci/devices/:01:00.0
lrwxrwxrwx 1 root root 0 Aug 23 13:56
/sys/bus/pci/devices/:01:00.0 -
../../../devices/pci:00/:00:01.0/:01:00.0/

# loginctl attach seat1 /sys/bus/pci/devices/:01:00.0
Could not attach device: No such device

-
from loginctl(1):
   attach NAME DEVICE...
   Persistently attach one or more devices to a seat. The devices
   should be specified via device paths in the /sys file system. To
   create a new seat, attach at least one graphics card to a
   previously unused seat name.
---

What is wrong in my command to create seat1 ?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread Andrei Borzenkov
В Sat, 23 Aug 2014 16:26:33 +0200
arnaud gaboury arnaud.gabo...@gmail.com пишет:

  I understand from loginctl(1) I have to first create 1 new seat with
  loginctl using 1 existing graphic device:
  $ attach seat1 /sys/bus/pci/device/:00:01.0@ (my graphic card as
  listed by $lspci).
 
 Not a very good start :-(
 
 $ lspci
 01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce
 GTX 770] (rev a1)
 
 # loginctl attach seat1 /sys/bus/pci/devices/:01:00.0
 Could not attach device: No such device
 
 $ ls -al /sys/bus/pci/devices/:01:00.0
 lrwxrwxrwx 1 root root 0 Aug 23 13:56
 /sys/bus/pci/devices/:01:00.0 -
 ../../../devices/pci:00/:00:01.0/:01:00.0/
 
 # loginctl attach seat1 /sys/bus/pci/devices/:01:00.0
 Could not attach device: No such device
 
 -
 from loginctl(1):
attach NAME DEVICE...
Persistently attach one or more devices to a seat. The devices
should be specified via device paths in the /sys file system. To
create a new seat, attach at least one graphics card to a
previously unused seat name.
 ---
 
 What is wrong in my command to create seat1 ?

You probably want graphic device under it, something like

/sys/devices/pci:00/:00:01.0/:01:00.0/drm/card0

You can only add devices that have udev tag seat (those with
TAGS=...:seat:... in properties).
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread Damian Ivanov
You can get a list of all usable devices including their path by
loginctl seat-status seat0
after that attach a monitor and keyboard (and optionally mouse) and if
you run the right distribution (I've tried with openSUSE and Fedora)
and run gdm as login manager, you new gdm should pop up as soon as you
attach the gpu.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury

 You probably want graphic device under it, something like

 /sys/devices/pci:00/:00:01.0/:01:00.0/drm/card0


 # loginctl attach seat1 /sys/bus/pci/devices/:01:00.0/drm/card0
No error thrown, but:

 # loginctl list-seats
SEAT
seat0

1 seats listed.
No new seat1 !


 % udevadm info --query=all --path=/sys/bus/pci/devices/:01:00.0
P: /devices/pci:00/:00:01.0/:01:00.0
E: DEVPATH=/devices/pci:00/:00:01.0/:01:00.0
E: DRIVER=nvidia
E: ID_MODEL_FROM_DATABASE=GK104 [GeForce GTX 770]
E: ID_PCI_CLASS_FROM_DATABASE=Display controller
E: ID_PCI_INTERFACE_FROM_DATABASE=VGA controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=VGA compatible controller
E: ID_VENDOR_FROM_DATABASE=NVIDIA Corporation
E: MODALIAS=pci:v10DEd1184sv10B0sd1184bc03sc00i00
E: PCI_CLASS=3
E: PCI_ID=10DE:1184
E: PCI_SLOT_NAME=:01:00.0
E: PCI_SUBSYS_ID=10B0:1184
E: SUBSYSTEM=pci
E: USEC_INITIALIZED=53240

I guess I am on the right device directory.



 You can only add devices that have udev tag seat (those with
 TAGS=...:seat:... in properties).

Will learn how to read TAGS. It is new to me for now.



-- 

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


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread Damian Ivanov
With right distro I mean which carry the patches so the multiseat
stuff works. Don't know if Arch has them. Last time I tried gdm was
_required_ for a graphical multi-seat session.

With monitor I meant the gpu... and you need to figure out which of
the usb devices is your keyboard.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread Andrei Borzenkov
В Sat, 23 Aug 2014 16:50:31 +0200
arnaud gaboury arnaud.gabo...@gmail.com пишет:

 
  You probably want graphic device under it, something like
 
  /sys/devices/pci:00/:00:01.0/:01:00.0/drm/card0
 
 
  # loginctl attach seat1 /sys/bus/pci/devices/:01:00.0/drm/card0
 No error thrown, but:
 
  # loginctl list-seats
 SEAT
 seat0
 
 1 seats listed.
 No new seat1 !
 
 
  % udevadm info --query=all --path=/sys/bus/pci/devices/:01:00.0
 P: /devices/pci:00/:00:01.0/:01:00.0
 E: DEVPATH=/devices/pci:00/:00:01.0/:01:00.0
 E: DRIVER=nvidia
 E: ID_MODEL_FROM_DATABASE=GK104 [GeForce GTX 770]
 E: ID_PCI_CLASS_FROM_DATABASE=Display controller
 E: ID_PCI_INTERFACE_FROM_DATABASE=VGA controller
 E: ID_PCI_SUBCLASS_FROM_DATABASE=VGA compatible controller
 E: ID_VENDOR_FROM_DATABASE=NVIDIA Corporation
 E: MODALIAS=pci:v10DEd1184sv10B0sd1184bc03sc00i00
 E: PCI_CLASS=3
 E: PCI_ID=10DE:1184
 E: PCI_SLOT_NAME=:01:00.0
 E: PCI_SUBSYS_ID=10B0:1184
 E: SUBSYSTEM=pci
 E: USEC_INITIALIZED=53240
 
 I guess I am on the right device directory.
 
 
 
  You can only add devices that have udev tag seat (those with
  TAGS=...:seat:... in properties).
 
 Will learn how to read TAGS. It is new to me for now.
 
 
 

P: /devices/pci:00/:00:01.0/:01:00.0/drm/card0
N: dri/card0
E: DEVNAME=/dev/dri/card0
E: DEVPATH=/devices/pci:00/:00:01.0/:01:00.0/drm/card0
E: DEVTYPE=drm_minor
E: ID_FOR_SEAT=drm-pci-_01_00_0
E: ID_PATH=pci-:01:00.0
E: ID_PATH_TAG=pci-_01_00_0
E: MAJOR=226
E: MINOR=0
E: SUBSYSTEM=drm
E: TAGS=:seat:uaccess:
E: USEC_INITIALIZED=189616
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread Damian Ivanov
I would try with an openSUSE/Fedora Live CD first, because I know it
works and if it works for you too but fails on Arch, you may be
missing some patches/config and we could see where it fails maybe.
Especially the gdm thing required a few patches a while ago, don't
know if they are all upstream now. For multiseat on command line level
you need kmscon with that I was able to make multseat command line
session but I could not start X/wayland from there yet. The multi-seat
GUI session is auto-initalized by gdm as soon as a new seat is created
(at least thats what happens for me on openSUSE/Fedora), but that
requires gdm running and set as default.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury
 E: TAGS=:seat:uaccess:

Ok, I see. I do not have this tag for my card.
I see you use xf86-video-nouveau. Am I correct? Shall I the install
xf86-video-nouveau ?


-- 

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


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury
On Sat, Aug 23, 2014 at 5:26 PM, Damian Ivanov damianator...@gmail.com wrote:
 I would try with an openSUSE/Fedora Live CD first, because I know it
 works and if it works for you too but fails on Arch, you may be
 missing some patches/config and we could see where it fails maybe.
 Especially the gdm thing required a few patches a while ago, don't
 know if they are all upstream now. For multiseat on command line level
 you need kmscon with that I was able to make multseat command line
 session but I could not start X/wayland from there yet. The multi-seat
 GUI session is auto-initalized by gdm as soon as a new seat is created
 (at least thats what happens for me on openSUSE/Fedora), but that
 requires gdm running and set as default.

Thank you for advices. I will  install gdm. But in anay case, I want
create a new seat1, and now I am unable to do it (see the TAGS story
in this thread.)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread Andrei Borzenkov
В Sat, 23 Aug 2014 17:28:27 +0200
arnaud gaboury arnaud.gabo...@gmail.com пишет:

  E: TAGS=:seat:uaccess:
 
 Ok, I see. I do not have this tag for my card.
 I see you use xf86-video-nouveau. Am I correct?

No, I use nVidia binary drivers.

 Shall I the install
 xf86-video-nouveau ?
 
 

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


Re: [systemd-devel] [RFC] [PATCH 0/3] resume: implement support for resuming from hibernation

2014-08-23 Thread Ivan Shapovalov
On Saturday 23 August 2014 at 18:22:42, Andrei Borzenkov wrote: 
 В Sat, 23 Aug 2014 16:47:51 +0400
 Ivan Shapovalov intelfx...@gmail.com пишет:
 
  This patchset allows systemd to parse resume= kernel command line parameter
  and initiate resume from the specified device.
  
  It adds:
  - a 'systemd-resume' tool which takes path to a device node and
writes its major:minor to /sys/power/state;
  - a corresponding 'systemd-resume@.service' templated unit;
  - a 'systemd-resume-generator' generator which parses the kernel command 
  line
and instantiates the unit as necessary.
  
  This functionality already exists in-kernel, but only for /dev/sdXY-style
  pathes. Implementing it in userspace allows to use arbitrary udev-created
  symlinks, e. g. persistent block device pathes (/dev/disk/by-foo/bar).
  
  Userspace parsing of resume= kernel command line parameter has been
  traditionally done in initramfs via shell scripts (for Arch Linux, this is
  resume mkinitcpio hook), so I feel that this feature has its place within
  systemd.
  
  Due to the nature of hibernation, the resume unit must be activated before
  any modifications to filesystems take place. This can happen
  1) in initramfs before mounting anything, and
  2) without initramfs before remounting rootfs read-write (provided that it 
  is
 mounted RO initially).
  
 
 Your patch has
 
 +ConditionPathExists=|/etc/initrd-release
 
 Which excludes non-initrd usage, right? Also some filesystems (reiserfs
 comes in mind) replayed journal even when mounted read-only. So may be
 it should explicitly state initrd-only support and name units
 accordingly.

It doesn't exclude non-initramfs image -- there is a second OR-ed conditional
allowing this unit to run on a ro-mounted real root.

I didn't know that reiserfs can write to a ro-mounted fs. If that's true,
non-initramfs usage must be prohibited. I'll send a v2.

Thanks for pointing that out!

-- 
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] loginctl - multi-seats

2014-08-23 Thread poma
On 23.08.2014 15:10, arnaud gaboury wrote:
 Archlinux 3.16.1
 systemd 215-4
 Xorg 1.16
 
 
 Until now, I have been enable to set a dual seat following the
 archwiki[1]. In short, I had to modify the /etc/X11/xorg.conf
 accordingly, then $ startx -- layout seat0 -config
 xorg.conf.multiseat.
 
 I am now trying to migrate to the new facilities for multiseats from
 loginctl[2] and Xorg 1.16 with rootless X[3]. Documentation is very
 rare, and I find it difficult to set up the global scheme.
 
 I understand from loginctl(1) I have to first create 1 new seat with
 loginctl using 1 existing graphic device:
 $ attach seat1 /sys/bus/pci/device/:00:01.0@ (my graphic card as
 listed by $lspci).
 
 Then, I will attach a usb keyboard  mouse the same way, right ?
 
 Now, as for the monitor  session layout, i have no idea how to deal
 with it and the global /etc/X11/xorg.conf . Same as before or is there
 now a more specific way?
 
 Then, once I have created seat1, I am left with two seats : seat0 and
 seat1. I understand I have to
 bind a user session login to a specific seat, right ? Concretely, how do it ?
 
 Thank you for any hint/pointer/suggestion about the path to follow.
 

/etc/lightdm/lightdm.conf
[LightDM]
minimum-display-number=0
minimum-vt=1
user-authority-in-system-dir=true

[SeatDefaults]
greeter-session=lightdm-greeter
session-wrapper=/etc/X11/xinit/Xsession

[Seat:0]
xserver-command=/usr/bin/Xorg
xserver-config=/etc/X11/xorg.conf.nouveau

[Seat:1]
xdg-seat=seat-fu
xserver-command=/usr/bin/Xorg -sharevts -novtswitch

~~

/etc/X11/xorg.conf.nouveau
Section Device
Identifier  nvidia0
Driver  nouveau
EndSection



$ loginctl seat-status seat0
seat0
Sessions: *1086 c15
 Devices:
  ...
  ├─/sys/devices/pci:00/:00:10.0/:01:00.0/drm/card1
  │ drm:card1
  
├─/sys/devices/pci:00/:00:10.0/:01:00.0/graphics/fb0
  │ [MASTER] graphics:fb0 nouveaufb
  ...

~

$ udevadm info -q env -p /sys/class/drm/card1
DEVNAME=/dev/dri/card1
DEVPATH=/devices/pci:00/:00:10.0/:01:00.0/drm/card1
DEVTYPE=drm_minor
ID_FOR_SEAT=drm-pci-_01_00_0
ID_PATH=pci-:01:00.0
ID_PATH_TAG=pci-_01_00_0
MAJOR=226
MINOR=1
SUBSYSTEM=drm
TAGS=:seat:uaccess:
USEC_INITIALIZED=67185

~~

$ man 1 loginctl
   attach [NAME] [DEVICE...]
   ...
   flush-devices

~~

/etc/udev/rules.d/72-seat-drm-pci-_00_04_1-usb-0_6_1_0.rules 
TAG==seat, ENV{ID_FOR_SEAT}==drm-pci-_00_04_1-usb-0_6_1_0, 
ENV{ID_SEAT}=seat-fu

/etc/udev/rules.d/72-seat-graphics-pci-_00_04_1-usb-0_6_1_0.rules 
TAG==seat, ENV{ID_FOR_SEAT}==graphics-pci-_00_04_1-usb-0_6_1_0, 
ENV{ID_SEAT}=seat-fu

~~

$ loginctl seat-status seat-fu
seat-fu
Sessions: *1 c1
 Devices:
  
├─/sys/devices/pci:00/:00:04.1/usb1/1-6/1-6:1.0/drm/card0
  │ drm:card0
  
└─/sys/devices/pci:00/:00:04.1/usb1/1-6/1-6:1.0/graphics/fb1
[MASTER] graphics:fb1 udldrmfb



$ udevadm info -q env -p /sys/class/drm/card0
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci:00/:00:04.1/usb1/1-6/1-6:1.0/drm/card0
DEVTYPE=drm_minor
ID_FOR_SEAT=drm-pci-_00_04_1-usb-0_6_1_0
ID_PATH=pci-:00:04.1-usb-0:6:1.0
ID_PATH_TAG=pci-_00_04_1-usb-0_6_1_0
ID_SEAT=seat-fu
MAJOR=226
MINOR=0
SUBSYSTEM=drm
TAGS=:seat:seat-fu:uaccess:
USEC_INITIALIZED=465981

~~~

$ modinfo -n nouveau
/lib/modules/3.15.10-200.fc20.x86_64/kernel/drivers/gpu/drm/nouveau/nouveau.ko

$ rpm -qf /usr/lib64/xorg/modules/drivers/nouveau_drv.so
xorg-x11-drv-nouveau-1.0.10-1.fc20.x86_64

$ modinfo -n udl
/lib/modules/3.15.10-200.fc20.x86_64/kernel/drivers/gpu/drm/udl/udl.ko

$ rpm -qf /usr/lib64/xorg/modules/drivers/modesetting_drv.so
xorg-x11-drv-modesetting-0.8.0-2.fc20.x86_64

$ rpm -q systemd
systemd-208-21.fc20.x86_64

$ rpm -qf /usr/bin/Xorg
xorg-x11-server-Xorg-1.14.4-11.fc20.x86_64

$ rpm -qf /etc/lightdm/lightdm.conf
lightdm-1.11.4-1.fc20.x86_64


Xorg without root
https://lists.fedoraproject.org/pipermail/test/2014-July/122190.html


Don't forget to post config here when you're done. ;)


poma


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


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury


 Don't forget to post config here when you're done. ;)


Ok, now I have a roadmap. TY so much.

I will post here AND modify the old multi-seat archwiki, when successful.

Ty for the link to the fedora thread. I guess soon each user will then
be able to start a systemd user instance  x session, with one sea
attached to his session. Am I right?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury

 $ udevadm info -q env -p /sys/class/drm/card1
 DEVNAME=/dev/dri/card1
 DEVPATH=/devices/pci:00/:00:10.0/:01:00.0/drm/card1
 DEVTYPE=drm_minor
 ID_FOR_SEAT=drm-pci-_01_00_0
 ID_PATH=pci-:01:00.0
 ID_PATH_TAG=pci-_01_00_0
 MAJOR=226
 MINOR=1
 SUBSYSTEM=drm
 TAGS=:seat:uaccess:
 USEC_INITIALIZED=67185

 ~~

$ udevadm info -q env -p /sys/class/drm/card0
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci:00/:00:01.0/:01:00.0/drm/card0
DEVTYPE=drm_minor
ID_FOR_SEAT=drm-pci-_01_00_0
ID_PATH=pci-:01:00.0
ID_PATH_TAG=pci-_01_00_0
ID_SEAT=seat1
MAJOR=226
MINOR=0
SUBSYSTEM=drm
TAGS=:seat:seat1:uaccess:
USEC_INITIALIZED=1196


Then, I can see I have now a graphical card attached to seat1 !! Great
news and first step.
Still can't understand why $ loginctl list-seats does not return
anything about seat1.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury
I do not understand why I can't see any output about my
/sys/class/drm/card0 when running
--
$ loginctl seat-status seat0
The only entry I see referring to graphics is this line (I boot in EUFI).
  ├─/sys/devices/platform/efi-framebuffer.0/graphics/fb0
  │ [MASTER] graphics:fb0 EFI VGA
--
I understand there is by default NO card assigned to seat0 ? Shall I
then attach one?

As mentioned in previous post, card0 is now attached to seat1
--
$ udevadm info -q env -p /sys/class/drm/card0
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci:00/

TAGS=:seat:seat1:uaccess:


Shall I have some kind of card1 attached to seat0 ?


It seems to me that in Poma config files, there is card0 and card1. As
for my hardware, I have only one card, the nvidia 770, with two
connectors.
--
ls /sys/class/drm/
card0@  version
-

Please, let me see the light :-)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread Damian Ivanov
Yeah, so tl,dr what this is trying to say with one GPU and two
connectors, no multiseat possible using logind (yet, though this
was/is a planned feature). This is not a systemd/logind problem rather
than the driver provides you only one path per GPU (not a seperate per
port/connector). You could get some cheap displaylink device (must be
usb 2!!) like http://plugable.com/products/uga-165/ or a usb hub with
displaylink device (which I own and it can be used as a connect the
monitor and 4 usb devices + Network interface + audio input/output or
as an usb docking station)
http://www.amazon.com/Plugable-Universal-DisplayLink-1920x1080-High-Speed/dp/B002PONXAI/ref=sr_1_1?s=electronicsie=UTF8qid=1408819630sr=1-1keywords=plugable+usb+2.0+docking+station
(and this is device has even a preset rule shipped with udev that by
just plugging it in a new seat is created and everything attached to
that docking station is part of the seat)

2014-08-23 20:33 GMT+02:00 poma pomidorabelis...@gmail.com:
 On 23.08.2014 19:21, arnaud gaboury wrote:
 I do not understand why I can't see any output about my
 /sys/class/drm/card0 when running
 --
 $ loginctl seat-status seat0
 The only entry I see referring to graphics is this line (I boot in EUFI).
   ├─/sys/devices/platform/efi-framebuffer.0/graphics/fb0
   │ [MASTER] graphics:fb0 EFI VGA
 --
 I understand there is by default NO card assigned to seat0 ? Shall I
 then attach one?

 As mentioned in previous post, card0 is now attached to seat1
 --
 $ udevadm info -q env -p /sys/class/drm/card0
 DEVNAME=/dev/dri/card0
 DEVPATH=/devices/pci:00/
 
 TAGS=:seat:seat1:uaccess:
 

 Shall I have some kind of card1 attached to seat0 ?


 It seems to me that in Poma config files, there is card0 and card1. As
 for my hardware, I have only one card, the nvidia 770, with two
 connectors.
 --
 ls /sys/class/drm/
 card0@  version
 -

 Please, let me see the light :-)


 :)
 http://www.freedesktop.org/wiki/Software/systemd/multiseat
 ...
 Definition of Terms
 - A *seat* consists of all hardware devices assigned to a specific workplace. 
 It consists of at least one graphics device, ...


 poma

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


[systemd-devel] [RFC] [PATCHv2 3/3] resume-generator: add a generator for instantiating the resume unit.

2014-08-23 Thread Ivan Shapovalov
resume-generator understands resume= kernel command line parameter and
instantiates the systemd-resume@.service accordingly if it is passed.

This enables resume from hibernation using device specified on the kernel
command line, where the device path may point to an arbitrary udev-created
symlink, not only /dev/sdXY which is understood by the in-kernel
implementation.
---
 Makefile-man.am |  2 +
 man/kernel-command-line.xml | 13 -
 man/systemd-resume-generator.xml| 91 
 src/resume-generator/Makefile   |  1 +
 src/resume-generator/resume-generator.c | 93 +
 5 files changed, 199 insertions(+), 1 deletion(-)
 create mode 100644 man/systemd-resume-generator.xml
 create mode 12 src/resume-generator/Makefile
 create mode 100644 src/resume-generator/resume-generator.c

diff --git a/Makefile-man.am b/Makefile-man.am
index be19905..00daae2 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -76,6 +76,7 @@ MANPAGES += \
man/systemd-nspawn.1 \
man/systemd-path.1 \
man/systemd-remount-fs.service.8 \
+   man/systemd-resume-generator.8 \
man/systemd-resume@.service.8 \
man/systemd-run.1 \
man/systemd-shutdownd.service.8 \
@@ -1632,6 +1633,7 @@ EXTRA_DIST += \
man/systemd-readahead-replay.service.xml \
man/systemd-remount-fs.service.xml \
man/systemd-resolved.service.xml \
+   man/systemd-resume-generator.xml \
man/systemd-res...@.service.xml \
man/systemd-rfk...@.service.xml \
man/systemd-run.xml \
diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml
index f244bfc..4bc6cee 100644
--- a/man/kernel-command-line.xml
+++ b/man/kernel-command-line.xml
@@ -351,6 +351,16 @@
 /listitem
 /varlistentry
 
+varlistentry
+termvarnameresume=/varname/term
+
+listitem
+paraEnables resume from hibernation
+using the specified device. For
+details, see
+
citerefentryrefentrytitlesystemd-resume-generator/refentrytitlemanvolnum8/manvolnum/citerefentry./para
+/listitem
+/varlistentry
 /variablelist
 
 /refsect1
@@ -373,7 +383,8 @@
   
citerefentryrefentrytitlesystemd-gpt-auto-generator/refentrytitlemanvolnum8/manvolnum/citerefentry,
   
citerefentryrefentrytitlesystemd-modules-load.service/refentrytitlemanvolnum8/manvolnum/citerefentry,
   
citerefentryrefentrytitlesystemd-backlight@.service/refentrytitlemanvolnum8/manvolnum/citerefentry,
-  
citerefentryrefentrytitlesystemd-rfkill@.service/refentrytitlemanvolnum8/manvolnum/citerefentry
+  
citerefentryrefentrytitlesystemd-rfkill@.service/refentrytitlemanvolnum8/manvolnum/citerefentry,
+  
citerefentryrefentrytitlesystemd-resume-generator/refentrytitlemanvolnum8/manvolnum/citerefentry
   /para
 /refsect1
 
diff --git a/man/systemd-resume-generator.xml b/man/systemd-resume-generator.xml
new file mode 100644
index 000..7962534
--- /dev/null
+++ b/man/systemd-resume-generator.xml
@@ -0,0 +1,91 @@
+?xml version=1.0?
+!--*-nxml-*--
+!DOCTYPE refentry PUBLIC -//OASIS//DTD DocBook XML V4.2//EN 
http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd;
+!--
+  This file is part of systemd.
+
+  Copyright 2014 Ivan Shapovalov
+
+  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.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see http://www.gnu.org/licenses/.
+--
+refentry id=systemd-resume-generator
+
+refentryinfo
+titlesystemd-resume-generator/title
+productnamesystemd/productname
+
+authorgroup
+author
+contribDeveloper/contrib
+firstnameIvan/firstname
+surnameShapovalov/surname
+emailintelfx...@gmail.com/email
+/author
+/authorgroup
+/refentryinfo
+
+ 

[systemd-devel] [RFC] [PATCHv2 0/3] resume: implement support for resuming from hibernation

2014-08-23 Thread Ivan Shapovalov
This patchset allows systemd to parse resume= kernel command line parameter
and initiate resume from the specified device.

It adds:
- a 'systemd-resume' tool which takes path to a device node and
  writes its major:minor to /sys/power/state;
- a corresponding 'systemd-resume@.service' templated unit;
- a 'systemd-resume-generator' generator which parses the kernel command line
  and instantiates the unit as necessary.

This functionality already exists in-kernel, but only for /dev/sdXY-style
pathes. Implementing it in userspace allows to use arbitrary udev-created
symlinks, e. g. persistent block device pathes (/dev/disk/by-foo/bar).

Userspace parsing of resume= kernel command line parameter has been
traditionally done in initramfs via shell scripts (for Arch Linux, this is
resume mkinitcpio hook), so I feel that this feature has its place within
systemd.

Due to the nature of hibernation, the resume unit must be activated before
any modifications to filesystems take place. This can happen only in initramfs
before mounting anything.

So, first patch orders all non-root fsck after local-fs-pre.target, which in
turn allows to order the resume unit before those fsck instances.

Second and third patches add the tool, the unit and the generator.

There are some issues with this implementation.

- legacy usr.mount is not automatically ordered after local-fs-pre.target,
  so systemd-resume@.service has to be manually ordered before it;
- systemd-udevd.service, which is needed for creating persistent block device
  symlinks, is transitively ordered after systemd-remount-fs.service via at
  least systemd-udev-hwdb-update.service and systemd-sysusers.service.
  Hence, if these units are present, an ordering cycle happens and resume is
  impossible.

Encountering these conditions is very unlikely inside of an initramfs (who
would make the in-initramfs /usr external? who would add systemd-sysusers
into initramfs?), but there can still be pathological cases.

So, I would like someone to comment on these issues.

This is my first patch to this project, so feel free to flak me for missing
something obvious :)

Thanks for reviewing!

v2: fix issues pointed out by Andrei:
- don't RemainAfterExit because it's useless
- don't attempt to resume outside of initramfs because it's unsafe
  (reiserfs replays journal even if mounted RO)

Ivan Shapovalov (3):
  units: order systemd-fsck@.service after local-fs-pre.target.
  resume: add a tool to write a device node's major:minor to /sys/power/resume.
  resume-generator: add a generator for instantiating the resume unit.

 Makefile-man.am |  9 
 Makefile.am | 28 --
 man/kernel-command-line.xml | 13 -
 man/systemd-resume-generator.xml| 91 
 man/systemd-res...@.service.xml | 81 
 src/resume-generator/Makefile   |  1 +
 src/resume-generator/resume-generator.c | 93 +
 src/resume/Makefile |  1 +
 src/resume/resume.c | 82 +
 units/systemd-f...@.service.in  |  2 +-
 units/systemd-res...@.service.in| 20 +++
 11 files changed, 415 insertions(+), 6 deletions(-)
 create mode 100644 man/systemd-resume-generator.xml
 create mode 100644 man/systemd-res...@.service.xml
 create mode 12 src/resume-generator/Makefile
 create mode 100644 src/resume-generator/resume-generator.c
 create mode 12 src/resume/Makefile
 create mode 100644 src/resume/resume.c
 create mode 100644 units/systemd-res...@.service.in

-- 
2.1.0

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


[systemd-devel] [RFC] [PATCHv2 1/3] units: order systemd-fsck@.service after local-fs-pre.target.

2014-08-23 Thread Ivan Shapovalov
With this change, it becomes possible to order a unit to activate before any
modifications to the file systems. This is especially useful for supporting
resume from hibernation.
---
 units/systemd-f...@.service.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/units/systemd-f...@.service.in b/units/systemd-f...@.service.in
index c12efa8..d2cda6a 100644
--- a/units/systemd-f...@.service.in
+++ b/units/systemd-f...@.service.in
@@ -10,7 +10,7 @@ Description=File System Check on %f
 Documentation=man:systemd-fsck@.service(8)
 DefaultDependencies=no
 BindsTo=%i.device
-After=systemd-readahead-collect.service systemd-readahead-replay.service 
%i.device systemd-fsck-root.service
+After=systemd-readahead-collect.service systemd-readahead-replay.service 
%i.device systemd-fsck-root.service local-fs-pre.target
 Before=shutdown.target
 
 [Service]
-- 
2.1.0

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


[systemd-devel] [RFC] [PATCHv2 2/3] resume: add a tool to write a device node's major:minor to /sys/power/resume.

2014-08-23 Thread Ivan Shapovalov
This can be used to initiate a resume from hibernation by path to a swap
device containing the hibernation image.

The respective templated unit is also added. It is instantiated using
path to the desired resume device.
---
 Makefile-man.am  |  7 
 Makefile.am  | 28 --
 man/systemd-res...@.service.xml  | 81 +++
 src/resume/Makefile  |  1 +
 src/resume/resume.c  | 82 
 units/systemd-res...@.service.in | 20 ++
 6 files changed, 215 insertions(+), 4 deletions(-)
 create mode 100644 man/systemd-res...@.service.xml
 create mode 12 src/resume/Makefile
 create mode 100644 src/resume/resume.c
 create mode 100644 units/systemd-res...@.service.in

diff --git a/Makefile-man.am b/Makefile-man.am
index 5c289dd..be19905 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -76,6 +76,7 @@ MANPAGES += \
man/systemd-nspawn.1 \
man/systemd-path.1 \
man/systemd-remount-fs.service.8 \
+   man/systemd-resume@.service.8 \
man/systemd-run.1 \
man/systemd-shutdownd.service.8 \
man/systemd-sleep.conf.5 \
@@ -206,6 +207,7 @@ MANPAGES_ALIAS += \
man/systemd-poweroff.service.8 \
man/systemd-reboot.service.8 \
man/systemd-remount-fs.8 \
+   man/systemd-resume.8 \
man/systemd-shutdown.8 \
man/systemd-shutdownd.8 \
man/systemd-shutdownd.socket.8 \
@@ -311,6 +313,7 @@ man/systemd-kexec.service.8: man/systemd-halt.service.8
 man/systemd-poweroff.service.8: man/systemd-halt.service.8
 man/systemd-reboot.service.8: man/systemd-halt.service.8
 man/systemd-remount-fs.8: man/systemd-remount-fs.service.8
+man/systemd-resume.8: man/systemd-resume@.service.8
 man/systemd-shutdown.8: man/systemd-halt.service.8
 man/systemd-shutdownd.8: man/systemd-shutdownd.service.8
 man/systemd-shutdownd.socket.8: man/systemd-shutdownd.service.8
@@ -592,6 +595,9 @@ man/systemd-reboot.service.html: 
man/systemd-halt.service.html
 man/systemd-remount-fs.html: man/systemd-remount-fs.service.html
$(html-alias)
 
+man/systemd-resume.html: man/systemd-res...@.service.html
+   $(html-alias)
+
 man/systemd-shutdown.html: man/systemd-halt.service.html
$(html-alias)
 
@@ -1626,6 +1632,7 @@ EXTRA_DIST += \
man/systemd-readahead-replay.service.xml \
man/systemd-remount-fs.service.xml \
man/systemd-resolved.service.xml \
+   man/systemd-res...@.service.xml \
man/systemd-rfk...@.service.xml \
man/systemd-run.xml \
man/systemd-shutdownd.service.xml \
diff --git a/Makefile.am b/Makefile.am
index e238cde..820d082 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -371,13 +371,15 @@ rootlibexec_PROGRAMS = \
systemd-sleep \
systemd-bus-proxyd \
systemd-socket-proxyd \
-   systemd-update-done
+   systemd-update-done \
+   systemd-resume
 
 systemgenerator_PROGRAMS = \
systemd-getty-generator \
systemd-fstab-generator \
systemd-system-update-generator \
-   systemd-debug-generator
+   systemd-debug-generator \
+   systemd-resume-generator
 
 dist_bashcompletion_DATA = \
shell-completion/bash/busctl \
@@ -509,7 +511,8 @@ nodist_systemunit_DATA = \
units/initrd-udevadm-cleanup-db.service \
units/initrd-switch-root.service \
units/systemd-nspawn@.service \
-   units/systemd-update-done.service
+   units/systemd-update-done.service \
+   units/systemd-resume@.service
 
 dist_userunit_DATA = \
units/user/basic.target \
@@ -556,7 +559,8 @@ EXTRA_DIST += \
units/initrd-udevadm-cleanup-db.service.in \
units/initrd-switch-root.service.in \
units/systemd-nsp...@.service.in \
-   units/systemd-update-done.service.in
+   units/systemd-update-done.service.in \
+   units/systemd-res...@.service.in
 
 CLEANFILES += \
units/console-shell.service.m4 \
@@ -1930,6 +1934,14 @@ systemd_delta_LDADD = \
libsystemd-shared.la
 
 # 
--
+systemd_resume_SOURCES = \
+   src/resume/resume.c
+
+systemd_resume_LDADD = \
+   libsystemd-internal.la \
+   libsystemd-shared.la
+
+# 
--
 systemd_getty_generator_SOURCES = \
src/getty-generator/getty-generator.c
 
@@ -1962,6 +1974,14 @@ systemd_system_update_generator_LDADD = \
libsystemd-label.la \
libsystemd-shared.la
 
+# 
--
+systemd_resume_generator_SOURCES = \
+   src/resume-generator/resume-generator.c
+
+systemd_resume_generator_LDADD = \
+   libsystemd-label.la \
+   libsystemd-shared.la
+
 if ENABLE_EFI
 # 
--
 

Re: [systemd-devel] [RFC] [PATCH 0/3] resume: implement support for resuming from hibernation

2014-08-23 Thread Tobias Geerinckx-Rice
On 23 August 2014 14:47, Ivan Shapovalov intelfx...@gmail.com wrote:
 This is my first patch to this project, so feel free to flak me for missing
 something obvious :)

On 4 August 2014 10:39, Tobias Geerinckx-Rice
tobias.geerinckx.r...@gmail.com wrote:
 (As this is my first systemd patch, feel free to flak me for missing
 something obvious.)

http://media.tumblr.com/tumblr_lpn8viK7f61qc4jgq.jpg

On a more serious note: thanks for pursuing this; I hope it makes it
into git soon!

Regards,

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


[systemd-devel] [PATCH] systemctl: Correct error message printed when bus_process_wait fails

2014-08-23 Thread Sjoerd Simons
Actually use the variable containing the return code of bus_process_wait when
printing the error message as a result of it failing.
---
 src/systemctl/systemctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index d9b8bee..6534819 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -2382,7 +2382,7 @@ static int wait_for_jobs(sd_bus *bus, Set *s) {
 while (!set_isempty(s)) {
 q = bus_process_wait(bus);
 if (q  0) {
-log_error(Failed to wait for response: %s, 
strerror(-r));
+log_error(Failed to wait for response: %s, 
strerror(-q));
 return q;
 }
 
-- 
2.1.0

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


Re: [systemd-devel] [RFC] [PATCH 0/3] resume: implement support for resuming from hibernation

2014-08-23 Thread Ivan Shapovalov
On Saturday 23 August 2014 at 21:05:13, Tobias Geerinckx-Rice wrote:
 On 23 August 2014 14:47, Ivan Shapovalov intelfx...@gmail.com wrote:
  This is my first patch to this project, so feel free to flak me for missing
  something obvious :)
 
 On 4 August 2014 10:39, Tobias Geerinckx-Rice
 tobias.geerinckx.r...@gmail.com wrote:
  (As this is my first systemd patch, feel free to flak me for missing
  something obvious.)
 
 http://media.tumblr.com/tumblr_lpn8viK7f61qc4jgq.jpg
 
 On a more serious note: thanks for pursuing this; I hope it makes it
 into git soon!

I was just struggling to recall where have I seen this phrase :)

Well, sorry for stealing, but it exactly describes my feeling about this.

-- 
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] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury
I have been able to write some udev rules.d for usb mouse/keyboard.
I plugout the device, then
$  dmesg | tail -n 4
~~
[21145.269421] input: Logitech USB-PS/2 Optical Mouse as
/devices/pci:00/:00:14.0/usb1/1-5/1-5:1.0/0003:046D:C03E.000E/input/input30
~~
$ udevadm info --query=all --path=/devices/pci:00/:00:14.0
~~~
ID_FOR_SEAT=input-pci-_00_14_0-usb-0_5_1_0

Fine.

Now it seems I am at a dead end for my graphic card. As already
stated, I have only one card:/sys/class/drm/card0

I can not attach this physical device to more than one seat. So, for
the graphical display, I have no idea about to deal with. The tweak I
was using before was when using this xorg.conf:

SectionServerLayout
IdentifierMultiSeat
Screen0Screen0
Screen1screen1 leftOf Screen0
EndSection

Section ServerFlags
OptionAllowMouseOpenFailtrue
OptionAutoAddGPUoff
EndSection

## DEVICE SECTION ##
# Two identifiers (nvidia0  nvidia1) #
# 1 Driver (nvidia) with 1 BusID : the graphic card #

Section Device
Identifier nvidia0
Driver nvidia
VendorName NVIDIA Corporation
BusID   PCI:1:0:0
Option NoLogo 1
Option   UseDisplaydeviceDFP
Screen   0
EndSection

Section Device
Identifier nvidia1
Driver nvidia
VendorName NVIDIA Corporation
BusID  PCI:1:0:0
Option NoLogo 1
Option UseDisplaydevice   DFP
Screen 1
EndSection

## SCREEN SECTION ##
# Two screens, each one attached to 1 device #

Section Screen
IdentifierScreen0
Devicenvidia0
MonitorCRT-0
DefaultDepth24
SubsectionDisplay
Depth24
EndSubsection
EndSection

Section Screen
Identifier  Screen1
Device  nvidia1
Monitor DFP-1
DefaultDepth24
Subsection  Display
Depth   24
EndSubsection
EndSection

## INPUT DEVICE SECTION ##
# 2 keyboards  2 mouses #
# Driver is evdev. To list a device, open a terminal and test mouse
and event number #
# # cat /dev/input/mouse0 ... for mouse. Good when weird symboles when
moving the mouse #
# # cat /dev/input/event0 ... for keyboard #

Section Inputdevice
Identifierkeyboard0
Driverevdev
OptionDevice/dev/input/event14
OptionXkbModelevdev
OptionXkblayoutch
OptionXkbVariantfr
Optionterminate:ctrl_alt_bksp
EndSection

Section Inputdevice
Identifier  keyboard1
Driver  evdev
Option  Device/dev/input/event18
Option  XkbModel  evdev
Option  Xkblayout ch
Option  XkbVariantfr
Option  terminate:ctrl_alt_bksp
EndSection

Section Inputdevice
Identifier  mouse0
Driver  mouse
Option  Protocol  IMPS/2
Option  Device/dev/input/mouse0
EndSection

Section Inputdevice
Identifier  mouse1
Driver  mouse
Option  Protocol  IMPS/2
Option  Device/dev/input/mouse1
EndSection

-

I do not know how to reproduce this when using two nvidia devices, as
shown in the xorg.conf. The only idea I have in mind is to create a
card1 in drm subsystem, but it sounds to me like a weird method.

Thank you for suggestion for the graphic card device.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury
On Sat, Aug 23, 2014 at 8:48 PM, Damian Ivanov damianator...@gmail.com wrote:
 Yeah, so tl,dr what this is trying to say with one GPU and two
 connectors, no multiseat possible using logind (yet, though this
 was/is a planned feature). This is not a systemd/logind problem rather
 than the driver provides you only one path per GPU (not a seperate per
 port/connector).

I understand now. But in fact, I have one single card but can plug two
monitors: one on HDMI and the other one on VGA.
Shall i understand there is nothing to do with these two plugin outputs?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] loginctl - multi-seats

2014-08-23 Thread arnaud gaboury
On Sat, Aug 23, 2014 at 9:55 PM, arnaud gaboury
arnaud.gabo...@gmail.com wrote:
 On Sat, Aug 23, 2014 at 8:48 PM, Damian Ivanov damianator...@gmail.com 
 wrote:
 Yeah, so tl,dr what this is trying to say with one GPU and two
 connectors, no multiseat possible using logind (yet, though this
 was/is a planned feature). This is not a systemd/logind problem rather
 than the driver provides you only one path per GPU (not a seperate per
 port/connector).

 I understand now. But in fact, I have one single card but can plug two
 monitors: one on HDMI and the other one on VGA.
 Shall i understand there is nothing to do with these two plugin outputs?

To be more precised, I have on the back of my computer two HDMI ports
and two Display Ports. Can't these two ports be used instead of buying
a usb display link ?



-- 

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


[systemd-devel] [RFC] initrd: systemd-{networkd,resolved}

2014-08-23 Thread Timofey Titovets
Good time of day list, i just want to hear your opinions - pro and con

Pre story:
Before i install bunch of systemd-{networkd,resolved} and
wpa_supplicant (for connecting to HotSpots)

After i spend some time to think about network handling by networkd
and resolved, about some cases and i have idea, what if try to
implement early network connection in initrd?
Pro:
spherical cow - If mount rootfs fail to boot, or mount, we have
network access to restore system.
If system headless we can get remote access as case above and i think it cool.
It useful for nfs mount.

Yes, this implies what we use systemd, as init in boot process.
What i miss? This is good idea or i must burn him in hell.

-- 
Have a nice day,
Timofey.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Fwd: loginctl - multi-seats

2014-08-23 Thread Damian Ivanov
Can't these two ports be used instead of buying a usb display link ?
Yes. That's what it actually mean's. I've read that people want to
improve the drivers in that part in the future, so this could be done,
but at the moment, no it's not possible.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Fwd: loginctl - multi-seats

2014-08-23 Thread arnaud gaboury
On Sat, Aug 23, 2014 at 10:28 PM, Damian Ivanov damianator...@gmail.com wrote:
Can't these two ports be used instead of buying a usb display link ?
 Yes. That's what it actually mean's. I've read that people want to
 improve the drivers in that part in the future, so this could be done,
 but at the moment, no it's not possible.


TY Damian for all your precious details. I understand now the whole scheme.
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] About systemd in initrd support

2014-08-23 Thread Tobias Geerinckx-Rice
On 23 August 2014 13:46, Luca Bruno lethalma...@gmail.com wrote:
 I'm going to do an experiment with NixOS: replace the whole current initrd
 process made of scripts and hooks with systemd.

What a coincidence... I just switched to NixOS last week, moved some
file systems around, and promptly broke my boot. Badly.

The learning curve was steepened by the proprietary initrd script,
which gave me exactly 0 error messages until I could find a live CD
and look up the NixOS-specific boot options on-line. It also manages
to boot slower than my previous systemd-based initrds.

So, yes -- please.

 Also, apart arch linux, is there any other OS that you know using systemd
 for the whole initrd process?

Simon's right: switching to dracut brings relatively decent systemd
support more or less for free. I'd focus on that.

Regarding distributions: I've been using dracut on Exherbo (A Less
Brain-dead Gentoo®) for a year or so. It's the official initrd
generator in that there's a blog post somewhere saying guys you
really should use dracut, but there's no distribution-specific code
or glue anywhere. It still works flawlessly. I take that as a
heartening hint that using it under NixOS should be relatively
straightforward.

Regards,

T G-R

 Thanks for you work.

 Best regards,

 --
 www.debian.org - The Universal Operating System

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

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


[systemd-devel] Match section of .link file not working

2014-08-23 Thread Simon Peeters
Hej all,

I have a system on wich i wish to randomise the mac address of one
specific interface. This is important because it is a wireless vif,
and having multiple vif's with the same mac doesn't work.

I currently have the following config in 50-wl-mac.link:
[Match]
Path=/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3
Type=wlan

[Link]
MACAddressPolicy=random
---
But when I run
# udevadm test-builtin net_setup_link
/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3
I get:
...
Config file /usr/lib/systemd/network/99-default.link applies to device wlv3
...
And the mac address is not randomised.

This feels like a bug to me, any toughts what could cause this?
This is on 215 (archlinux arm does not yet have 216).


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


[systemd-devel] [PATCH] TODO: add molly-guard functionality

2014-08-23 Thread Josh Triplett
Rather than requiring a third-party tool for this, systemctl should
handle this natively.
---
 TODO | 1 +
 1 file changed, 1 insertion(+)

diff --git a/TODO b/TODO
index 0fcd3a0..aaf6444 100644
--- a/TODO
+++ b/TODO
@@ -441,6 +441,7 @@ Features:
   - Something is wrong with symlink handling of autovt@.service in 
systemctl list-unit-files
   - better error message if you run systemctl without systemd running
   - systemctl status output should should include list of triggering units and 
their status
+  - add molly-guard functionality: prompt for hostname if interactively 
shutting down a remote system (running as child of ssh)
 
 * unit install:
   - systemctl mask should find all names by which a unit is accessible
-- 
2.1.0

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


[systemd-devel] [PATCH] journalctl: verify object size in enumerate_unique

2014-08-23 Thread Zbigniew Jędrzejewski-Szmek
We assumed that objects in a unique chain are good enough,
and only checked object type. But mmap code crashes when some object
has zero size. This most likely is caused by a corrupted journal
file, but we should fail gracefully.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758392
https://bugs.freedesktop.org/show_bug.cgi?id=82894
---
I cannot reproduce the crash, but anyway, the check seems to be in order.

 src/journal/sd-journal.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 3840ee486f..a30db439f0 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -2590,6 +2590,13 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, 
const void **data, size_
 return -EBADMSG;
 }
 
+if (o-object.size  k) {
+log_error(%s:offset  OFSfmt : object has size 
%PRIu64, expected at least %zu,
+  j-unique_file-path, j-unique_offset,
+  o-object.size, k);
+return -EBADMSG;
+}
+
 r = journal_file_object_keep(j-unique_file, o, 
j-unique_offset);
 if (r  0)
 return r;
-- 
1.9.3

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


Re: [systemd-devel] Match section of .link file not working

2014-08-23 Thread Andrei Borzenkov
В Sun, 24 Aug 2014 03:04:03 +0200
Simon Peeters peeters.si...@gmail.com пишет:

 Hej all,
 
 I have a system on wich i wish to randomise the mac address of one
 specific interface. This is important because it is a wireless vif,
 and having multiple vif's with the same mac doesn't work.
 
 I currently have the following config in 50-wl-mac.link:
 [Match]
 Path=/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3

This should be the value of ID_PATH property, not sysfs path. Check with

udevadm info --query
property 
/sys/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3

 Type=wlan
 
 [Link]
 MACAddressPolicy=random
 ---
 But when I run
 # udevadm test-builtin net_setup_link
 /devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3
 I get:
 ...
 Config file /usr/lib/systemd/network/99-default.link applies to device wlv3
 ...
 And the mac address is not randomised.
 
 This feels like a bug to me, any toughts what could cause this?
 This is on 215 (archlinux arm does not yet have 216).
 
 
 Simon Peeters.
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

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


Re: [systemd-devel] Match section of .link file not working

2014-08-23 Thread Simon Peeters
2014-08-24 6:23 GMT+02:00 Andrei Borzenkov arvidj...@gmail.com:
 В Sun, 24 Aug 2014 03:04:03 +0200
 Simon Peeters peeters.si...@gmail.com пишет:

 Hej all,

 I have a system on wich i wish to randomise the mac address of one
 specific interface. This is important because it is a wireless vif,
 and having multiple vif's with the same mac doesn't work.

 I currently have the following config in 50-wl-mac.link:
 [Match]
 Path=/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3

 This should be the value of ID_PATH property, not sysfs path. Check with

 udevadm info --query
 property 
 /sys/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3

oops, I confused ID_PATH with DEVPATH, now i feel like an idiot.

thanks.


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


Re: [systemd-devel] Match section of .link file not working

2014-08-23 Thread Simon Peeters
2014-08-24 6:45 GMT+02:00 Simon Peeters peeters.si...@gmail.com:
 2014-08-24 6:23 GMT+02:00 Andrei Borzenkov arvidj...@gmail.com:
 В Sun, 24 Aug 2014 03:04:03 +0200
 Simon Peeters peeters.si...@gmail.com пишет:

 Hej all,

 I have a system on wich i wish to randomise the mac address of one
 specific interface. This is important because it is a wireless vif,
 and having multiple vif's with the same mac doesn't work.

 I currently have the following config in 50-wl-mac.link:
 [Match]
 Path=/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3

 This should be the value of ID_PATH property, not sysfs path. Check with

 udevadm info --query
 property 
 /sys/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3

 oops, I confused ID_PATH with DEVPATH, now i feel like an idiot.

Ok, so there is only one problem now:
ID_PATH is the same for all my vif interfaces, and i need to select
only one of them.

sigh, and manually setting the mac address gives anoying races :(

Any idea how I could match a single vif interface?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Match section of .link file not working

2014-08-23 Thread Andrei Borzenkov
В Sun, 24 Aug 2014 06:49:39 +0200
Simon Peeters peeters.si...@gmail.com пишет:

 2014-08-24 6:45 GMT+02:00 Simon Peeters peeters.si...@gmail.com:
  2014-08-24 6:23 GMT+02:00 Andrei Borzenkov arvidj...@gmail.com:
  В Sun, 24 Aug 2014 03:04:03 +0200
  Simon Peeters peeters.si...@gmail.com пишет:
 
  Hej all,
 
  I have a system on wich i wish to randomise the mac address of one
  specific interface. This is important because it is a wireless vif,
  and having multiple vif's with the same mac doesn't work.
 
  I currently have the following config in 50-wl-mac.link:
  [Match]
  Path=/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3
 
  This should be the value of ID_PATH property, not sysfs path. Check with
 
  udevadm info --query
  property 
  /sys/devices/ocp.3/4740.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/net/wlv3
 
  oops, I confused ID_PATH with DEVPATH, now i feel like an idiot.
 
 Ok, so there is only one problem now:
 ID_PATH is the same for all my vif interfaces, and i need to select
 only one of them.
 

Please show udevadm info -q all for each interface.

 sigh, and manually setting the mac address gives anoying races :(
 
 Any idea how I could match a single vif interface?

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