Having a result of 'loginctl show-user' ===== k_mikhail@linux-mk500:~> loginctl show-user k_mikhail UID=1000 GID=100 Name=k_mikhail Timestamp=Пнд 2015-01-05 02:44:08 EET TimestampMonotonic=55312165 RuntimePath=/run/user/1000 Service=user@1000.service Slice=user-1000.slice State=active IdleHint=no IdleSinceHint=0 IdleSinceHintMonotonic=0 Linger=no ===== but sometimes it's needed to know info about gropus that user belongs to. The traditional way is to use this schema: ===== k_mikhail@linux-mk500:~> cat /etc/group | grep k_mikhail vboxusers:x:481:k_mikhail wheel:x:10:k_mikhail users:x:100:k_mikhail k_mikhail@linux-mk500:~> ===== So, te idea is to add GroupsMember=GroupName1(GID1), GroupName2(GID2),...,GroupNameN(GIDN) in 'loginctl show-user': ===== k_mikhail@linux-mk500:~> loginctl show-user k_mikhail UID=1000 GID=100 Name=k_mikhail GroupsMember=vboxusers(481), wheel(10), users(1000) ===== or, if dislpaying of groupnames is insecure, show only UIDs: GroupsMember=481,10,1000
*show only GIDs: GroupsMember=481,10,1000
Or, as a variant: GroupsMember= echo $(id -nG && id -G)
Hmm, why to get the group memberships of a user "k_mihail" you can use "id k_minkhail" ont the command line. Why precsiely do you think loginctl should show this too, that wouldn't be covered with the simple "id" command?
Why precsiely do you think "systemctl status something" should show this too, that wouldn't be covered with the simple "service something status" in sysvinit? :P :) To be more serious: systemd, as a fact, often duplicates most habitual things, but with its own syntax. In that logic "loginctl show-user" makes the same to simple "id", "whoami" commands (speaking it more simply). So, as for me in role of an admin, if I use systemd command "loginctl", I'd like to have the possibility to view list of groups, which user belongs to without using anything else. This makes user-info _more complete_ and it's more convinient. I think you agree with me. Of course, I also have the alternative with "id" command. Or just like of using xinetd instead of some systemd functionality and so on.
The bits "systemctl show" or "loginctl show" currently show are something systemd actually makes use of, these are properties that are relevant to systemd's own logic. However, the supplementary group id list for running services is really nothing logind ever needed to know so far, it's nothing it will configure, and nothing it will query for its operation...
Simply speaking - feaure request is refused. OK.
So yeah, I am not convinced that logind should be an API for the user/group database. Sorry! Closing.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.