-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CA-286144: add usb-scan systemd units
udev does not tolerate the time it can take for XAPI to complete a pUSB rescan request. Use a service listening on a socket to perform the scan request so that the udev action just becomes writing to a non-blocking pipe.
- Loading branch information
Simon Rowe
committed
Nov 5, 2018
1 parent
26096a2
commit f64dd9d
Showing
4 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Unit] | ||
Description=USB device scanner | ||
|
||
[Service] | ||
StandardInput=socket | ||
ExecStart=/usr/bin/sh -c '. /etc/xensource-inventory; while dd of=/dev/null bs=4096 count=1 status=none conv=noerror; do xe pusb-scan host-uuid=$${INSTALLATION_UUID}; done' | ||
Restart=always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Before=systemd-udevd | ||
|
||
[Socket] | ||
ListenFIFO=/var/run/usb-scan.sock | ||
PipeSize=4096 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |