selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] restorecond: Rename restorecond-user.service to restorecond_user.service
@ 2020-04-30 11:08 Petr Lautrbach
  2020-04-30 11:08 ` [PATCH 2/2] restorecond: Use pkg-config to get locations for systemd units Petr Lautrbach
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Lautrbach @ 2020-04-30 11:08 UTC (permalink / raw)
  To: selinux; +Cc: Petr Lautrbach

Make user restorecond systemd service consistent with restorecond_user.conf file
used by `restorecond -u`

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 restorecond/Makefile                                            | 2 +-
 restorecond/org.selinux.Restorecond.service                     | 2 +-
 .../{restorecond-user.service => restorecond_user.service}      | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename restorecond/{restorecond-user.service => restorecond_user.service} (100%)

diff --git a/restorecond/Makefile b/restorecond/Makefile
index 501f89dfca57..4de9642b0f6a 100644
--- a/restorecond/Makefile
+++ b/restorecond/Makefile
@@ -51,7 +51,7 @@ install: all
 	-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/
+	install -m 644 restorecond_user.service $(DESTDIR)$(SYSTEMDDIR)/user/
 relabel: install
 	/sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond 
 
diff --git a/restorecond/org.selinux.Restorecond.service b/restorecond/org.selinux.Restorecond.service
index 55989a9cbbd0..45aeb7aac806 100644
--- a/restorecond/org.selinux.Restorecond.service
+++ b/restorecond/org.selinux.Restorecond.service
@@ -1,4 +1,4 @@
 [D-BUS Service]
 Name=org.selinux.Restorecond
 Exec=/usr/sbin/restorecond -u
-SystemdService=restorecond-user.service
+SystemdService=restorecond_user.service
diff --git a/restorecond/restorecond-user.service b/restorecond/restorecond_user.service
similarity index 100%
rename from restorecond/restorecond-user.service
rename to restorecond/restorecond_user.service
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] restorecond: Use pkg-config to get locations for systemd units
  2020-04-30 11:08 [PATCH 1/2] restorecond: Rename restorecond-user.service to restorecond_user.service Petr Lautrbach
@ 2020-04-30 11:08 ` Petr Lautrbach
  2020-05-01  7:45   ` Nicolas Iooss
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Lautrbach @ 2020-04-30 11:08 UTC (permalink / raw)
  To: selinux; +Cc: Petr Lautrbach, Laurent Bigonville

The user systemd service file could be installed in an other location than the
system ones. In debian for example, the system files are installed
/lib/systemd/system and the user ones in /usr/lib/systemd/user.

Suggested-by: Laurent Bigonville <bigon@bigon.be>
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 restorecond/Makefile | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/restorecond/Makefile b/restorecond/Makefile
index 4de9642b0f6a..8e9a5ef1cfa1 100644
--- a/restorecond/Makefile
+++ b/restorecond/Makefile
@@ -7,7 +7,8 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 AUTOSTARTDIR = /etc/xdg/autostart
 DBUSSERVICEDIR = $(PREFIX)/share/dbus-1/services
-SYSTEMDDIR ?= $(PREFIX)/lib/systemd
+SYSTEMDSYSTEMUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd)
+SYSTEMDUSERUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemduserunitdir systemd)
 
 autostart_DATA = sealertauto.desktop
 INITDIR ?= /etc/rc.d/init.d
@@ -48,10 +49,10 @@ install: all
 	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/
+	-mkdir -p $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
+	install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
+	-mkdir -p $(DESTDIR)$(SYSTEMDUSERUNITDIR)
+	install -m 644 restorecond_user.service $(DESTDIR)$(SYSTEMDUSERUNITDIR)
 relabel: install
 	/sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond 
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] restorecond: Use pkg-config to get locations for systemd units
  2020-04-30 11:08 ` [PATCH 2/2] restorecond: Use pkg-config to get locations for systemd units Petr Lautrbach
@ 2020-05-01  7:45   ` Nicolas Iooss
  2020-05-04  8:46     ` Petr Lautrbach
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Iooss @ 2020-05-01  7:45 UTC (permalink / raw)
  To: Petr Lautrbach, Laurent Bigonville; +Cc: SElinux list

On Thu, Apr 30, 2020 at 1:08 PM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> The user systemd service file could be installed in an other location than the
> system ones. In debian for example, the system files are installed
> /lib/systemd/system and the user ones in /usr/lib/systemd/user.
>
> Suggested-by: Laurent Bigonville <bigon@bigon.be>
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

I confirm the pkg-config commands work on Arch Linux too. By the way,
on Debian this patch makes building restorecond now require systemd to
be installed (because /usr/share/pkgconfig/systemd.pc is provided by
package "systemd"), but I guess this shouldn't be an issue.

For both patches:

Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

You can merge them when you want, or I will do so on Monday.
Thanks,
Nicolas

> ---
>  restorecond/Makefile | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/restorecond/Makefile b/restorecond/Makefile
> index 4de9642b0f6a..8e9a5ef1cfa1 100644
> --- a/restorecond/Makefile
> +++ b/restorecond/Makefile
> @@ -7,7 +7,8 @@ SBINDIR ?= $(PREFIX)/sbin
>  MANDIR = $(PREFIX)/share/man
>  AUTOSTARTDIR = /etc/xdg/autostart
>  DBUSSERVICEDIR = $(PREFIX)/share/dbus-1/services
> -SYSTEMDDIR ?= $(PREFIX)/lib/systemd
> +SYSTEMDSYSTEMUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd)
> +SYSTEMDUSERUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemduserunitdir systemd)
>
>  autostart_DATA = sealertauto.desktop
>  INITDIR ?= /etc/rc.d/init.d
> @@ -48,10 +49,10 @@ install: all
>         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/
> +       -mkdir -p $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
> +       install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
> +       -mkdir -p $(DESTDIR)$(SYSTEMDUSERUNITDIR)
> +       install -m 644 restorecond_user.service $(DESTDIR)$(SYSTEMDUSERUNITDIR)
>  relabel: install
>         /sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond
>
> --
> 2.26.2
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] restorecond: Use pkg-config to get locations for systemd units
  2020-05-01  7:45   ` Nicolas Iooss
@ 2020-05-04  8:46     ` Petr Lautrbach
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Lautrbach @ 2020-05-04  8:46 UTC (permalink / raw)
  To: SElinux list; +Cc: Laurent Bigonville, Nicolas Iooss

[-- Attachment #1: Type: text/plain, Size: 2839 bytes --]

On Fri, May 01, 2020 at 09:45:03AM +0200, Nicolas Iooss wrote:
> On Thu, Apr 30, 2020 at 1:08 PM Petr Lautrbach <plautrba@redhat.com> wrote:
> >
> > The user systemd service file could be installed in an other location than the
> > system ones. In debian for example, the system files are installed
> > /lib/systemd/system and the user ones in /usr/lib/systemd/user.
> >
> > Suggested-by: Laurent Bigonville <bigon@bigon.be>
> > Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
> 
> I confirm the pkg-config commands work on Arch Linux too. By the way,
> on Debian this patch makes building restorecond now require systemd to
> be installed (because /usr/share/pkgconfig/systemd.pc is provided by
> package "systemd"), but I guess this shouldn't be an issue.
> 
> For both patches:
> 
> Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>
> 
> You can merge them when you want, or I will do so on Monday.
> Thanks,
> Nicolas

Thanks.

Both applied. 


> 
> > ---
> >  restorecond/Makefile | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/restorecond/Makefile b/restorecond/Makefile
> > index 4de9642b0f6a..8e9a5ef1cfa1 100644
> > --- a/restorecond/Makefile
> > +++ b/restorecond/Makefile
> > @@ -7,7 +7,8 @@ SBINDIR ?= $(PREFIX)/sbin
> >  MANDIR = $(PREFIX)/share/man
> >  AUTOSTARTDIR = /etc/xdg/autostart
> >  DBUSSERVICEDIR = $(PREFIX)/share/dbus-1/services
> > -SYSTEMDDIR ?= $(PREFIX)/lib/systemd
> > +SYSTEMDSYSTEMUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd)
> > +SYSTEMDUSERUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemduserunitdir systemd)
> >
> >  autostart_DATA = sealertauto.desktop
> >  INITDIR ?= /etc/rc.d/init.d
> > @@ -48,10 +49,10 @@ install: all
> >         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/
> > +       -mkdir -p $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
> > +       install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
> > +       -mkdir -p $(DESTDIR)$(SYSTEMDUSERUNITDIR)
> > +       install -m 644 restorecond_user.service $(DESTDIR)$(SYSTEMDUSERUNITDIR)
> >  relabel: install
> >         /sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond
> >
> > --
> > 2.26.2
> >
> 

-- 
()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-04  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 11:08 [PATCH 1/2] restorecond: Rename restorecond-user.service to restorecond_user.service Petr Lautrbach
2020-04-30 11:08 ` [PATCH 2/2] restorecond: Use pkg-config to get locations for systemd units Petr Lautrbach
2020-05-01  7:45   ` Nicolas Iooss
2020-05-04  8:46     ` Petr Lautrbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).