On Do, 18.04.19 08:01, Tom (remyabel@xxxxxxxxx) wrote: > Hi all, > > I'm trying to create a simple timer that will wake up the system from > suspend and run an operation with systemd-inhibit. > > Contents of test.service: > > [Unit] > Description=Test > > [Service] > Type=oneshot > ExecStart=/bin/systemd-inhibit /bin/su user -c "echo 'Test' > > $HOME/asdf" > > Contents of test.timer: > > [Unit] > Description=Test > > [Timer] > Unit=test.service > OnCalendar=minutely > WakeSystem=true > > [Install] > WantedBy=multi-user.target > > It successfully wakes up the system but spits out the error in the > title. I have no problem running the script or systemd-inhibit > manually, but when putting it in the unit combined with systemd-inhibit > I get that error. Am I missing some basic usage? > > systemd version is systemd-239-12.git8bca462 on Fedora 29. There#s a race here: while we are executing an operation you want to inhibit we refuse installing an inhibitor for it (which makes semantical sense: you want the guarantee that you aren't interrupted by the operation doing something, but if it's already going on then of it's too late. The issue here really is that suspending is a slow operation, that might take a while, without it's preparations and the follow-up logic that is run. Which means if you are called at the very moment we return from suspend then it's very likely the operation is still ongoing. I figure we should teach "systemd-inhibit" a way so that it can wait until any pending operation is complete before attempting to acquire the inhibitor. Could you please file an RFE issue on github about that? Lennart -- Lennart Poettering, Berlin _______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel