restorecond: use /run instead of /var/run

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>
This commit is contained in:
Nicolas Iooss 2019-02-26 20:02:07 +01:00
parent 5d149b23de
commit 5fc701fe11
No known key found for this signature in database
GPG key ID: C191415F340DAAA0
5 changed files with 6 additions and 6 deletions

View file

@ -84,7 +84,7 @@ static void done(void) {
selabel_close(r_opts.hnd); 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) static int write_pid_file(void)
{ {
@ -217,7 +217,7 @@ int main(int argc, char **argv)
write_pid_file(); write_pid_file();
while (watch(master_fd, watch_file) == 0) { while (watch(master_fd, watch_file) == 0) {
}; }
watch_list_free(master_fd); watch_list_free(master_fd);
close(master_fd); close(master_fd);

View file

@ -2,7 +2,7 @@
/etc/resolv.conf /etc/resolv.conf
/etc/samba/secrets.tdb /etc/samba/secrets.tdb
/etc/updatedb.conf /etc/updatedb.conf
/var/run/utmp /run/utmp
/var/log/wtmp /var/log/wtmp
/root/* /root/*
/root/.ssh/* /root/.ssh/*

View file

@ -9,7 +9,7 @@
# #
# processname: /usr/sbin/restorecond # processname: /usr/sbin/restorecond
# config: /etc/selinux/restorecond.conf # config: /etc/selinux/restorecond.conf
# pidfile: /var/run/restorecond.pid # pidfile: /run/restorecond.pid
# #
# Return values according to LSB for all commands but status: # Return values according to LSB for all commands but status:
# 0 - success # 0 - success

View file

@ -6,7 +6,7 @@ ConditionSecurity=selinux
[Service] [Service]
Type=forking Type=forking
ExecStart=/usr/sbin/restorecond ExecStart=/usr/sbin/restorecond
PIDFile=/var/run/restorecond.pid PIDFile=/run/restorecond.pid
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -49,7 +49,7 @@ unsigned int utmpwatcher_handle(int inotify_fd, int wd)
{ {
int changed = 0; int changed = 0;
struct utmp u; struct utmp u;
const char *utmp_path = "/var/run/utmp"; const char *utmp_path = "/run/utmp";
struct stringsList *prev_utmp_ptr = utmp_ptr; struct stringsList *prev_utmp_ptr = utmp_ptr;
if (wd != utmp_wd) if (wd != utmp_wd)
return -1; return -1;