activation: Improve error handling in Subscribe

Handle exceptions from the sdbusplus method call_noreply API.

The Activation constructor was subscribing to systemd signals, which
would cause an "Already Subscribed" error when creating multiple
Activation instances because the bus is common.

There is no reason to subscribe to systemd signals in the constructor,
since the signals are only triggered during the activation process.
Move the Subscribe call to the activation process which calls
Unsubscribe at the end.

There's a scenario where there could still be an "Already Subscribed"
error if the activation fails, so add error handling there.

Tested: Verified code update worked with this change, and the app
would not core dump with the latest sdbusplus changes.

Change-Id: I065baca2586fa64c138d847187303464123cc01a
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
2 files changed
tree: 0efb3b02987b12a198bd9ad08a3af5ed2b87b284
  1. org/
  2. test/
  3. ubi/
  4. xyz/
  5. .clang-format
  6. .gitignore
  7. activation.cpp
  8. activation.hpp
  9. bootstrap.sh
  10. configure.ac
  11. download_manager.cpp
  12. download_manager.hpp
  13. download_manager_main.cpp
  14. elog-errors.hpp
  15. flash.hpp
  16. image_manager.cpp
  17. image_manager.hpp
  18. image_manager_main.cpp
  19. image_verify.cpp
  20. image_verify.hpp
  21. item_updater.cpp
  22. item_updater.hpp
  23. item_updater_main.cpp
  24. LICENSE
  25. MAINTAINERS
  26. Makefile.am
  27. README.md
  28. serialize.cpp
  29. serialize.hpp
  30. sync_manager.cpp
  31. sync_manager.hpp
  32. sync_manager_main.cpp
  33. sync_watch.cpp
  34. sync_watch.hpp
  35. version.cpp
  36. version.hpp
  37. watch.cpp
  38. watch.hpp
README.md

phosphor-bmc-code-mgmt

Phosphor BMC Code Management provides a set of system software management applications. More information can be found at Software Architecture

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To clean the repository run `./bootstrap.sh clean`.