mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Remove dmeventd fifos on exit if they are not managed by systemd.
This commit is contained in:
parent
6584221843
commit
d7bcb6e117
@ -1,5 +1,6 @@
|
||||
Version 1.02.75 -
|
||||
================================
|
||||
Remove dmeventd fifos on exit if they are not managed by systemd.
|
||||
Use SD_ACTIVATION env. var. in systemd units to better detect systemd in use.
|
||||
Do not run a new dmeventd instance on restart if there's no existing one.
|
||||
Make the time window for reading fifo longer 5sec (1.02.73).
|
||||
|
@ -1741,10 +1741,18 @@ out:
|
||||
}
|
||||
#endif
|
||||
|
||||
static void remove_lockfile(void)
|
||||
static void _remove_files_on_exit(void)
|
||||
{
|
||||
if (unlink(DMEVENTD_PIDFILE))
|
||||
perror(DMEVENTD_PIDFILE ": unlink failed");
|
||||
|
||||
if (!_systemd_activation) {
|
||||
if (unlink(DM_EVENT_FIFO_CLIENT))
|
||||
perror(DM_EVENT_FIFO_CLIENT " : unlink failed");
|
||||
|
||||
if (unlink(DM_EVENT_FIFO_SERVER))
|
||||
perror(DM_EVENT_FIFO_SERVER " : unlink failed");
|
||||
}
|
||||
}
|
||||
|
||||
static void _daemonize(void)
|
||||
@ -1955,10 +1963,11 @@ int main(int argc, char *argv[])
|
||||
if (dm_create_lockfile(DMEVENTD_PIDFILE) == 0)
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
atexit(remove_lockfile);
|
||||
atexit(_remove_files_on_exit);
|
||||
(void) dm_prepare_selinux_context(NULL, 0);
|
||||
|
||||
/* Set the rest of the signals to cause '_exit_now' to be set */
|
||||
signal(SIGTERM, &_exit_handler);
|
||||
signal(SIGINT, &_exit_handler);
|
||||
signal(SIGHUP, &_exit_handler);
|
||||
signal(SIGQUIT, &_exit_handler);
|
||||
|
Loading…
Reference in New Issue
Block a user