mdadm/mdadm-3.0-mdmon-dev-.mdadm.patch

91 lines
2.7 KiB
Diff
Raw Normal View History

diff -up mdadm-3.0/mdmon.c~ mdadm-3.0/mdmon.c
--- mdadm-3.0/mdmon.c~ 2009-09-19 14:22:23.000000000 +0200
+++ mdadm-3.0/mdmon.c 2009-09-19 14:22:23.000000000 +0200
@@ -124,7 +124,7 @@ int make_pidfile(char *devname, int o_ex
if (sigterm)
return -1;
- sprintf(path, "/var/run/mdadm/%s.pid", devname);
+ sprintf(path, "/dev/.mdadm/%s.pid", devname);
fd = open(path, O_RDWR|O_CREAT|o_excl, 0600);
if (fd < 0)
@@ -157,7 +157,7 @@ static void try_kill_monitor(char *devna
pid_t pid;
struct mdstat_ent *mdstat;
- sprintf(buf, "/var/run/mdadm/%s.pid", devname);
+ sprintf(buf, "/dev/.mdadm/%s.pid", devname);
fd = open(buf, O_RDONLY);
if (fd < 0)
return;
@@ -207,9 +207,9 @@ void remove_pidfile(char *devname)
if (sigterm)
return;
- sprintf(buf, "/var/run/mdadm/%s.pid", devname);
+ sprintf(buf, "/dev/.mdadm/%s.pid", devname);
unlink(buf);
- sprintf(buf, "/var/run/mdadm/%s.sock", devname);
+ sprintf(buf, "/dev/.mdadm/%s.sock", devname);
unlink(buf);
}
@@ -223,7 +223,7 @@ int make_control_sock(char *devname)
if (sigterm)
return -1;
- sprintf(path, "/var/run/mdadm/%s.sock", devname);
+ sprintf(path, "/dev/.mdadm/%s.sock", devname);
unlink(path);
sfd = socket(PF_LOCAL, SOCK_STREAM, 0);
if (sfd < 0)
@@ -478,11 +478,10 @@ int mdmon(char *devname, int devnum, int
}
/* If this fails, we hope it already exists
- * pid file lives in /var/run/mdadm/mdXX.pid
+ * pid file lives in /dev/.mdadm/mdXX.pid
*/
- mkdir("/var", 0600);
- mkdir("/var/run", 0600);
- mkdir("/var/run/mdadm", 0600);
+ mkdir("/dev", 0700);
+ mkdir("/dev/.mdadm", 0700);
ignore = chdir("/");
if (make_pidfile(container->devname, O_EXCL) < 0) {
if (ping_monitor(container->devname) == 0) {
diff -up mdadm-3.0/msg.c~ mdadm-3.0/msg.c
--- mdadm-3.0/msg.c~ 2009-09-11 08:10:24.000000000 +0200
+++ mdadm-3.0/msg.c 2009-09-19 15:31:27.000000000 +0200
@@ -147,7 +147,7 @@ int connect_monitor(char *devname)
int pos;
char *c;
- pos = sprintf(path, "/var/run/mdadm/");
+ pos = sprintf(path, "/dev/.mdadm/");
if (is_subarray(devname)) {
devname++;
c = strchr(devname, '/');
diff -up mdadm-3.0/util.c~ mdadm-3.0/util.c
--- mdadm-3.0/util.c~ 2009-09-19 14:22:23.000000000 +0200
+++ mdadm-3.0/util.c 2009-09-19 15:32:22.000000000 +0200
@@ -1206,7 +1206,7 @@ int mdmon_running(int devnum)
char pid[10];
int fd;
int n;
- sprintf(path, "/var/run/mdadm/%s.pid", devnum2devname(devnum));
+ sprintf(path, "/dev/.mdadm/%s.pid", devnum2devname(devnum));
fd = open(path, O_RDONLY, 0);
if (fd < 0)
@@ -1226,7 +1226,7 @@ int signal_mdmon(int devnum)
char pid[10];
int fd;
int n;
- sprintf(path, "/var/run/mdadm/%s.pid", devnum2devname(devnum));
+ sprintf(path, "/dev/.mdadm/%s.pid", devnum2devname(devnum));
fd = open(path, O_RDONLY, 0);
if (fd < 0)