[systemd-devel] Systemd user service needs to wait for encrypted $HOME to be decrypted

2015-09-04 Thread John
Assuming a user has an encrypted $HOME, I need a user service that will:


1) Wait for the $HOME to be decrypted, then run ExecStart, and
2) Run ExecStop before the user closes the encryption again.
3) Totally ignore the encryption requirement if the user has no encryption 
setup, ie just run normally.


I haven't dealt this requirement before so I'm asking for suggestions.  The 
following is the current user service file draft which works as expected 
without the encryption requirement.  Thank you in advance for your suggestions.

[Unit]
Description=Profile-sync-daemon
Documentation=man:psd(1) man:profile-sync-daemon(1)
Documentation=https://wiki.archlinux.org/index.php/Profile-sync-daemon
Wants=psd.timer
Wants=local-fs.target
RequiresMountsFor=/home/
After=winbindd.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/profile-sync-daemon resync
ExecStop=/usr/bin/profile-sync-daemon unsync

[Install]
WantedBy=default.target
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Multi seats setup How-to

2015-09-04 Thread Floris



I can't create a new seat1, no idea why.

Here is my current configuration:

-nvidia card + nvidia driver + nouveau blacklisted
- USB 3 dock station with displaylink driver + systemd service
- gdm
- systemd 219

---
$ loginctl seat-status
Sessions: *1 c1
 Devices:

  ├─/sys/devices/pci:00/:00:01.0/:01:00.0/drm/card0
  │ drm:card0

├─/sys/devices/pci:00/:00:01.0/:01:00.0/drm/renderD128
  │ drm:renderD128

├─/sys/devices/pci:00/:00:01.0/:01:00.0/graphics/fb0
  │ [MASTER] graphics:fb0 "nouveaufb"


there is still some nouveau on your system, but if this belongs to seat0
this isn't a problem for now.



  ├─/sys/devices/platform/evdi.0/graphics/fb1
  │ [MASTER] graphics:fb1 "evdidrmfb" [*]




  ├─/sys/devices/platform/evdi.1/drm/card2
  │ drm:card2
  ├─/sys/devices/platform/evdi.1/graphics/fb2
  │ [MASTER] graphics:fb2 "evdidrmfb" [*]


[*] attach these two also to seat1, or maybe seat1 and seat2. Your the usb3
displaylink has two monitor outputs, so you can create three seats ;-)


  ├─/sys/devices/virtual/misc/kvm
  │ misc:kvm
  └─/sys/devices/virtual/misc/rfkill
misc:rfkill
-

# loginctl attach seat1 /sys/devices/platform/evdi.1/drm/card2
then same for usb devices


$ ls /etc/udev/rules.d
72-seat-drm-platform-evdi_0.rules
72-seat-drm-platform-evdi_1.rules
72-seat-input-pci-_00_14_0-usb-0_10_4_1_1_1.rules
72-seat-input-pci-_00_14_0-usb-0_10_4_2_1_2.rules
72-seat-usb-pci-_00_14_0.rules
72-seat-usb-pci-_00_14_0-usb-0_10_4.rules
99-displaylink.rules




99-nvidia_seats.rules


If your nvidia card is only for seat0, you can remove this rule.
(everything without a rule belongs to seat0)



NB: All the 72-seat* have been created when I run $ loginctl attache
seat1 MyDevice


$ udevadmn info /sys/devices/platform/evdi.1/drm/card2

P: /devices/platform/evdi.1/drm/card2
N: dri/card2
E: DEVNAME=/dev/dri/card2
E: DEVPATH=/devices/platform/evdi.1/drm/card2
E: DEVTYPE=drm_minor
E: ID_FOR_SEAT=drm-platform-evdi_1
E: ID_PATH=platform-evdi.1
E: ID_PATH_TAG=platform-evdi_1
E: ID_SEAT=seat1
E: MAJOR=226
E: MINOR=2
E: SUBSYSTEM=drm
E: TAGS=:seat:seat1:uaccess:
E: USEC_INITIALIZED=160111782


$ cat /etc/udev/rules.d/99-displaylink.rules
 (shipped with the displaylink .rmp driver)
---
ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR}=="DisplayLink",
MODE="0660", RUN+="/bin/systemctl start displaylink.service"
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_VENDOR}=="DisplayLink",
RUN+="/bin/systemctl stop displaylink.service"
--

$ cat /etc/udev/rules.d/99-nvidia_seats.rules
--
# provide a suitable udev rule to tag your NVIDIA card as  
"master-of-seat"

  SUBSYSTEM=="drm", KERNEL=="card[0-9]*", ATTRS{vendor}=="0x10de",
DRIVERS=="nvidia", TAG+="master-of-seat"

  SUBSYSTEM=="pci", ATTRS{vendor}=="0x10de", DRIVER=="nvidia",
TAG+="seat", TAG+="master-of-seat"


cat /etc/udev/rules.d/72-seat-drm-platform-evdi_1.rules
---
TAG=="seat", ENV{ID_FOR_SEAT}=="drm-platform-evdi_1",  
ENV{ID_SEAT}="seat1"

-

cat  
/etc/udev/rules.d/72-seat-input-pci-_00_14_0-usb-0_10_4_1_1_1.rules

--

TAG=="seat", ENV{ID_FOR_SEAT}=="input-pci-_00_14_0-usb-0_10_4_1_1_1",
ENV{ID_SEAT}="seat1"
---



# systemctl restart systemd-udev-trigger.service (or even reboot)

$ loginctl show-session (two users logged in)
  SESSIONUID USER SEAT
 2   1001 Martin   seat0
 1   1000 Louisseat0
c1 42 gdm  seat0
3 sessions listed.

$ loginctl list-seats

SEAT
seat0

1 seats listed.

xx

What am I missing? Why can't I create seat1 ?
Maybe # rm /etc/udev/rules.d/72*  and try again ?




attach the [MASTER] graphics:fb* to seat1 and it should work.

success,

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


Re: [systemd-devel] Multi seats setup How-to

2015-09-04 Thread Laércio de Sousa
Arnaud,

You must focus on the graphics/fb* syspaths (since they are tagged as
[MASTER] in udev/logind), not the drm/card* ones. You must attach the
[MASTER] devnode to a new seat in order to create it.

BTW, systemd already ships udev rules to set property ID_AUTOSEAT for
DisplayLink USB 2.0 Docking Stations, so that you don't need to attach them
manually. Maybe these rules should be updated to include USB 3.0 Docking
Stations as well.

2015-09-04 13:00 GMT-03:00 arnaud gaboury :

> On Thu, Sep 3, 2015 at 5:06 PM, arnaud gaboury 
> wrote:
> >
> > On Thu, Sep 3, 2015, 3:46 PM Floris  wrote:
> >
> >>
> >> I was missing one piece of the puzzle. My USB dock station is
> >> Plugable® UD-3900 USB 3.0
> >>
> >> 
> >> 1-
> >> I had to install the kernel driver for it, following instructions per
> >> this displaylink forum[0]. Once the .rpm package installed, I could
> >> verify:
> >> $ lsmod | grep evdi
> >>
> >> evdi   36864  0
> >> drm_kms_helper122880  2 evdi,nouveau
> >> drm   331776  10 ttm,evdi,drm_kms_helper,nouveau
> >>
> >>
> >> # ll /lib/modules/$(uname -r)/extra/evdi.ko
> >> -rw-r--r--. 1 root root 63072  3 sept. 14:29
> >> /lib/modules/4.1.6-200.fc22.x86_64/extra/evdi.ko
> >>
> >> 
> >> 2-
> >> Now $ loginctl seat-status seat0 returns something more interesting:
> >>
> >>   ├─/sys/devices/platform/evdi.0/drm/card1
> >>   │ drm:card1
> >>
> >> So I guess now I have indeed two cards.
> >>
> >
> > Lets make things clear. The usb dock will be your second seat. I think
> > the next steps will be enough:
> >
> > loginctl attach seat1 /sys/devices/platform/evdi.0/drm/card1
> > loginctl attach seat1 /the path to the usb3 hub
> >
> > everything you didn't attach with loginctl or with an udev rule will
> > be part of seat0. So if your nvidia card is for seat0 you don't have
> > to write a rule for it.
> >
> > Ok. So it would be indeed much simpler than first thought.
>
> x
> I can't create a new seat1, no idea why.
>
> Here is my current configuration:
>
> -nvidia card + nvidia driver + nouveau blacklisted
> - USB 3 dock station with displaylink driver + systemd service
> - gdm
> - systemd 219
>
> ---
> $ loginctl seat-status
> Sessions: *1 c1
>  Devices:
>
>
> ├─/sys/devices/pci:00/:00:01.0/:01:00.0/drm/card0
>   │ drm:card0
>
> ├─/sys/devices/pci:00/:00:01.0/:01:00.0/drm/renderD128
>   │ drm:renderD128
>
> ├─/sys/devices/pci:00/:00:01.0/:01:00.0/graphics/fb0
>   │ [MASTER] graphics:fb0 "nouveaufb"
>
> 
>   ├─/sys/devices/platform/evdi.0/graphics/fb1
>   │ [MASTER] graphics:fb1 "evdidrmfb"
>   ├─/sys/devices/platform/evdi.1/drm/card2
>   │ drm:card2
>   ├─/sys/devices/platform/evdi.1/graphics/fb2
>   │ [MASTER] graphics:fb2 "evdidrmfb"
>   ├─/sys/devices/virtual/misc/kvm
>   │ misc:kvm
>   └─/sys/devices/virtual/misc/rfkill
> misc:rfkill
>
> -
>
> # loginctl attach seat1 /sys/devices/platform/evdi.1/drm/card2
> then same for usb devices
>
>
> $ ls /etc/udev/rules.d
> 72-seat-drm-platform-evdi_0.rules
> 72-seat-drm-platform-evdi_1.rules
> 72-seat-input-pci-_00_14_0-usb-0_10_4_1_1_1.rules
> 72-seat-input-pci-_00_14_0-usb-0_10_4_2_1_2.rules
> 72-seat-usb-pci-_00_14_0.rules
> 72-seat-usb-pci-_00_14_0-usb-0_10_4.rules
> 99-displaylink.rules
> 99-nvidia_seats.rules
>
> NB: All the 72-seat* have been created when I run $ loginctl attache
> seat1 MyDevice
>
> 
> $ udevadmn info /sys/devices/platform/evdi.1/drm/card2
>
> P: /devices/platform/evdi.1/drm/card2
> N: dri/card2
> E: DEVNAME=/dev/dri/card2
> E: DEVPATH=/devices/platform/evdi.1/drm/card2
> E: DEVTYPE=drm_minor
> E: ID_FOR_SEAT=drm-platform-evdi_1
> E: ID_PATH=platform-evdi.1
> E: ID_PATH_TAG=platform-evdi_1
> E: ID_SEAT=seat1
> E: MAJOR=226
> E: MINOR=2
> E: SUBSYSTEM=drm
> E: TAGS=:seat:seat1:uaccess:
> E: USEC_INITIALIZED=160111782
> 
>
> $ cat /etc/udev/rules.d/99-displaylink.rules
>  (shipped with the displaylink .rmp driver)
> ---
> ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR}=="DisplayLink",
> MODE="0660", RUN+="/bin/systemctl start displaylink.service"
> ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_VENDOR}=="DisplayLink",
> RUN+="/bin/systemctl stop displaylink.service"
> --
>
> $ cat /et

Re: [systemd-devel] Multi seats setup How-to

2015-09-04 Thread arnaud gaboury
On Thu, Sep 3, 2015 at 5:06 PM, arnaud gaboury  wrote:
>
> On Thu, Sep 3, 2015, 3:46 PM Floris  wrote:
>
>>
>> I was missing one piece of the puzzle. My USB dock station is
>> Plugable® UD-3900 USB 3.0
>>
>> 
>> 1-
>> I had to install the kernel driver for it, following instructions per
>> this displaylink forum[0]. Once the .rpm package installed, I could
>> verify:
>> $ lsmod | grep evdi
>>
>> evdi   36864  0
>> drm_kms_helper122880  2 evdi,nouveau
>> drm   331776  10 ttm,evdi,drm_kms_helper,nouveau
>>
>>
>> # ll /lib/modules/$(uname -r)/extra/evdi.ko
>> -rw-r--r--. 1 root root 63072  3 sept. 14:29
>> /lib/modules/4.1.6-200.fc22.x86_64/extra/evdi.ko
>>
>> 
>> 2-
>> Now $ loginctl seat-status seat0 returns something more interesting:
>>
>>   ├─/sys/devices/platform/evdi.0/drm/card1
>>   │ drm:card1
>>
>> So I guess now I have indeed two cards.
>>
>
> Lets make things clear. The usb dock will be your second seat. I think
> the next steps will be enough:
>
> loginctl attach seat1 /sys/devices/platform/evdi.0/drm/card1
> loginctl attach seat1 /the path to the usb3 hub
>
> everything you didn't attach with loginctl or with an udev rule will
> be part of seat0. So if your nvidia card is for seat0 you don't have
> to write a rule for it.
>
> Ok. So it would be indeed much simpler than first thought.

x
I can't create a new seat1, no idea why.

Here is my current configuration:

-nvidia card + nvidia driver + nouveau blacklisted
- USB 3 dock station with displaylink driver + systemd service
- gdm
- systemd 219

---
$ loginctl seat-status
Sessions: *1 c1
 Devices:

  ├─/sys/devices/pci:00/:00:01.0/:01:00.0/drm/card0
  │ drm:card0

├─/sys/devices/pci:00/:00:01.0/:01:00.0/drm/renderD128
  │ drm:renderD128

├─/sys/devices/pci:00/:00:01.0/:01:00.0/graphics/fb0
  │ [MASTER] graphics:fb0 "nouveaufb"

  ├─/sys/devices/platform/evdi.0/graphics/fb1
  │ [MASTER] graphics:fb1 "evdidrmfb"
  ├─/sys/devices/platform/evdi.1/drm/card2
  │ drm:card2
  ├─/sys/devices/platform/evdi.1/graphics/fb2
  │ [MASTER] graphics:fb2 "evdidrmfb"
  ├─/sys/devices/virtual/misc/kvm
  │ misc:kvm
  └─/sys/devices/virtual/misc/rfkill
misc:rfkill
-

# loginctl attach seat1 /sys/devices/platform/evdi.1/drm/card2
then same for usb devices


$ ls /etc/udev/rules.d
72-seat-drm-platform-evdi_0.rules
72-seat-drm-platform-evdi_1.rules
72-seat-input-pci-_00_14_0-usb-0_10_4_1_1_1.rules
72-seat-input-pci-_00_14_0-usb-0_10_4_2_1_2.rules
72-seat-usb-pci-_00_14_0.rules
72-seat-usb-pci-_00_14_0-usb-0_10_4.rules
99-displaylink.rules
99-nvidia_seats.rules

NB: All the 72-seat* have been created when I run $ loginctl attache
seat1 MyDevice


$ udevadmn info /sys/devices/platform/evdi.1/drm/card2

P: /devices/platform/evdi.1/drm/card2
N: dri/card2
E: DEVNAME=/dev/dri/card2
E: DEVPATH=/devices/platform/evdi.1/drm/card2
E: DEVTYPE=drm_minor
E: ID_FOR_SEAT=drm-platform-evdi_1
E: ID_PATH=platform-evdi.1
E: ID_PATH_TAG=platform-evdi_1
E: ID_SEAT=seat1
E: MAJOR=226
E: MINOR=2
E: SUBSYSTEM=drm
E: TAGS=:seat:seat1:uaccess:
E: USEC_INITIALIZED=160111782


$ cat /etc/udev/rules.d/99-displaylink.rules
 (shipped with the displaylink .rmp driver)
---
ACTION=="add", SUBSYSTEM=="usb", ENV{ID_VENDOR}=="DisplayLink",
MODE="0660", RUN+="/bin/systemctl start displaylink.service"
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_VENDOR}=="DisplayLink",
RUN+="/bin/systemctl stop displaylink.service"
--

$ cat /etc/udev/rules.d/99-nvidia_seats.rules
--
# provide a suitable udev rule to tag your NVIDIA card as "master-of-seat"
  SUBSYSTEM=="drm", KERNEL=="card[0-9]*", ATTRS{vendor}=="0x10de",
DRIVERS=="nvidia", TAG+="master-of-seat"

  SUBSYSTEM=="pci", ATTRS{vendor}=="0x10de", DRIVER=="nvidia",
TAG+="seat", TAG+="master-of-seat"


cat /etc/udev/rules.d/72-seat-drm-platform-evdi_1.rules
---
TAG=="seat", ENV{ID_FOR_SEAT}=="drm-platform-evdi_1", ENV{ID_SEAT}="seat1"
-

cat /etc/udev/rules.d/72-seat-input-pci-

[systemd-devel] [PATCH] udev: build by-path identifiers for ATA

2015-09-04 Thread David Milburn
Patch to build by-path identifiers for ATA devices.

# pwd
/dev/disk/by-path

# ll
total 0
lrwxrwxrwx. 1 root root  9 Sep  4 10:02 pci-:00:1f.2-ata-2 -> ../../sr0
lrwxrwxrwx. 1 root root  9 Sep  4 10:02 pci-:00:1f.2-ata-3 -> ../../sdd
lrwxrwxrwx. 1 root root 10 Sep  4 10:02 pci-:00:1f.2-ata-3-part1 -> 
../../sdd1
lrwxrwxrwx. 1 root root 10 Sep  4 10:02 pci-:00:1f.2-ata-3-part2 -> 
../../sdd2
lrwxrwxrwx. 1 root root 10 Sep  4 10:02 pci-:00:1f.2-ata-3-part3 -> 
../../sdd3
lrwxrwxrwx. 1 root root  9 Sep  4 10:02 pci-:03:00.0-ata-4 -> ../../sda
lrwxrwxrwx. 1 root root 10 Sep  4 10:02 pci-:03:00.0-ata-4-part1 -> 
../../sda1
lrwxrwxrwx. 1 root root 10 Sep  4 10:02 pci-:03:00.0-ata-4-part2 -> 
../../sda2
lrwxrwxrwx. 1 root root  9 Sep  4 10:02 pci-:08:00.0-ata-1 -> ../../sdc
lrwxrwxrwx. 1 root root 10 Sep  4 10:02 pci-:08:00.0-ata-1-part1 -> 
../../sdc1
lrwxrwxrwx. 1 root root 10 Sep  4 10:02 pci-:08:00.0-ata-1-part2 -> 
../../sdc2

--- src/udev/udev-builtin-path_id.c.systemd-208-20.el7  2015-09-03 
10:19:20.385434297 -0500
+++ src/udev/udev-builtin-path_id.c 2015-09-04 10:05:22.039260808 -0500
@@ -217,6 +217,38 @@ out:
 return parent;
 }
 
+static struct udev_device *handle_scsi_ata(struct udev_device *parent, char 
**path)
+{
+   struct udev *udev  = udev_device_get_udev(parent);
+   struct udev_device *targetdev;
+   struct udev_device *target_parent;
+   struct udev_device *atadev;
+   const char *port_no;
+
+   targetdev = udev_device_get_parent_with_subsystem_devtype(parent, 
"scsi", "scsi_host");
+   if (targetdev == NULL)
+   return NULL;
+
+   target_parent = udev_device_get_parent(targetdev);
+   if (target_parent == NULL)
+   return NULL;
+
+   atadev = udev_device_new_from_subsystem_sysname(udev, "ata_port",
+   
udev_device_get_sysname(target_parent));
+   if (atadev == NULL)
+   return NULL;
+
+   port_no = udev_device_get_sysattr_value(atadev, "port_no");
+   if (port_no == NULL) {
+   parent = NULL;
+   goto out;
+   }
+   path_prepend(path, "ata-%s", port_no);
+out:
+udev_device_unref(atadev);
+return parent;
+}
+
 static struct udev_device *handle_scsi_default(struct udev_device *parent, 
char **path)
 {
 struct udev_device *hostdev;
@@ -374,20 +406,9 @@ static struct udev_device *handle_scsi(s
 goto out;
 }
 
-/*
- * We do not support the ATA transport class, it uses global counters
- * to name the ata devices which numbers spread across multiple
- * controllers.
- *
- * The real link numbers are not exported. Also, possible chains of 
ports
- * behind port multipliers cannot be composed that way.
- *
- * Until all that is solved at the kernel level, there are no by-path/
- * links for ATA devices.
- */
 if (strstr(name, "/ata") != NULL) {
-parent = NULL;
-goto out;
+   parent = handle_scsi_ata(parent, path);
+   goto out;
 }
 
 if (strstr(name, "/vmbus_") != NULL) {
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] hwdb: Add Thinkpad T550 / W550s to 70-pointingstick.hwdb

2015-09-04 Thread systemd github import bot
Patchset imported to github.
To create a pull request, one of the main developers has to initiate one via:


--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] hwdb: Add Thinkpad T550 / W550s to 70-pointingstick.hwdb

2015-09-04 Thread Hans de Goede
Like many other recent thinkpads the factory default pointingstick
sensitivity on these devices is quite low, making the pointingstick
very slow in moving the cursor.

This extends the existing hwdb rules for tweaking the sensitivity to
also apply to the T550 / W550s models.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1200717
---
 hwdb/70-pointingstick.hwdb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hwdb/70-pointingstick.hwdb b/hwdb/70-pointingstick.hwdb
index a8c21a2..9d15173 100644
--- a/hwdb/70-pointingstick.hwdb
+++ b/hwdb/70-pointingstick.hwdb
@@ -95,6 +95,8 @@ evdev:name:TPPS/2 IBM 
TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX240
 evdev:name:TPPS/2 IBM 
TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT440s:*
 # Lenovo Thinkpad T540p
 evdev:name:TPPS/2 IBM 
TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT540p:*
+# Lenovo Thinkpad T550 / W550s
+evdev:name:TPPS/2 IBM 
TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT550:*
   POINTINGSTICK_SENSITIVITY=200
   POINTINGSTICK_CONST_ACCEL=1.0
 
-- 
2.4.3

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