mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 20:43:02 +02:00
confd: dagger: Explicitly choose order for init/exit actions
Dagger's builtin fallback to bottom-up works for init, but exit should run top-down.
This commit is contained in:
committed by
Joachim Wiberg
parent
580c5b06b9
commit
5e23b2ac79
+15
-1
@@ -111,10 +111,24 @@ int dagger_claim(struct dagger *d, const char *path)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (readdf(&d->current, "%s/current", path))
|
||||
if (readdf(&d->current, "%s/current", path)) {
|
||||
d->current = -1;
|
||||
} else {
|
||||
err = systemf("mkdir -p %s/%d/action/exit"
|
||||
" && "
|
||||
"ln -s ../../top-down-order %s/%d/action/exit/order",
|
||||
path, d->current, path, d->current);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
d->next = d->current + 1;
|
||||
err = systemf("mkdir -p %s/%d/action/init"
|
||||
" && "
|
||||
"ln -s ../../bottom-up-order %s/%d/action/init/order",
|
||||
path, d->next, path, d->next);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
strlcpy(d->path, path, sizeof(d->path));
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user