mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-22 05:59:58 +00:00
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:
parent
5d149b23de
commit
5fc701fe11
@ -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);
|
||||
|
@ -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/*
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user