summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Add class to monitor for unit failuresMatt Spinler2017-06-264-1/+255
| | | | | | | | | | | This class has an analyze() method that will check the state of a unit, and then stop or start a target unit if the state is failed. The units and the action are passed in via the constructor. Change-Id: Ibc8e54b8371d2261eb55cce5825c5cee6d214bab Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* server: fix unexpected GetSubTreePaths behaviorBrad Bishop2017-06-231-1/+3
| | | | | | | | | | | | | | The intent is that subtree paths enumerate all paths, even paths that don't have any objects associated with them. For example a get subtree paths on /xyz should provide /xyz/openbmc_project. Starting with 1c33c22 get subtree paths incorrectly searches for paths with objects under them. Resolves: openbmc/openbmc#1544 Change-Id: If6db079d10a4216b192bf18d26b4bacbcc264314 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* gitignore updatesBrad Bishop2017-06-143-0/+25
| | | | | | | Ignore various build artifacts. Change-Id: I8b0447bf66844c6cfd40b57da4564324dbd0322b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix interfaces added logic errorBrad Bishop2017-06-081-1/+1
| | | | | | | | | Fix a bug that prevents the mapper from correctly processing an interfaces added signal when the interface is added to an object that already has interfaces that have been processed. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I1a9045c14d1d8b70151a8f5cc95eb18dbb20c79f
* Add phosphor-unit-failure-monitor frameworkMatt Spinler2017-06-024-2/+44
| | | | | | | | | | | | | | | | | | | This application is designed to be called from the OnFailure directive in a systemd unit file. It will stop or start another unit when the current unit fails enough times to exceed its restart policy so it isn't restarted again. To do this, this application will check the ActiveState property of the failing unit. When it is 'failed', the target unit will be started (or stopped). The failing unit name, the target unit name, and if the target should be stopped or started are all passed in on the command line. Change-Id: I93ecccaf1c091abddb769ddad8f43ecd9902210b Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* build: change oldincludedir to includedirPatrick Williams2017-06-011-1/+1
| | | | | Change-Id: I070d49e5ea488547eaded4d88b468c8eb85641f3 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* libmapper: Add subtree callback functionsAdriana Kobylak2017-05-151-0/+105
| | | | | | | | Implement subtree callback functions for match, getpaths, and timeout. Change-Id: I1037a52fced9e47aa630ebb9ae39b745349acb95 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* libmapper: Add function to call GetSubTreePathsAdriana Kobylak2017-05-151-0/+46
| | | | | | | | Call the dbus method GetSubTreePaths to look for the specified interface. Change-Id: If266fc0db2c10582eeb9438e91f9556dcb525e39 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* libmapper: Add match for removed interfacesAdriana Kobylak2017-05-151-0/+64
| | | | | | | Add a match to look for removed interfaces. Change-Id: If5bd68254b88c664c33f443ea593974b87996b42 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Create libmapper subtree function and call it in event loopAdriana Kobylak2017-05-113-0/+69
| | | | | | | | | | | Call a new mapper subtree interface in an event loop. Create an enum to specify the mapper action, in this case wait for an interface to be removed. This allows to later add other operations like wait for an interface to be added since the logic would be different. Change-Id: I8330852d47185c3c4e40e994c6e4719054a9fc06 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* app: Split subtree argumentAdriana Kobylak2017-05-111-1/+12
| | | | | | | | Split the argument string on the first colon (:) character to get the namespace and interface. Change-Id: Ia9c67bd149c23e68945fd80252a93a2f1fe78382 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* app: Add subtree-remove optionAdriana Kobylak2017-05-081-0/+18
| | | | | | | | | | | | | | | | | | | New mapper option to wait until a specified interface is not present in any of the subtrees of the specified namespace. Usage: mapper subtree-remove <NAMESPACE>:<INTERFACE> mapper subtree-remove /foo/namespace:bar.interface A future change could add an additional option to wait for interfaces to appear in a subtree of the specified path. Note that the subtree option will look for the interface in the subtree paths, not on the specified base namespace path. So in order to find an interface in /base/level1/level2, then the specified namespace path should be /base/level1/. Change-Id: I862310d819c505c59161adcce338041a08e1218c Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Revert "Add mapper-wait-until-removed"Adriana Kobylak2017-05-043-58/+25
| | | | | | | | | | | | This reverts commit 9f4c3c7c408a5f84a52416da99d0dd8035f1ae5a. After further design discussions, the new wait until removed implementation should be a new API. Reverting this change to put back the original wait interfaces since new ones will be created instead of modifying the existing ones. Change-Id: I605439dcb24c6dca7f394325afc6587eacf417f1 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Revert "wait-until-removed: Add Interface parameter"Adriana Kobylak2017-05-043-110/+4
| | | | | | | | | | This reverts commit e4d6c79030ad7b7638d0fc5ea09cf13afe224cda. The commit had incomplete changes, reverting it since the implementation is changing per feedback from code reviews. Change-Id: Ia99b9ae57cda805d419f3ed0e326c09154335051 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* wait-until-removed: Add Interface parameterAdriana Kobylak2017-04-233-4/+110
| | | | | | | | | | | | | | The additional interface parameter can be a string (ex. "intf" "obj1"), or be in a single string with the obj parameter (ex. "intf obj1 obj2..."). The latter is used when passing the parameters from a systemd unit. The wait-until-removed option will block until the requested interface is not present in the specified dbus object. Change-Id: Ia935af5721e2aec8c271eff483cff9c3a1f1fa24 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Add mapper-wait-until-removedAdriana Kobylak2017-04-213-25/+58
| | | | | | | | | This option will do the opposite of mapper wait by blocking if a dbus object exists until that object is removed. Change-Id: Ia460b1ffdb912ba475b15ae5f8499a177e801dfd Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Move object_mapper per dbus path conventions.Leonel Gonzalez2017-03-202-2/+2
| | | | | | | Partial fix for openbmc/openbmc#1112. Change-Id: I964620e7b741dffbf5a680ae775f371a28143860 Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* Add get-service option to mapper toolAndrew Geissler2017-03-071-2/+39
| | | | | | | | | Adding this feature will allow services to use the busctl command without hard coding the dbus service information Change-Id: Ibdfb2e0dce97486ad4dd6784257fa81c1122dba2 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Don't return errors when busyBrad Bishop2017-02-241-12/+0
| | | | | | | | | | | | | | | | | | | | Respond to method calls when the mapper is in the middle of processing a NameOwnerChanged signal, rather than returning ObjectPathInUse. Prior to this patch mapper responses guaranteed causal ordering. This patch removes that guarantee in order to remove the need for operation retries. Achieving both causal ordering and blocking responses is not possible with python-dbus without additional threads. This workaround will serve as a mitigation until the mapper can be written with sdbus bindings that do not have the limitations of python-dbus. Resolves openbmc/openbmc#1145 Change-Id: Idc21a11d7cc815bc8d0fcb7f18edc63bfed14da9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add xyz.openbmc_project.ObjectMapper.PrivateBrad Bishop2017-02-243-67/+30
| | | | | | | | | | | | | | | | | | | | | | | | | The mapper client bindings currently use the NameOwnerChanged signal as a trigger for a mapper query when waiting for an object to appear on the bus. This works because at the moment the mapper returns a busy response to clients in the window between NameOwnerChanged and completion of its discovery. A forthcoming patch will change this behavior such that the mapper will go ahead and respond in the window to improve overall mapper responsiveness, at the cost of the current causal ordering guarantee. The ordering guarantee is what allows the current wait binding implementation to work. Without it, the wait binding requires a means to determine when it is safe to make a make a query. Add a new mapper interface xyz.openbmc_project.ObjectMapper.Private with a single signal IntrospectionComplete to meet this requirement. "Private" because the signal should only be consumed by the mapper client bindings. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Ia7b65cd7edd37c49fa7b5ad808b0c59304c68717
* Add retries for LimitsExceeded errorsMatt Spinler2017-01-302-3/+6
| | | | | | | | | | There will now be retries for the LimitsExceeded exceptions just like the ObjectPathInUse ones. Resolves openbmc/openbmc#978. Change-Id: Ide1465372148d804c522f99e252a0c6c48e7da41 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Changing default retry interval to 0.2 secondsCory Klokman2017-01-251-4/+4
| | | | | | | Resolves openbmc/openbmc#974. Change-Id: I05e0ad31d98398a0375d4db620a388d4af1dec8a Signed-off-by: Cory Klokman <cklokma@us.ibm.com>
* Add sleep between retires in bindingsLei YU2017-01-161-9/+12
| | | | | | | | | | | | | | | In bindings.py the common retry() function uses a busy loop to retry, in some cases the busy loop just increase the work loads of mapper and the caller still get the ObjectPathInUse exception. It's better to sleep for a while between retries. A sleep interval is added as parameter default to 0, so the change does not break existing functions. Then the caller has an option to pass a sleep interval to indiciate it would sleep for an interval between retries. Change-Id: Ie1f248dc0b1be291dfa597eba2f58ba9bf247d6b Signed-off-by: Lei YU <mine260309@gmail.com>
* Increase retries times on ObjectPathInUse exceptionLei YU2017-01-111-2/+2
| | | | | | | | | | | | | | | | In get_object_async() when calling ObjectMapper.GetObject(), ObjectPathInUse exception may raise and it will retry. Previously it retries for 5 times with 1000ms interval, it sometimes cause get_object_async() raise this exception and system_manager will not enter BMC_READY state. This workaround increases the retry times to 20 and reduce the interval to 500ms, so far the issue is not reproduced. Partially fix openbmc/openbmc#862 Change-Id: Icaccc31c896e52b1c056007dff5c72d213bb7fa8 Signed-off-by: Lei YU <mine260309@gmail.com>
* Correct out-of-tree builds for systemd workaroundMatthew Barth2017-01-041-1/+1
| | | | | Change-Id: I27c92f1b31da36a00585fa07376766a1f94e81df Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Workaround sd_bus_message_append_cmdlineMatthew Barth2016-11-233-0/+21
| | | | | | | | | | Unable to get libmapper built without systemd being patched with the sd_bus_message_append_cmdline function. Until it is pushed upstream, this is a workaround to get the available systemd install built for unit testing. Change-Id: Ieca78955a4182eebd469a860c37ccaedfe75d323 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Switch to use generated config.hMatthew Barth2016-11-232-4/+1
| | | | | | | | Remove libmapper/config.h and have configure put generated config.h in libmapper directory. Change-Id: I3591b719e7b66d532ddad3499c6092166ad9a442 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Add path information on service lookup failureBrad Bishop2016-11-211-2/+2
| | | | | Change-Id: Ie180b5a206eeb55c02149e5201c381652759bbdc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* libmapper: React to DBus API changeBrad Bishop2016-11-211-4/+11
| | | | | | | | Fix up the sdbus client bindings for the new interface filter argument. Change-Id: Iabbe7ecb88ea261409b406e6499c0f6e96d1c25b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add interfaces parameter to python bindingsBrad Bishop2016-11-212-8/+14
| | | | | | | Expose the new interface filter argument. Change-Id: Ibf12f6497f45a2e1f71bfa2841dc69f5a37a7b17 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Return an error for invalid path argumentBrad Bishop2016-11-211-0/+3
| | | | | | | The GetAncestors method didn't have any invalid path checking. Change-Id: Ic69e78aaa6dd414bd77d76d96f47e76480a75f21 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add interface filters to all methods.Brad Bishop2016-11-211-12/+48
| | | | | | | Allow clients to filter the result set on interface(s). Change-Id: I96d54b88d8a5eca7ca56e01657a3cb7439ff6af6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Rename mapper DBus names to match xyzBrad Bishop2016-11-212-5/+5
| | | | | | | Use the domain we actually own, per DBus naming best practices. Change-Id: I69e85d91bcf30bfab5c1d6157f399683b91dda35 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add awk program check and use which one is foundMatthew Barth2016-11-182-1/+2
| | | | | Change-Id: Ia5ab161f83640189350ebe3a53d46834ea8bf9fc Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Convert build process to autotoolsMatthew Barth2016-11-097-44/+127
| | | | | | | | | Replaced the use of a manual Makefile with the use of autotools to automatically verify and generate the necessary build files. Follow the steps outlined within the README.md file to build the package. Change-Id: Id7be6220d32e457b1171d5d98123c6d8f317b380 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Use config.h defines for path, bus, and interfaceBrad Bishop2016-11-021-9/+10
| | | | | Change-Id: I1b3d09caac7fde6e7fd6c5a90a1fe4afa7613f29 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* libmapper: add config.hBrad Bishop2016-11-021-0/+3
| | | | | | | Add a fake config.h pending autotools switchover. Change-Id: I777d7b4399107db058329ab29c9299d68cfbd042 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* python client: general wait utility refactoringBrad Bishop2016-09-201-23/+59
| | | | | | | | | Use a lambda in the wait utility rather than a special wrapper class. Remove unnecessary callback parameters. Add an error callback keyword argument. Change-Id: I8e759cf6fee5eaf9bf4ac44e7ff6576ced4c16a6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* sdbus client: Add proper error handling for ENOENTBrad Bishop2016-09-201-4/+4
| | | | | | | Prior, a server error causes the client to hang rather than exit. Change-Id: I34533358df6227798b970f1214b574b6e5bcec47 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* server: unmask ObjectManager signalsBrad Bishop2016-09-201-0/+1
| | | | | | | | This slipped by after pyphosphor changed the startup mask state for signals in the ObjectManager/Properties bindings. Change-Id: I16ff8bb4dc348c158abdbde4671886565e3ad309 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* server: non-blocking service discoveryBrad Bishop2016-09-201-92/+107
| | | | | | | Remove all remaining blocking dbus calls. Change-Id: I00f87550a7877e207151ce647e04660cbab6ac94 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* sdbus client: add retriesBrad Bishop2016-09-204-14/+118
| | | | | | | Handle busy responses from the server with retries. Change-Id: I8c13faddec1bfaffe702609f2e682e8b1181946d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* python client: add retriesBrad Bishop2016-09-201-11/+35
| | | | | | | Handle busy responses from the server with a retry. Change-Id: I3b9f6746c7eedb5c7421e032539b15e241eb872e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* server: prepare for non-blocking discoveryBrad Bishop2016-09-201-8/+72
| | | | | | | | | | | Add deferred signal handling capability, in preparation for receiving signals during service discovery. Add a "busy" exception for method calls during service discovery. Change-Id: Id52efbb4f57837c0f449025cfdcb17965c757220 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* server: remove dbus_find_interfacesBrad Bishop2016-09-201-13/+19
| | | | | | | | | This can be a blocking call, so refactor discovery such that an org.freedesktop.Properties.Get call is invoked at discovery time for instrospected objects with associations. Change-Id: I9c4d54bbc3834c7970eac23cba4045fc4dd0cd6a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* server: remove discovery asyncBrad Bishop2016-09-201-18/+10
| | | | | | | | | Move a number of initialization items out of the initial discovery into the Mapper constructor. No functional impact but faciliates refactoring in prep for non-blocking discovery. Change-Id: Ida97a3829166dbbf55481f58ffd13474660d7afc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* server: remove unused tagmatchBrad Bishop2016-09-201-1/+0
| | | | | Change-Id: I179b6a043067f25ea7edfc2db23ed48763a5319a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* server: examine all servicesBrad Bishop2016-09-201-11/+4
| | | | | | | | | Remove the name_match and instrospect all services on the DBus. This is required as there are no restrictions on the names claimed by services that put objects in the /org/openbmc namespace. Change-Id: I38646addddde0de0ca4ec4605468f7c9c551bbd8 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* server: add subtree match keyword argumentBrad Bishop2016-09-201-2/+9
| | | | | | | Ensure only objects in the /org/openbmc namespace are added to the mapper cache. Change-Id: I3d6106f77bf8f49eb20719942e76620f0ee6648d
* server: change optional argument to a keywordBrad Bishop2016-09-201-3/+6
| | | | | Change-Id: I5b6b6a0d80eca208362e623506b49d8920cebd5f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud