From patchwork Thu Apr 30 11:08:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 11519851 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AD5E81 for ; Thu, 30 Apr 2020 11:08:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A4B220774 for ; Thu, 30 Apr 2020 11:08:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O8/5J+vc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726481AbgD3LIw (ORCPT ); Thu, 30 Apr 2020 07:08:52 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:52209 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725280AbgD3LIw (ORCPT ); Thu, 30 Apr 2020 07:08:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588244931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pKKkDEnws8iIIaTniLMP1CDG9TPu6nO/nJ42zNpRoV4=; b=O8/5J+vch3ntFbDs9jSeqyIj8bA8Kv04tQRdGFJlHBtfX6msnFZ2LWVlRxwzSr25hLjh70 tNm3zvSEEo2fkfBaosn++AV/Iecws9UEFUQR7y82RX+iZLcaXV8szDZZTXeKoU+fjEbbqc 2aI5Xu+Xm7dmEG1sIwj1lXV5q5sSSok= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-468-aTQ-2PByOjKZdUftbu0foQ-1; Thu, 30 Apr 2020 07:08:49 -0400 X-MC-Unique: aTQ-2PByOjKZdUftbu0foQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B9C30835B40 for ; Thu, 30 Apr 2020 11:08:48 +0000 (UTC) Received: from workstation.redhat.com (unknown [10.40.195.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id E99161001920; Thu, 30 Apr 2020 11:08:47 +0000 (UTC) From: Petr Lautrbach To: selinux@vger.kernel.org Cc: Petr Lautrbach Subject: [PATCH 1/2] restorecond: Rename restorecond-user.service to restorecond_user.service Date: Thu, 30 Apr 2020 13:08:34 +0200 Message-Id: <20200430110835.138643-1-plautrba@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Make user restorecond systemd service consistent with restorecond_user.conf file used by `restorecond -u` Signed-off-by: Petr Lautrbach --- 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 From patchwork Thu Apr 30 11:08:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 11519853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B997981 for ; Thu, 30 Apr 2020 11:08:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E92C20774 for ; Thu, 30 Apr 2020 11:08:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OhIL3w5j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726511AbgD3LIy (ORCPT ); Thu, 30 Apr 2020 07:08:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50440 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725280AbgD3LIy (ORCPT ); Thu, 30 Apr 2020 07:08:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588244933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KAObJN9z1K+j9lDUpqQHrmmHc+cXp4cnPTyO5W+ullk=; b=OhIL3w5jkqGs5gqXrgrdgDLhWzjIu0Htz+cNE7cnoJfkYUV0OSy/13UU6DdRZW1Ad5ZOTK oC+SI81P/O6Vzdq4N5XtDBTrcE14CdT9fAGSooqSGp+UiKRAPU2OXNOwKNyav8tSlwDDZG bmBskp+1ZxSjiMXqD9p5lsM4CKBfS1g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-JX0TytxWNxCpn3eVw5pUNQ-1; Thu, 30 Apr 2020 07:08:51 -0400 X-MC-Unique: JX0TytxWNxCpn3eVw5pUNQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 602BD100CD40; Thu, 30 Apr 2020 11:08:50 +0000 (UTC) Received: from workstation.redhat.com (unknown [10.40.195.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F9111001920; Thu, 30 Apr 2020 11:08:48 +0000 (UTC) From: Petr Lautrbach To: selinux@vger.kernel.org Cc: Petr Lautrbach , Laurent Bigonville Subject: [PATCH 2/2] restorecond: Use pkg-config to get locations for systemd units Date: Thu, 30 Apr 2020 13:08:35 +0200 Message-Id: <20200430110835.138643-2-plautrba@redhat.com> In-Reply-To: <20200430110835.138643-1-plautrba@redhat.com> References: <20200430110835.138643-1-plautrba@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org 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 Signed-off-by: Petr Lautrbach Acked-by: Nicolas Iooss --- 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