<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I am trying to understand how the Server power button in the webui works.</div><div class=""><br class=""></div><div class="">As before, using raspberry pi, and I’ll leave project links at the end for anyone that wants to use them. Things work up to monitoring voltages. Note the conf project has a phosphor branch for the full monty.</div><div class=""><br class=""></div><div class="">To reverse engineer, I setup: dbus-monitor —system > someFile.log</div><div class=""><br class=""></div><div class="">There is a message for systemd1.Manager; member=StartUnit and best I can tell, somehow this gets routed to systemd to start some service or run some exe. I see this mentioned in the dbus transactions:</div><div class=""><br class=""></div><div class="">"<a href="mailto:obmc-host-start@0.target" class="">obmc-host-start@0.target</a>”</div><div class=""><br class=""></div><div class="">And that is in /lib/systemd/system and depends on <a href="mailto:obmc-host-startmin@0.target" class="">obmc-host-startmin@0.target</a>, but that does not depend on any service. So that is a dead end. It also depends on a reboot attempts, but I think that is not responsible for power on/off.</div><div class=""><br class=""></div><div class="">Then there are chassis services, but I cannot find a link from <a href="mailto:obmc-host-start@0.target" class="">obmc-host-start@0.target</a> to <a href="mailto:objc-chassis-poweron@0.target" class="">objc-chassis-poweron@0.target</a>.</div><div class=""><br class=""></div><div class="">In this doc: <a href="https://github.com/openbmc/docs/blob/master/architecture/openbmc-systemd.md" class="">https://github.com/openbmc/docs/blob/master/architecture/openbmc-systemd.md</a></div><div class=""><br class=""></div><div class="">It shows:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class=""><pre style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46);" class=""><code style="box-sizing: border-box; padding: 0px; margin: 0px; border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal;" class=""><font face="Helvetica" class="">ls -1 /lib/systemd/system/obmc-chassis-poweron\@0.target.requires/
<a href="mailto:op-power-start@0.service" class="">op-power-start@0.service</a>
<a href="mailto:op-wait-power-on@0.service" class="">op-wait-power-on@0.service</a></font></code></pre><div class=""><br class=""></div></div><div class="">But when I “ls” that path, the above dependencies are not there. There is only a dependency on <a href="mailto:phosphor-fan-presence-tach@0.service" class="">phosphor-fan-presence-tach@0.service</a></div></div><div class=""><br class=""></div><div class="">There is some state service that lead to things with xzy paths, and I eventually found /run/systemd/units. These have file names starting with “invocation” in the names and link to GUID like nodes that don’t “cat” like a normal file. So I am not sure how those work. Is there some kernel driver that works like sysfs so that these nodes are not traditional files?</div><div class=""><br class=""></div><div class="">What I am trying to understand is two things:</div><div class=""><br class=""></div><div class="">- Interaction with the power regulator</div><div class="">- Interaction with the host cpu</div><div class=""><br class=""></div><div class="">So my hope is someone can connect the dots of the path from the dbus to systemd through the targets to a service executable doing the work so I can try to replace them with:</div><div class=""><br class=""></div><div class="">- Something that turns the regulators on/off, with pmbus in this case.</div><div class="">- Something that can behave like a host to keep the system happy like a real system.</div><div class=""><br class=""></div><div class="">Mike</div><div class=""><br class=""></div><div class="">My repos</div><div class="">——————</div><div class=""><br class=""></div><div class=""><a href="https://github.com/Proclivis/meta-pmbus-raspberrypi.git" class="">https://github.com/Proclivis/meta-pmbus-raspberrypi.git</a></div><div class=""><a href="https://github.com/Proclivis/meta-pmbus-phosphor.git" class="">https://github.com/Proclivis/meta-pmbus-phosphor.git</a></div><div class=""><a href="https://github.com/Proclivis/conf-openbmc-adi.git" class="">https://github.com/Proclivis/conf-openbmc-adi.git</a></div><div class=""><br class=""></div><div class="">The monitor messages for StartUnit</div><div class="">———</div><div class=""><br class=""></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">method call time=1598039669.247458 sender=:1.48 -> destination=org.freedesktop.systemd1 serial=33 path=/org/freedesktop/systemd1; interface=org.freedesktop.systemd1.Manager; member=StartUnit<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string "<a href="mailto:obmc-host-start@0.target" class="">obmc-host-start@0.target</a>"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string "replace"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">method call time=1598039669.276170 sender=:1.3 -> destination=org.freedesktop.DBus serial=775 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetConnectionUnixUser<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string ":1.48"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">method return time=1598039669.276234 sender=org.freedesktop.DBus -> destination=:1.3 serial=4294967295 reply_serial=775<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   uint32 0<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">method call time=1598039669.280376 sender=:1.3 -> destination=org.freedesktop.DBus serial=776 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string "type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.48'"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">method return time=1598039669.280661 sender=org.freedesktop.DBus -> destination=:1.3 serial=4294967295 reply_serial=776<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">method call time=1598039669.280701 sender=:1.3 -> destination=org.freedesktop.DBus serial=777 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string ":1.48"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">method return time=1598039669.280738 sender=org.freedesktop.DBus -> destination=:1.3 serial=4294967295 reply_serial=777<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string ":1.48"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">signal time=1598039669.280774 sender=:1.3 -> destination=(null destination) serial=778 path=/org/freedesktop/systemd1; interface=org.freedesktop.systemd1.Manager; member=UnitNew<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string "<a href="mailto:obmc-host-start@0.target" class="">obmc-host-start@0.target</a>"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   object path "/org/freedesktop/systemd1/unit/obmc_2dhost_2dstart_400_2etarget"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">signal time=1598039669.280823 sender=:1.3 -> destination=(null destination) serial=779 path=/org/freedesktop/systemd1; interface=org.freedesktop.systemd1.Manager; member=JobNew<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   uint32 1105<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   object path "/org/freedesktop/systemd1/job/1105"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string "<a href="mailto:obmc-host-start@0.target" class="">obmc-host-start@0.target</a>"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">method return time=1598039669.280883 sender=:1.3 -> destination=:1.48 serial=780 reply_serial=33<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   object path "/org/freedesktop/systemd1/job/1105"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">signal time=1598039669.281305 sender=:1.48 -> destination=(null destination) serial=34 path=/xyz/openbmc_project/state/host0; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   string "xyz.openbmc_project.State.Host"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   array [<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">      dict entry(<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">         string "RequestedHostTransition"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">         variant             string "xyz.openbmc_project.State.Host.Transition.On"<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">      )<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   ]<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   array [<o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">   ]</div></div></div></body></html>