mdadm should print degraded array status to motd

Bug #1549319 reported by Scott Moser
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)
Confirmed
Medium
Adam Conrad

Bug Description

During attended install of ubuntu server iso, user is prompted for exim config.
Is it possible to seed the 'No Configuration' in the installer?

The change is due to having mdadm in the default install now, and that pulling in postfix.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

I don't think this is the exim config at all, but rather postfix.

Note that this doesn't change much; you'd want to preseed the MTA configuration in debian-cd in this file:
 data/xenial/preseed/ubuntu-server/ubuntu-server.seed

For postfix, this means setting postfix/main_mailer_type to the value you want for No configuration.

In any case, this is not a debian-installer bug; and at most a bug in the seed or in debian-cd. Assigning to debian-cd for now.

affects: debian-installer (Ubuntu) → debian-cd (Ubuntu)
Revision history for this message
Scott Moser (smoser) wrote : Re: server iso install prompts for postfix config

I incorrectly stated 'exim' in the original bug open. I've fixed that. It is postfix. Sorry for noise.

summary: - server iso install prompts for exim config
+ server iso install prompts for postfix config
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote :

Punting this back to mdadm after a discussion with smoser. We agreed (ish) back in August[1] that it would be acceptable to drop the Recommends to a Suggests if an motd snippet was added to the cronjob output to inform people on login of their degraded arrays. This isn't perfect for people who never log in, but then again, there are people who also never configure an MTA, so it seems like a decent compromise.

[1] http://irclogs.ubuntu.com/2015/08/06/%23ubuntu-devel.html#t22:53

affects: debian-cd (Ubuntu) → mdadm (Ubuntu)
Changed in mdadm (Ubuntu):
assignee: nobody → Scott Moser (smoser)
Revision history for this message
Scott Moser (smoser) wrote :

I think i'm going to change this into a bug to Suggests, not Recommends 'mta' from mdadm.
Adam Conrad, Scott Kitterman and I had some discussion on that at http://irclogs.ubuntu.com/2015/08/06/%23ubuntu-devel.html#t22:53 .

We'll change /etc/cron.daily/mdadm to use '
exec $MDADM --monitor --scan --oneshot --program=/usr/lib/mdadm/update-motd

and then have /usr/lib/mdadm/update-motd like below.
mdadm invokes the program once for each event, so to collect only the last run's events we have to do this business with statefile and the parent pid.

#!/bin/sh
# keep state in statefile and write otuput to motdfile
fail() { echo "$@" 1>&2; exit 1; }
statefile="/tmp/mydir/mystate.txt"
motdfile="/tmp/output"
[ $# -eq 0 ] && exit 0

[ -d "${statefile%/*}" ] || mkdir -p "${statefile%/*}"
parent="$PPID"
event="$1"
target="$2"
[ $# -eq 2 ] || fail "bad args for $0: $*"

# clean out any old info
echo "$parent $event $target" >> "$statefile" ||
   fail "failed writing $statefile"
sed -i "/^$parent /!d" "$statefile" || fail "failed update $statefile"

while read ppid event target; do
   echo "parent $parent said event=$event target=$target"
done < "$statefile" > "$motdfile"

Revision history for this message
Scott Moser (smoser) wrote :

Per irc conversation, Adam said he'd take this bug from here to
 a.) change Recommends to Suggests
 b.) finish up the script above so user sees motd message about degraded array on login.

Changed in mdadm (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
assignee: Scott Moser (smoser) → Adam Conrad (adconrad)
Revision history for this message
Adam Conrad (adconrad) wrote :

mdadm_3.3-2ubuntu6 addresses the first part of this bug (Dropping the Recommends to a Suggests to get it out of the default install set), but doesn't resolve the second part (the update-motd.d bit). I'll fix the motd bit in a followup upload.

Adam Conrad (adconrad)
summary: - server iso install prompts for postfix config
+ mdadm should print degraded array status to motd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.