chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
device: set recursive_stop=true by default
[elogind.git]
/
src
/
device.c
diff --git
a/src/device.c
b/src/device.c
index 2cbb81aebdfb4dfb9e4e95242eb59b6215114bc1..0ddd3b3d09734f7e7fe5dd668b01fd68993e8a6a 100644
(file)
--- a/
src/device.c
+++ b/
src/device.c
@@
-69,6
+69,12
@@
static void device_init(Unit *u) {
* happen for the other units since their operations time out
* anyway. */
d->meta.job_timeout = DEFAULT_TIMEOUT_USEC;
* happen for the other units since their operations time out
* anyway. */
d->meta.job_timeout = DEFAULT_TIMEOUT_USEC;
+
+ /* We enable recursive stopping by default for all
+ devices. This enables the user to use Requires= to make a
+ service go a way when a device goes away, and Wants=
+ otherwise. */
+ d->meta.recursive_stop = true;
}
static void device_done(Unit *u) {
}
static void device_done(Unit *u) {
@@
-188,10
+194,6
@@
static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
if ((r = device_find_escape_name(m, path, &u)) < 0)
return r;
if ((r = device_find_escape_name(m, path, &u)) < 0)
return r;
- /* If a different unit already claimed this name then let's do
- * nothing. This can happen for example when two disks with
- * the same label are plugged in, and which hence try to get
- * conflicting symlinks in /dev/disk/by-label/xxxx */
if (u && DEVICE(u)->sysfs && !path_equal(DEVICE(u)->sysfs, sysfs))
return -EEXIST;
if (u && DEVICE(u)->sysfs && !path_equal(DEVICE(u)->sysfs, sysfs))
return -EEXIST;