-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
users: Support for watching lastlog2 and wtpmdb on overview page #20472
Conversation
The subject of the commit should be more specific and talk about lastlog2, "users: Support for watching lastlog2 on overview page". |
3b65169
to
d367f22
Compare
opensuse tests fail to build their rpm:
The |
yes, we do not have the tox macro. A fix will be submitted upstream soon |
Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I found some more little things... Mostly I think we don't want to use export { ...}
.
pkg/users/account-details.js
Outdated
cockpit.spawn(["test", "-e", "/var/run/utmp"], { err: "ignore" }).then(() => { | ||
setLastlogPath("/var/run/utmp"); | ||
getLastlogPath().then((path) => { | ||
setLastlogPath(path); | ||
}).catch(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to catch errors here since getLastLogPath is not expected to throw an exception. And this could also be async
... :-) useEffect(async () => setLastLogPath(await getLastLogPath()), [])
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, apart from the async useEffect issue.
Hi! I'm having issues seeing the inotify event of Credit goes to @SludgeGirl for figuring this out! |
Yeah, I think there is no way aroung getting our integration tests to run on OpenSUSE. Right now I am happy to merge things that don't break the rest of our platforms, but whether the new code actually works as expected on OpenSUSE... the tests would help a lot to gain confidence in that. So let's prioritize getting them running, I'd say. |
c68bb69
to
dd11f07
Compare
36c1421
to
059a8d3
Compare
export async function getUtmpPath() { | ||
try { | ||
await cockpit.spawn(["test", "-e", "/var/run/utmp"], { err: "ignore" }); | ||
return "/var/run/utmp"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related, with the new systemd rc we now have a race condition with watching utmp so I want to change it to use logind's dbus API and listen to the relevant signals. (This does not have to block this PR but might help)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would like to get this included in the next release. If the changes for logind can be merged before than i think we can close this pr infavor of the logind pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
LastLogPath = "lastlog2"; | ||
} catch (err1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 added lines are not executed by any test.
} catch (err1) { | ||
try { | ||
await cockpit.spawn(["test", "-e", "/var/lib/wtmpdb/wtmp.db"], { err: "ignore" }); | ||
return "/var/lib/wtmpdb/wtmp.db"; | ||
} catch (err2) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 6 added lines are not executed by any test.
Thanks! |
This follows up on the lastlog2 pr's to implement support for lastlog2. Lastlog2 slightly differs in behaviour from lastlog. Lastlog2 only prints user's who have already had entries in the lastlog2 database. Not having an entry is already treated as never logged in which matches the current behaviour