ipmid: Switch to /var/run for lockfiles

- This prevents IPMI connections from the host to the BMC from failing
  if the BMC's root ('/') partition fills up or is otherwise
  unwriteable.

- In the full filesystem case, this error only happens if the filesystem
  fills up prior to the first operation after flashing an image.

  This is because lockfiles are only created at connection time
  (e.g. see cacheUserDataFile() in user_channel/user_mgmt.cpp),
  so the failure only happens if no other operation has been performed
  since the image was first flashed.

- For the "root is otherwise unwriteable" case, all locking operations
  would fail, since even though the files may exist, they can't be
  opened as writeable.

- This approach is chosen since (a) `/var/run` is arguably the correct
  place for daemons to write runtime info, and (b) `/var/run` uses
  `tmpfs` so it should always be able to mount `rw`.

- Note that this does not prevent the "full filesystem" failure
  entirely, since other things may fill up `tmpfs`.

  The complete solution would include creating the files at start time
  (e.g. using systemd), which I will do in a followup change.

Tested: Flashed BMC with new image containing updated IPMI daemons.
Verified that IPMI operations work and that lock files are now created
in `/var/run/ipmi/` instead of `/var/lib/ipmi/`.

Signed-off-by: Tyson Tuckerbear <ttucker@google.com>
Change-Id: I33eb33ddb0009a978d5cea3fcd5615c45ce4416c
2 files changed
tree: 2373c634e430cc3e27884d9aa695d4935c6ab053
  1. app/
  2. dbus-sdr/
  3. docs/
  4. include/
  5. libipmid/
  6. scripts/
  7. softoff/
  8. subprojects/
  9. test/
  10. transport/
  11. user_channel/
  12. xyz/
  13. .build.sh
  14. .clang-format
  15. .clang-tidy
  16. .gitignore
  17. .shellcheck
  18. .travis.yml
  19. apphandler.cpp
  20. apphandler.hpp
  21. chassishandler.cpp
  22. chassishandler.hpp
  23. dcmihandler.cpp
  24. dcmihandler.hpp
  25. error-HostEvent.hpp
  26. fruread.hpp
  27. generate_whitelist.sh
  28. generate_whitelist_create.sh
  29. globalhandler.cpp
  30. groupext.cpp
  31. host-cmd-manager.cpp
  32. host-cmd-manager.hpp
  33. host-interface.cpp
  34. host-interface.hpp
  35. host-ipmid-whitelist.conf
  36. ipmi_fru_info_area.cpp
  37. ipmi_fru_info_area.hpp
  38. ipmiallowlist.hpp
  39. ipmid-new.cpp
  40. ipmisensor.cpp
  41. LICENSE
  42. meson.build
  43. meson.options
  44. OWNERS
  45. read_fru_data.cpp
  46. read_fru_data.hpp
  47. README.md
  48. selutility.cpp
  49. selutility.hpp
  50. sensordatahandler.cpp
  51. sensordatahandler.hpp
  52. sensorhandler.cpp
  53. sensorhandler.hpp
  54. settings.cpp
  55. settings.hpp
  56. storageaddsel.cpp
  57. storageaddsel.hpp
  58. storagehandler.cpp
  59. sys_info_param.cpp
  60. sys_info_param.hpp
  61. systemintfcmds.cpp
  62. systemintfcmds.hpp
  63. transportconstants.hpp
  64. transporthandler.cpp
  65. transporthandler.hpp
  66. whitelist-filter.cpp
README.md

phosphor-host-ipmid

Compile ipmid with default options

meson builddir
ninja -C builddir

Compile ipmid with yocto defaults

meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled
ninja -C builddir

If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in ipmid/subprojects.

Enable/Disable meson wrap feature

meson builddir -Dwrap_mode=nofallback
ninja -C builddir

Enable debug traces

meson builddir -Dbuildtype=debug
ninja -C builddir

Generate test coverage report

meson builddir -Db_coverage=true -Dtests=enabled
ninja -C builddir test
ninja -C builddir coverage