freeipmi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freeipmi-devel] [PATCH] Send OS start and stop events to BMC


From: Charles_Rose
Subject: Re: [Freeipmi-devel] [PATCH] Send OS start and stop events to BMC
Date: Thu, 10 Dec 2015 13:50:43 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/09/2015 07:24 PM, Albert Chu wrote:
> Hi Charles,
>
> One other issue:
>
>> +ConditionPathExistsGlob=/dev/ipmi*
>
> There are multiple drivers available besides the kernel driver.  So I
> don't think this should be a requirement?

Al,

Thank you for your review.

The idea behind the check was to allow distributions to have this 
service turned on, on server editions. The unit will bail out gracefully 
when there is no IPMI device node present instead of reporting a 
failure. The hardware I have access to exposes KCS.

Having a separate unit that detects the presence of IPMI hardware on the 
system on which other units (like this one) can depend upon would be nice.

>
> Al
>
> On Wed, 2015-12-09 at 13:34 -0800, Albert Chu wrote:
>> Hi Charles,
>>
>> I was wondering what is the use and or need for these systemd scripts.
>> They seem to be for "convenience".  Perhaps there are some tools that
>> search for these events specifically.

Yes, at this time, this is a convenience that will let Admins know OS 
start and stop events/times. We have reports of Admins being able to 
resolve reboot related problems with this information. These events can 
potentially be used to trigger alerts as well. By keeping this upstream, 
we can at least provide an implementation that end users can use if they 
wish to.

Similar functionality is currently achieved by proprietary software that 
function as a BMC agent. This service would eliminate the need for such 
software.

This also helps fill the gap Linux distributions currently have when 
compared to other operating systems that log this information.

>>
>> There's nothing wrong with them being for convenience, but if they are,
>> they should perhaps not be installed by default.  Perhaps a configure
>> option could be run to enable their installation instead (and
>> subsequently they might be in a sub-rpm in the spec file, etc.).

A sub-rpm sounds good. We can then have distributions and/or end user 
choose if they want to have this enabled by default.

>>
>> Al
>>
>> On Wed, 2015-12-09 at 14:01 -0600, address@hidden wrote:
>>> Include systemd units that send OS start and shutdown events.
>>>
>>> Signed-off-by: Charles Rose <address@hidden>
>>> ---
>>>   etc/Makefile.am               |  6 ++++++
>>>   etc/os-shutdown-event.service | 19 +++++++++++++++++++
>>>   etc/os-startup-event.service  | 18 ++++++++++++++++++
>>>   3 files changed, 43 insertions(+)
>>>   create mode 100644 etc/os-shutdown-event.service
>>>   create mode 100644 etc/os-startup-event.service
>>>
>>> diff --git a/etc/Makefile.am b/etc/Makefile.am
>>> index 699072f..a5ca85b 100644
>>> --- a/etc/Makefile.am
>>> +++ b/etc/Makefile.am
>>> @@ -5,6 +5,8 @@ EXTRA_DIST = \
>>>     bmc-watchdog.service \
>>>     ipmidetectd.service \
>>>     ipmiseld.service \
>>> +   os-startup-event.service \
>>> +   os-shutdown-event.service \
>>>     bmc-watchdog.sysconfig \
>>>     ipmidetect.conf \
>>>     ipmidetectd.conf \
>>> @@ -35,6 +37,8 @@ install-systemd-scripts: install-sysconfig
>>>     $(INSTALL) -m 755 $(srcdir)/bmc-watchdog.service 
>>> $(DESTDIR)$(systemdsystemunitdir)/bmc-watchdog.service
>>>     $(INSTALL) -m 755 $(srcdir)/ipmidetectd.service 
>>> $(DESTDIR)$(systemdsystemunitdir)/ipmidetectd.service
>>>     $(INSTALL) -m 755 $(srcdir)/ipmiseld.service 
>>> $(DESTDIR)$(systemdsystemunitdir)/ipmiseld.service
>>> +   $(INSTALL) -m 644 $(srcdir)/os-startup-event.service 
>>> $(DESTDIR)$(systemdsystemunitdir)/os-startup-event.service
>>> +   $(INSTALL) -m 644 $(srcdir)/os-shutdown-event.service 
>>> $(DESTDIR)$(systemdsystemunitdir)/os-shutdown-event.service
>>>
>>>   install-sysconfig:
>>>     $(INSTALL) -m 755 -d $(DESTDIR)$(sysconfdir)/sysconfig
>>> @@ -59,3 +63,5 @@ uninstall-systemd-local:
>>>     $(RM) -f $(DESTDIR)$(systemdsystemunitdir)/bmc-watchdog.service
>>>     $(RM) -f $(DESTDIR)$(systemdsystemunitdir)/ipmidetectd.service
>>>     $(RM) -f $(DESTDIR)$(systemdsystemunitdir)/ipmiseld.service
>>> +   $(RM) -f $(DESTDIR)$(systemdsystemunitdir)/os-startup-event.service
>>> +   $(RM) -f $(DESTDIR)$(systemdsystemunitdir)/os-shutdown-event.service
>>> diff --git a/etc/os-shutdown-event.service b/etc/os-shutdown-event.service
>>> new file mode 100644
>>> index 0000000..b9bcf34
>>> --- /dev/null
>>> +++ b/etc/os-shutdown-event.service
>>> @@ -0,0 +1,19 @@
>>> +[Unit]
>>> +Description=Send OS shutdown event to BMC
>>> +Documentation=man:bmc-device
>>> +RefuseManualStart=true
>>> +DefaultDependencies=no
>>> +Before=shutdown.target
>>> +
>>> +ConditionFileIsExecutable=/usr/sbin/bmc-device
>>> +ConditionPathExistsGlob=/dev/ipmi*
>>> +
>>> +[Service]
>>> +Type=oneshot
>>> +# IPMI v2.0 rev 1.1 Table 42-3.
>>> +#    OS Stop / Shutdown: 0x20; OS Graceful Shutdown: 0x03
>>> +Environment="STOP_EVENT=0x41 0x04 0x20 0x01 0x6f assertion 0x03 0x00 0x00"
>>> +ExecStart=/usr/sbin/bmc-device --platform-event=${STOP_EVENT}
>>> +
>>> +[Install]
>>> +WantedBy=shutdown.target
>>> diff --git a/etc/os-startup-event.service b/etc/os-startup-event.service
>>> new file mode 100644
>>> index 0000000..8a567ef
>>> --- /dev/null
>>> +++ b/etc/os-startup-event.service
>>> @@ -0,0 +1,18 @@
>>> +[Unit]
>>> +Description=Send OS startup event to BMC
>>> +Documentation=man:bmc-device
>>> +RefuseManualStart=true
>>> +
>>> +ConditionFileIsExecutable=/usr/sbin/bmc-device
>>> +ConditionPathExistsGlob=/dev/ipmi*
>>> +
>>> +[Service]
>>> +Type=oneshot
>>> +# IPMI v2.0 rev 1.1 Table 42-3.
>>> +#    Base OS Boot/Installation Status: 0x1f; "C: boot completed": 0x01
>>> +Environment="START_EVENT=0x41 0x04 0x1f 0x01 0x6f assertion 0x01 0x00 0x00"
>>> +ExecStart=/usr/sbin/bmc-device --platform-event=${START_EVENT}
>>> +
>>> +[Install]
>>> +WantedBy=basic.target
>>> +Also=os-shutdown-event.service
>> --
>> Albert Chu
>> address@hidden
>> Computer Scientist
>> High Performance Systems Division
>> Lawrence Livermore National Laboratory
>>
>>
>>
>> _______________________________________________
>> Freeipmi-devel mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/freeipmi-devel


-- 
--
Thanks,
Charles Rose
Engineer, Infrastructure Software Engineering
Dell | Enterprise Solutions Group


reply via email to

[Prev in Thread] Current Thread [Next in Thread]