Skip to content

Commit

Permalink
restorecond: use /run instead of /var/run
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fishilico committed Mar 18, 2019
1 parent 5d149b2 commit 5fc701f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions restorecond/restorecond.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion restorecond/restorecond.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
2 changes: 1 addition & 1 deletion restorecond/restorecond.init
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion restorecond/restorecond.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion restorecond/utmpwatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5fc701f

Please sign in to comment.