Create /run/citadel/realms/current if it does not exist or inotify watch will fail

This commit is contained in:
Bruce Leidl 2020-08-05 16:07:47 -04:00
parent 04df758fbb
commit 044d8a3457

View File

@ -293,6 +293,8 @@ impl InotifyEventListener {
.map_err(context!("inotify initialization failed"))?;
let realms_watch = inotify.add_watch("/realms", WatchMask::MOVED_FROM|WatchMask::MOVED_TO)
.map_err(context!("error adding watch for /realms to inotify"))?;
util::create_dir("/run/citadel/realms/current")?;
let current_watch = inotify.add_watch("/run/citadel/realms/current", WatchMask::CREATE|WatchMask::MOVED_TO)
.map_err(context!("error adding watch for /run/citadel/realms/current to inotify"))?;