help: OpenBMC host power on from power button press

Matt Spinler mspinler at linux.vnet.ibm.com
Tue Oct 30 06:04:52 AEDT 2018



On 10/29/2018 7:05 AM, A, Maheswari wrote:
>
> Hi Matt,
>
> Thanks for your response.
>
> I am able to power on the Host by monitoring GPIO using 
> “phosphor-gpio-monitor” service.
>
> But still we need to achieve same result by 
> org.openbmc.buttons.Power at 0.service 
> <mailto:org.openbmc.buttons.Power at 0.service> in future.
>
> Here is the response :
>
> # systemctl status org.openbmc.buttons.Power at 0.service 
> <mailto:org.openbmc.buttons.Power at 0.service>
>
>org.openbmc.buttons.Power at 0.service - Phosphor Power Button0
>
>    Loaded: loaded 
> (/lib/systemd/system/org.openbmc.buttons.Power at .service; indirect; 
> vendor preset: enabled)
>
>    Active: inactive (dead)
>
> hwmi~# ps | grep button_power.exe
>
> 1205 root      3100 S    grep button_power.exe
>
> hwmi:~#
>
> button_power.exe is not running in BMC.  Service status with instance 
> 0 is not showing any error. But button_power.exe is not running. So 
> that I tried with instance 1.
>

Can you check if this link exists?

/etc/systemd/system/obmc-standby.target.wants/org.openbmc.buttons.Power at 0.service

That will start the service on the way to standby.  If it does exist, 
then it should be running, so maybe check
the journal for errors, or try running button_power.exe from the command 
line and see if it crashes.

(can also check that the standby target was reached with systemctl 
status obmc-standby.target)

If it doesn't exist, then you probably don't have 
OBMC_POWER_BUTTON_INSTANCES defined, though
that should be in phosphor-defaults.inc.

> I think below file is responsible for button power controlling in OBMC.
>
> c/skeleton/blob/master/pwrbutton/button_power_obj.c
>
> Here is the receipe file.
>
> Cat ./meta-phosphor/recipes-phosphor/chassis/obmc-button-power.bb
>
> SUMMARY = "OpenBMC org.openbmc.Button example implementation"
>
> DESCRIPTION = "A sample implementation for a button controlling a 
> power domain."
>
> PR = "r1"
>
> inherit skeleton-gdbus
>
> inherit obmc-phosphor-dbus-service
>
> inherit pkgconfig
>
> SKELETON_DIR = "pwrbutton"
>
> FMT = "org.openbmc.buttons.Power@{0}.service"
>
> DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 
> 'OBMC_POWER_BUTTON_INSTANCES')}"
>
> If you need journal log, then I can share it. I need to understand the 
> flow.
>
> Please help to achieve.
>
> Thanks
>
> Maheswari A
>
> *From:*Matt Spinler <mspinler at linux.vnet.ibm.com>
> *Sent:* Saturday, October 27, 2018 1:45 AM
> *To:* A, Maheswari <maheswari.a at atos.net>
> *Cc:* OpenBMC Maillist <openbmc at lists.ozlabs.org>
> *Subject:* Re: help: OpenBMC host power on from power button press
>
> On 10/25/2018 11:52 PM, A, Maheswari wrote:
>
>     Hi,
>
>     I am new to openBMC project.
>
>     We are in the process of porting power button gpio interrupt
>     handling in openBMC.
>
>     After some a lot of analysis, I found that obmc-button-power
>     related service are necessary to power on the host using power
>     button press event.
>
>     I have added POWER_BUTTON and machine specific GPIO number and
>     polarity in gpio_defs.json.
>
>     While starting the “org.openbmc.button.Power” service, I am
>     getting the below error.
>
>     *org.openbmc.buttons.Power at 1.service
>     <mailto:org.openbmc.buttons.Power at 1.service> - Phosphor Power Button1*
>
>     *   Loaded: [[0;1;31merror[[0m (Reason: File exists)*
>
>     *   Active: inactive (dead)*
>
>     **
>
>     *Oct 22 14:14:13 hwmi systemd[1]:
>     [[0;1;31m[[0;1;39m[[0;1;31morg.openbmc.buttons.Power at 1.service
>     <mailto:0;1;31morg.openbmc.buttons.Power at 1.service>: Two services
>     allocated for the same bus name org.open*
>
>     *bmc.butto.Power, refusing operation.[[0m*
>
>     Please help to figure out and proceed.
>
> Hi Maheswari,
>
> I'm guessing you already have an org.openbmc.buttons.Power at 0.service 
> <mailto:org.openbmc.buttons.Power at 0.service> running.
>
> You can check with:
>
> # systemctl status org.openbmc.buttons.Power at 0.service 
> <mailto:org.openbmc.buttons.Power at 0.service>
>
> or just check for the button_power.exe process already running.
>
>
>
>     Thanks
>
>     Maheswari A
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20181029/480da67a/attachment-0001.html>


More information about the openbmc mailing list