Skip to content

Commit

Permalink
Move all binaries from /usr/sbin to /usr/bin
Browse files Browse the repository at this point in the history
In practice only qubesdb-daemon remained in /usr/sbin.
Since Fedora 42 merged those two, it ends up in /usr/bin anyway, and
since its harmless on other distros, move it everywhere. This simplifies
for example systemd unit handling (which otherwise would sometimes need
/usr/bin and sometimes /usr/sbin path).

But keep /usr/sbin/qubesdb-daemon compatibility symlink in RPM distros
that don't merge sbin with bin yet. This especially applies to F41-based
dom0, where qubesd referrs to /usr/sbin/qubesdb-daemon.

QubesOS/qubes-issues#9807
  • Loading branch information
marmarek committed Mar 1, 2025
1 parent 4474065 commit 4b09725
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions daemon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ LIBS += -L$(QUBES_LIBS) -lvchan
endif
CFLAGS += -DBACKEND_VMM_$(BACKEND_VMM)

SBINDIR ?= /usr/sbin
BINDIR ?= /usr/bin

all: qubesdb-daemon$(EXEEXT)

install:
install -d $(DESTDIR)$(SBINDIR)
install qubesdb-daemon$(EXEEXT) $(DESTDIR)$(SBINDIR)/
install -d $(DESTDIR)$(BINDIR)
install qubesdb-daemon$(EXEEXT) $(DESTDIR)$(BINDIR)/

qubesdb-daemon$(EXEEXT): db-cmds.o db-daemon.o db-core.o buffer.o
$(CC) $(LDFLAGS) -o $@ $^ $(APPEND_LDFLAGS) $(LIBS)
Expand Down
2 changes: 1 addition & 1 deletion daemon/qubes-db-dom0.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=systemd-tmpfiles-setup.service

[Service]
# Both agent and daemon for dom0
ExecStart=/usr/sbin/qubesdb-daemon 0 dom0
ExecStart=/usr/bin/qubesdb-daemon 0 dom0
Type=notify
StandardOutput=syslog

Expand Down
2 changes: 1 addition & 1 deletion daemon/qubes-db.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DefaultDependencies=no

[Service]
# Remote Dom ID as an argument
ExecStart=/usr/sbin/qubesdb-daemon 0
ExecStart=/usr/bin/qubesdb-daemon 0
Type=notify
Group=qubes

Expand Down
2 changes: 1 addition & 1 deletion debian/qubesdb.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ usr/bin/qubesdb-rm
usr/bin/qubesdb-multiread
usr/bin/qubesdb-list
usr/bin/qubesdb-watch
usr/sbin/qubesdb-daemon
usr/bin/qubesdb-daemon
6 changes: 6 additions & 0 deletions rpm_spec/qubes-db.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ make install \
LIBDIR=%{_libdir} \
BINDIR=%{_bindir} \
SBINDIR=%{_sbindir}
%if "%{_sbindir}" != "%{_bindir}"
ln -s ../bin/qubesdb-daemon %{_sbindir}/qubesdb-daemon
%endif

%files
%doc
Expand All @@ -89,7 +92,10 @@ make install \
%{_bindir}/qubesdb-multiread
%{_bindir}/qubesdb-list
%{_bindir}/qubesdb-watch
%{_bindir}/qubesdb-daemon
%if "%{_sbindir}" != "%{_bindir}"
%{_sbindir}/qubesdb-daemon
%endif

%files libs
%{_libdir}/libqubesdb.so
Expand Down
1 change: 0 additions & 1 deletion selinux/qubes-core-qubesdb.fc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/usr/sbin/qubesdb-daemon -- gen_context(system_u:object_r:qubes_qubesdb_daemon_exec_t,s0)
/usr/bin/qubesdb-daemon -- gen_context(system_u:object_r:qubes_qubesdb_daemon_exec_t,s0)
/run/qubes/qubesdb\.sock -s gen_context(system_u:object_r:qubes_qubesdb_socket_t,s0)
/var/run/qubes/qubesdb\.sock -s gen_context(system_u:object_r:qubes_qubesdb_socket_t,s0)

0 comments on commit 4b09725

Please sign in to comment.