selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Iooss <nicolas.iooss@m4x.org>
To: selinux@vger.kernel.org
Subject: [PATCH 1/1] restorecond: use /run instead of /var/run
Date: Mon, 18 Mar 2019 22:09:13 +0100	[thread overview]
Message-ID: <20190318210913.2392-1-nicolas.iooss@m4x.org> (raw)

On most distributions, /var/run is a symbolic link to /run so using
/var/run or /run lead to the same result. Nevertheless systemd started
to warn about using /var/run in a service file, logging entries such as:

    /usr/lib/systemd/system/restorecond.service:8: PIDFile= references
    path below legacy directory /var/run/, updating
    /var/run/restorecond.pid → /run/restorecond.pid; please update the
    unit file accordingly.

Switch to /run in order to follow this advice.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 restorecond/restorecond.c       | 4 ++--
 restorecond/restorecond.conf    | 2 +-
 restorecond/restorecond.init    | 2 +-
 restorecond/restorecond.service | 2 +-
 restorecond/utmpwatcher.c       | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/restorecond/restorecond.c b/restorecond/restorecond.c
index 7b984b298f79..d5f70fc2e2c1 100644
--- a/restorecond/restorecond.c
+++ b/restorecond/restorecond.c
@@ -84,7 +84,7 @@ static void done(void) {
 	selabel_close(r_opts.hnd);
 }
 
-static const char *pidfile = "/var/run/restorecond.pid";
+static const char *pidfile = "/run/restorecond.pid";
 
 static int write_pid_file(void)
 {
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
 	write_pid_file();
 
 	while (watch(master_fd, watch_file) == 0) {
-	};
+	}
 
 	watch_list_free(master_fd);
 	close(master_fd);
diff --git a/restorecond/restorecond.conf b/restorecond/restorecond.conf
index c64e74758d2f..1a61ece384d7 100644
--- a/restorecond/restorecond.conf
+++ b/restorecond/restorecond.conf
@@ -2,7 +2,7 @@
 /etc/resolv.conf
 /etc/samba/secrets.tdb
 /etc/updatedb.conf
-/var/run/utmp
+/run/utmp
 /var/log/wtmp
 /root/*
 /root/.ssh/*
diff --git a/restorecond/restorecond.init b/restorecond/restorecond.init
index 775c52b0ce7c..c1cbb247fa91 100644
--- a/restorecond/restorecond.init
+++ b/restorecond/restorecond.init
@@ -9,7 +9,7 @@
 #
 # processname: /usr/sbin/restorecond
 # config: /etc/selinux/restorecond.conf 
-# pidfile: /var/run/restorecond.pid
+# pidfile: /run/restorecond.pid
 #
 # Return values according to LSB for all commands but status:
 # 0 - success
diff --git a/restorecond/restorecond.service b/restorecond/restorecond.service
index 0511a1c740ac..6bce99d39735 100644
--- a/restorecond/restorecond.service
+++ b/restorecond/restorecond.service
@@ -6,7 +6,7 @@ ConditionSecurity=selinux
 [Service]
 Type=forking
 ExecStart=/usr/sbin/restorecond
-PIDFile=/var/run/restorecond.pid
+PIDFile=/run/restorecond.pid
 
 [Install]
 WantedBy=multi-user.target
diff --git a/restorecond/utmpwatcher.c b/restorecond/utmpwatcher.c
index 62ad2e98aff3..8660520370de 100644
--- a/restorecond/utmpwatcher.c
+++ b/restorecond/utmpwatcher.c
@@ -49,7 +49,7 @@ unsigned int utmpwatcher_handle(int inotify_fd, int wd)
 {
 	int changed = 0;
 	struct utmp u;
-	const char *utmp_path = "/var/run/utmp";
+	const char *utmp_path = "/run/utmp";
 	struct stringsList *prev_utmp_ptr = utmp_ptr;
 	if (wd != utmp_wd)
 		return -1;
-- 
2.20.1


             reply	other threads:[~2019-03-18 21:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 21:09 Nicolas Iooss [this message]
2019-03-21 11:40 ` [PATCH 1/1] restorecond: use /run instead of /var/run Petr Lautrbach
2019-03-21 12:08   ` Dominick Grift
2019-03-26 21:33     ` Nicolas Iooss
2019-03-27  7:56       ` Dominick Grift
2019-03-21 13:31   ` Laurent Bigonville
2019-03-26 21:22     ` Nicolas Iooss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190318210913.2392-1-nicolas.iooss@m4x.org \
    --to=nicolas.iooss@m4x.org \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).