mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-18 11:20:44 +00:00
d19f990188
When running restorecond in user sessions using D-Bus activation, restorecond's process is spawned in the CGroup of the D-Bus daemon: $ systemctl --user status [...] CGroup: /user.slice/user-1000.slice/user@1000.service ├─init.scope │ ├─1206 /usr/lib/systemd/systemd --user │ └─1208 (sd-pam) └─dbus.service ├─1628 /usr/bin/dbus-daemon --session --address=systemd: └─4570 /usr/sbin/restorecond -u In order to separate it, introduce a systemd unit for restorecond-started-as-user. After this patch: CGroup: /user.slice/user-1000.slice/user@1000.service ├─restorecond-user.service │ └─2871 /usr/sbin/restorecond -u ├─init.scope │ ├─481 /usr/lib/systemd/systemd --user │ └─485 (sd-pam) └─dbus.service └─2868 /usr/bin/dbus-daemon --session --address=systemd: Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
65 lines
2.1 KiB
Makefile
65 lines
2.1 KiB
Makefile
PKG_CONFIG ?= pkg-config
|
|
|
|
# Installation directories.
|
|
LINGUAS ?= ru
|
|
PREFIX ?= /usr
|
|
SBINDIR ?= $(PREFIX)/sbin
|
|
MANDIR = $(PREFIX)/share/man
|
|
AUTOSTARTDIR = /etc/xdg/autostart
|
|
DBUSSERVICEDIR = $(PREFIX)/share/dbus-1/services
|
|
SYSTEMDDIR ?= $(PREFIX)/lib/systemd
|
|
|
|
autostart_DATA = sealertauto.desktop
|
|
INITDIR ?= /etc/rc.d/init.d
|
|
SELINUXDIR = /etc/selinux
|
|
|
|
GIO_CFLAGS = -DHAVE_DBUS $(shell $(PKG_CONFIG) --cflags gio-2.0)
|
|
GIO_LIBS = $(shell $(PKG_CONFIG) --libs gio-2.0)
|
|
|
|
CFLAGS ?= -g -Werror -Wall -W
|
|
override CFLAGS += $(GIO_CFLAGS)
|
|
|
|
override LDLIBS += -lselinux $(GIO_LIBS)
|
|
|
|
all: restorecond
|
|
|
|
restorecond.o utmpwatcher.o stringslist.o user.o watch.o: restorecond.h
|
|
|
|
restorecond: restore.o restorecond.o utmpwatcher.o stringslist.o user.o watch.o
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
|
|
|
install: all
|
|
[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8
|
|
-mkdir -p $(DESTDIR)$(SBINDIR)
|
|
install -m 755 restorecond $(DESTDIR)$(SBINDIR)
|
|
install -m 644 restorecond.8 $(DESTDIR)$(MANDIR)/man8
|
|
for lang in $(LINGUAS) ; do \
|
|
if [ -e $${lang} ] ; then \
|
|
[ -d $(DESTDIR)$(MANDIR)/$${lang}/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/$${lang}/man8 ; \
|
|
install -m 644 $${lang}/*.8 $(DESTDIR)$(MANDIR)/$${lang}/man8/ ; \
|
|
fi ; \
|
|
done
|
|
-mkdir -p $(DESTDIR)$(INITDIR)
|
|
install -m 755 restorecond.init $(DESTDIR)$(INITDIR)/restorecond
|
|
-mkdir -p $(DESTDIR)$(SELINUXDIR)
|
|
install -m 644 restorecond.conf $(DESTDIR)$(SELINUXDIR)/restorecond.conf
|
|
install -m 644 restorecond_user.conf $(DESTDIR)$(SELINUXDIR)/restorecond_user.conf
|
|
-mkdir -p $(DESTDIR)$(AUTOSTARTDIR)
|
|
install -m 644 restorecond.desktop $(DESTDIR)$(AUTOSTARTDIR)/restorecond.desktop
|
|
-mkdir -p $(DESTDIR)$(DBUSSERVICEDIR)
|
|
install -m 644 org.selinux.Restorecond.service $(DESTDIR)$(DBUSSERVICEDIR)/org.selinux.Restorecond.service
|
|
-mkdir -p $(DESTDIR)$(SYSTEMDDIR)/system
|
|
install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDDIR)/system/
|
|
-mkdir -p $(DESTDIR)$(SYSTEMDDIR)/user
|
|
install -m 644 restorecond-user.service $(DESTDIR)$(SYSTEMDDIR)/user/
|
|
relabel: install
|
|
/sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond
|
|
|
|
clean:
|
|
-rm -f restorecond *.o *~
|
|
|
|
indent:
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
|
|
|
test:
|