diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-10-02 03:50:43 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-10-15 23:15:52 +0200 |
commit | 695154b2e7f975527f8f3f9591f0a21474bfe1b1 (patch) | |
tree | 98a16315f08174369ce8038bc1948a68ae2e60a9 /mdmon.c | |
parent | sysfs_open leaks devnum2devname() result (diff) | |
download | mdadm-695154b2e7f975527f8f3f9591f0a21474bfe1b1.tar.xz mdadm-695154b2e7f975527f8f3f9591f0a21474bfe1b1.zip |
mdmon: periodically retry to create the socket
If initial socket creation fails, EROFS, set a periodic alarm to wake up
the manager and retry. Include a kernel patch that will wake us up if
the mount flags are changed.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to '')
-rw-r--r-- | mdmon.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -282,8 +282,6 @@ int main(int argc, char *argv[]) } container->sock = make_control_sock(container->devname); - if (container->sock < 0) - fprintf(stderr, "mdmon: Cannot create socket in /var/run/mdadm\n"); container->arrays = NULL; mdi = sysfs_read(mdfd, container->devnum, @@ -356,10 +354,12 @@ int main(int argc, char *argv[]) sigemptyset(&set); sigaddset(&set, SIGUSR1); sigaddset(&set, SIGHUP); + sigaddset(&set, SIGALRM); sigprocmask(SIG_BLOCK, &set, NULL); act.sa_handler = wake_me; act.sa_flags = 0; sigaction(SIGUSR1, &act, NULL); + sigaction(SIGALRM, &act, NULL); act.sa_handler = hup; sigaction(SIGHUP, &act, NULL); act.sa_handler = SIG_IGN; |