<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting mdadm to run specified program in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/getting-mdadm-to-run-specified-program/m-p/5030136#M48273</link>
    <description>Adding the line &lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;solved the problem. Thanks!</description>
    <pubDate>Sun, 25 Feb 2007 19:59:32 GMT</pubDate>
    <dc:creator>kenny chia</dc:creator>
    <dc:date>2007-02-25T19:59:32Z</dc:date>
    <item>
      <title>Getting mdadm to run specified program</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-mdadm-to-run-specified-program/m-p/5030134#M48271</link>
      <description>Hi &lt;BR /&gt;I have a DL145G2 running software RAID. OS is Red Hat Enterprise Linux ES release 4 (Nahant Update 3)&lt;BR /&gt;I want mdadm to run a program whenever a disk event occurs.&lt;BR /&gt;&lt;BR /&gt;This is my mdadm.conf settings&lt;BR /&gt;---------------------------&lt;BR /&gt;DEVICE partitions&lt;BR /&gt;MAILADDR root&lt;BR /&gt;PROGRAM /opt/mdmon/handle-mdadm-events&lt;BR /&gt;ARRAY /dev/md1 super-minor=1&lt;BR /&gt;ARRAY /dev/md0 super-minor=0&lt;BR /&gt;ARRAY /dev/md2 super-minor=2&lt;BR /&gt;ARRAY /dev/md3 super-minor=3&lt;BR /&gt;ARRAY /dev/md4 super-minor=4&lt;BR /&gt;-------------------------&lt;BR /&gt;&lt;BR /&gt;I modified the following line in /etc/init.d/mdmonitor &lt;BR /&gt;&lt;BR /&gt;"/bin/bash -c \"mdadm --monitor --scan -f &amp;gt; /var/run/mdadm/mdadm.pid\""&lt;BR /&gt;&lt;BR /&gt;to&lt;BR /&gt;&lt;BR /&gt;"/bin/bash -c \"mdadm --monitor --scan -f -t &amp;gt; /var/run/mdadm/mdadm.pid\""&lt;BR /&gt;&lt;BR /&gt;Purpose is to generate test message at startup.&lt;BR /&gt;I restart mdadm using&lt;BR /&gt;# /etc/init.d/mdmonitor restart&lt;BR /&gt;&lt;BR /&gt;As expected, an email message is sent to root but the program /opt/mdmon/handle-mdadm-events fails to execute. &lt;BR /&gt;Contents of program&lt;BR /&gt;&lt;BR /&gt;/bin/echo "TEST" &amp;gt;&amp;gt; /opt/mdmon/test.log&lt;BR /&gt;&lt;BR /&gt;The file /opt/mdmon/test.log is not generated at all. What could have gone wrong?&lt;BR /&gt;&lt;BR /&gt;The execute bit of the program is already set.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Feb 2007 02:50:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-mdadm-to-run-specified-program/m-p/5030134#M48271</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2007-02-23T02:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Getting mdadm to run specified program</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-mdadm-to-run-specified-program/m-p/5030135#M48272</link>
      <description>Can you run the script manually ?&lt;BR /&gt;&lt;BR /&gt;I would anyway recommend some 'minimal' things in your script:&lt;BR /&gt;&lt;BR /&gt;-----&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;/bin/echo "TEST" &amp;gt;&amp;gt; /opt/mdmon/test.log&lt;BR /&gt;exit 0&lt;BR /&gt;-----&lt;BR /&gt;&lt;BR /&gt;Kind of a safety net: the 1st line denotes how to interpret the script; the last one does a clean exit -and- prevents any control characters at the end of your file to mess things up.&lt;BR /&gt;&lt;BR /&gt;(not at my linux machines right now so I can't recreate your situation for now, sorry)&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Wout</description>
      <pubDate>Fri, 23 Feb 2007 05:59:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-mdadm-to-run-specified-program/m-p/5030135#M48272</guid>
      <dc:creator>Wouter Jagers</dc:creator>
      <dc:date>2007-02-23T05:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Getting mdadm to run specified program</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-mdadm-to-run-specified-program/m-p/5030136#M48273</link>
      <description>Adding the line &lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;solved the problem. Thanks!</description>
      <pubDate>Sun, 25 Feb 2007 19:59:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-mdadm-to-run-specified-program/m-p/5030136#M48273</guid>
      <dc:creator>kenny chia</dc:creator>
      <dc:date>2007-02-25T19:59:32Z</dc:date>
    </item>
  </channel>
</rss>

