Bug 1064915

Summary: mdadm last resort timer and service should include array name in description
Product: [openSUSE] openSUSE Tumbleweed Reporter: Andrei Borzenkov <arvidjaar>
Component: BasesystemAssignee: Coly Li <colyli>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: nfbrown
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Andrei Borzenkov 2017-10-24 17:58:06 UTC
Normal systemd logs include only unit description. It makes it impossible to know for which array last resort was triggered as we only see generic description for every array. Description should include array name via %I (unescaped instance name) parameter. Something like this

iff --git a/systemd/mdadm-last-resort@.service b/systemd/mdadm-last-resort@.service
index e93d72b..30afe01 100644
--- a/systemd/mdadm-last-resort@.service
+++ b/systemd/mdadm-last-resort@.service
@@ -1,5 +1,5 @@
 [Unit]
-Description=Activate md array even though degraded
+Description=Activate md array %I even though degraded
 DefaultDependencies=no
 Conflicts=sys-devices-virtual-block-%i.device
 
diff --git a/systemd/mdadm-last-resort@.timer b/systemd/mdadm-last-resort@.timer
index 52b3f22..45ad223 100644
--- a/systemd/mdadm-last-resort@.timer
+++ b/systemd/mdadm-last-resort@.timer
@@ -1,5 +1,5 @@
 [Unit]
-Description=Timer to wait for more drives before activating degraded array.
+Description=Timer to wait for more drives before activating degraded array %I.
 DefaultDependencies=no
 Conflicts=sys-devices-virtual-block-%i.device
Comment 1 Neil Brown 2017-10-30 00:43:06 UTC
Thanks for the suggestion and patch.
I've submitted the patch upstream. 
After it has been accepted I'll add it to tumbleweed.
Comment 2 Neil Brown 2018-01-04 05:36:23 UTC
Hi Coly,
 could I have this one over to you?  Next time you are doing an mdadm update, could you add

Commit: 3d6a7c847249 ("systemd: add %I to description of mdadm-last-resort services.")

thanks.
Comment 3 Coly Li 2018-01-15 06:05:09 UTC
(In reply to Neil Brown from comment #2)
> Hi Coly,
>  could I have this one over to you?  Next time you are doing an mdadm
> update, could you add
> 
> Commit: 3d6a7c847249 ("systemd: add %I to description of mdadm-last-resort
> services.")
> 
> thanks.

The patch is in mdadm as 0199-systemd-add-I-to-description-of-mdadm-last-resort-se.patch. The new mdadm is merged into SLE15-repo and will show up in beta5. Here I close this report.

Coly Li