Skip to content

Commit

Permalink
FIXUP: Use tmpfiles.d everywhere to set up cockpit-session
Browse files Browse the repository at this point in the history
This upstreams the Arch approach, and provides a sensible setup with an
upstream `make install`.
  • Loading branch information
martinpitt committed May 3, 2024
1 parent 81cbd0e commit 90b968f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions src/systemd/tmpfiles.d/cockpit-ws.conf.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
z @libexecdir@/cockpit-session - - cockpit-wsinstance -
C /run/cockpit/inactive.motd 0640 root @admin_group@ - @datadir@/@PACKAGE@/motd/inactive.motd
f /run/cockpit/active.motd 0640 root @admin_group@ -
L+ /run/cockpit/motd - - - - inactive.motd
2 changes: 0 additions & 2 deletions tools/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ package_cockpit() {
rm -rf "$pkgdir"/usr/{src,lib/firewalld}
install -Dm644 "$srcdir"/cockpit.pam "$pkgdir"/etc/pam.d/cockpit

echo "z /usr/lib/cockpit/cockpit-session - - cockpit-wsinstance -" >> "$pkgdir"/usr/lib/tmpfiles.d/cockpit-ws.conf

# remove unused plugins
rm -rf "$pkgdir"/usr/share/cockpit/{selinux,playground,sosreport} \
"$pkgdir"/usr/share/metainfo/org.cockpit-project.cockpit-{selinux,sosreport}.metainfo.xml
Expand Down
5 changes: 0 additions & 5 deletions tools/cockpit.spec
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,6 @@ 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

if %{_sbindir}/selinuxenabled 2>/dev/null; then
%selinux_relabel_pre -s %{selinuxtype}
fi
Expand Down

0 comments on commit 90b968f

Please sign in to comment.