for (w=dl_next(line); w != line ; w=dl_next(w)) {
if (strcasecmp(w, "<ignore>")==0)
require_homehost = 0;
- else if (home_host == NULL)
- home_host = strdup(w);
- else
+ else if (home_host == NULL) {
+ if (strcasecmp(w, "<none>")==0)
+ home_host = strdup("");
+ else
+ home_host = strdup(w);
+ }else
fprintf(stderr, Name ": excess host name on HOMEHOST line: %s - ignored\n",
w);
}
if (homehost == NULL)
homehost = conf_get_homehost(&require_homehost);
- if (homehost == NULL || strcmp(homehost, "<system>")==0) {
+ if (homehost == NULL || strcasecmp(homehost, "<system>")==0) {
if (gethostname(sys_hostname, sizeof(sys_hostname)) == 0) {
sys_hostname[sizeof(sys_hostname)-1] = 0;
homehost = sys_hostname;
}
}
+ if (homehost && (!homehost[0] || strcasecmp(homehost, "<none>") == 0)) {
+ homehost = NULL;
+ require_homehost = 0;
+ }
if ((mode != MISC || devmode != 'E') &&
geteuid() != 0) {
.B \-\-homehost=
option to mdadm. There should normally be only one other word on the line.
It should either be a host name, or one of the special words
-.B <system>
+.BR <system>,
+.B <none>
and
.BR <ignore> .
If
.B <system>
is given, then the
.BR gethostname ( 2 )
-systemcall is used to get the host name.
+systemcall is used to get the host name. This is the default.
If
.B <ignore>
.B HOMEHOST
line.
+If
+.B <none>
+is given, then the default of using
+.BR gethostname ( 2 )
+is over-ridden and no homehost name is assumed.
+
When arrays are created, this host name will be stored in the
metadata. When arrays are assembled using auto-assembly, arrays which
do not record the correct homehost name in their metadata will be
sb->state &= ~(1<<MD_SB_CLEAN);
sb->recovery_cp = 0;
} else if (strcmp(update, "homehost") == 0 &&
- homehost) {
+ homehost) {
uuid_set = 0;
update = "uuid";
info->uuid[0] = sb->set_uuid0;
} else if (strcmp(update, "no-bitmap") == 0) {
sb->feature_map &= ~__cpu_to_le32(MD_FEATURE_BITMAP_OFFSET);
} else if (strcmp(update, "homehost") == 0 &&
- homehost) {
+ homehost) {
char *c;
update = "name";
c = strchr(sb->set_name, ':');