-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
systemd: Use systemd-sysusers to create cockpit-wsinstance user
Add a sysusers config file for our remaining system user. Arch was already using sysusers, replace the packaging specific one with the upstream one. For Debian, run dh_installsysusers (compat level 14 will do that automatically in the future). RPM 4.19 has native support for sysusers in principle [1], but it's not currently enabled/working [2]. Fedora rather wants packages to do an overcomplicated process which keeps a downstream copy of the sysusers file in the packaging dist-git [3], which is error prone and ugly to automate. So keep the tried-and-tested current approach of creating the user directly in the spec's `%pre` script for the time being (which is necessary anyway for CentOS/RHEL 9). [1] https://rpm-software-management.github.io/rpm/manual/users_and_groups.html [2] rpm-software-management/rpm#3073 [3] https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/#_dynamic_allocation
- Loading branch information
1 parent
4747086
commit 46fe9f5
Showing
8 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
u cockpit-wsinstance - "User for cockpit-ws instances" - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -402,6 +402,7 @@ authentication via sssd/FreeIPA. | |
%{_unitdir}/[email protected] | ||
%{_unitdir}/system-cockpithttps.slice | ||
%{_prefix}/%{__lib}/tmpfiles.d/cockpit-ws.conf | ||
%{_sysusersdir}/cockpit-wsinstance.conf | ||
%{pamdir}/pam_ssh_add.so | ||
%{pamdir}/pam_cockpit_cert.so | ||
%{_libexecdir}/cockpit-ws | ||
|
@@ -420,6 +421,8 @@ authentication via sssd/FreeIPA. | |
%ghost %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name} | ||
|
||
%pre ws | ||
# HACK: old RPM and even Fedora's current RPM don't properly support sysusers | ||
# https://github.com/rpm-software-management/rpm/issues/3073 | ||
getent group cockpit-wsinstance >/dev/null || groupadd -r cockpit-wsinstance | ||
getent passwd cockpit-wsinstance >/dev/null || useradd -r -g cockpit-wsinstance -d /nonexisting -s /sbin/nologin -c "User for cockpit-ws instances" cockpit-wsinstance | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters