diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-09-15 20:58:43 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-09-15 20:58:43 -0700 |
commit | 295646b3d59c7d8d8c389ff320b30e61552ba331 (patch) | |
tree | 150b20b04a0c112123e35cbca62e40ac7d525918 /managemon.c | |
parent | 313a4a82f130e6668ba0f4550200662e168aa945 (diff) | |
download | mdadm-295646b3d59c7d8d8c389ff320b30e61552ba331.tar.gz |
mdmon: recreate socket/pid file on SIGHUP
Allow mdmon to start while /var/run/mdadm is readonly. Later a SIGHUP
can trigger mdmon to drop its pid and socket once /var/run/mdadm is
writable. Of course one needs the pid to send a HUP, that can be stored
in a distribution specific rw-init directory... For now, rely on a
killall -HUP mdmon to get the files dumped.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'managemon.c')
-rw-r--r-- | managemon.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/managemon.c b/managemon.c index fc5da71..779cb23 100644 --- a/managemon.c +++ b/managemon.c @@ -605,6 +605,7 @@ void do_manager(struct supertype *container) sigprocmask(SIG_UNBLOCK, NULL, &set); sigdelset(&set, SIGUSR1); + sigdelset(&set, SIGHUP); do { @@ -622,6 +623,13 @@ void do_manager(struct supertype *container) read_sock(container); + if (socket_hup_requested) { + close(container->sock); + container->sock = make_control_sock(container->devname); + make_pidfile(container->devname, 0); + socket_hup_requested = 0; + } + free_mdstat(mdstat); } remove_old(); |