Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templated service files are broken #26

Open
williamspatrick opened this issue Oct 6, 2022 · 3 comments
Open

templated service files are broken #26

williamspatrick opened this issue Oct 6, 2022 · 3 comments

Comments

@williamspatrick
Copy link
Member

The repository has a number of templated services files, such as:

$ cat ./monitor/service_files/json/[email protected]
[Unit]
Description=Phosphor Fan Monitor Daemon
After=mapper-wait@-xyz-openbmc_project-inventory.service

[Service]
Restart=on-failure
ExecStart=/usr/bin/phosphor-fan-monitor  <------ ??

There is nothing in this template file that is templated. There is no use of the %I field, for example.

In meta-phosphor, these templates are being installed based on OBMC_CHASSIS_INSTANCES:

SYSTEMD_LINK:${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \
                                compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_INSTANCES'), \
                                compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}"

The side-effect of this is any multi-chassis system ends up with N instances of this template installed, each of which tries to launch the same phosphor-fan-monitor program, of which N-1 crash due to the dbus server name already being taken. Unfortunately, the service files are also written with Restart=on-failure, so we end up with a continuous loop of crash/restart/crash/restart on N-1 instances of the service, which fills up the phosphor-debug-collector almost instantly and consumes plenty of CPU.

@spinler
Copy link
Contributor

spinler commented Oct 6, 2022

Yea, that's definitely a problem that a templated service wouldn't also claim a templated D-Bus name.

@msbarth
Copy link
Contributor

msbarth commented Oct 6, 2022

FWIW, it was templated for the yaml version of the service files. The json versions no longer required the use of %i
https://github.com/openbmc/phosphor-fan-presence/blob/master/monitor/service_files/yaml/phosphor-fan-monitor%40.service

@williamspatrick
Copy link
Member Author

Shouldn't have been closed. I wrote "partially resolves"...

jamin-aspeed pushed a commit to AspeedTech-BMC/openbmc that referenced this issue Mar 29, 2023
Partially resolves openbmc/phosphor-fan-presence#26.

The phosphor-fan package installs templated service files based
on the OBMC_CHASSIS_INSTANCES, but there is currently nothing in
those templates which is templated.  As a result, all but the first
instance continuously crashes due to the dbus name already being
taken.

Hack around this for now by only using CHASSIS="0" until a more
complete solution is identified.

Signed-off-by: Patrick Williams <[email protected]>
Change-Id: Ia0bebb1670d45cb91555ff7af9ba502abd7460e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants