summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Fix license headers causing XML formatting errorsJonathan Maw2016-09-212-2/+2
| | | | | | In some versions of python, the XML parser was unable to cope with the XML identifier coming after the comment that contained the license header.
* Change docs license to CC-BY-SA 4.0 and update licensing to GENIVI standardJonathan Maw2015-04-308-30/+128
| | | | | | | | | | | | | | | | The previous docs format, CC 1.0, is not recommended by GENIVI, and the preferred one is CC-BY-SA 4.0. Other license changes are: * Add Creative Commons copyright headers to documentation. * Add copyright headers to test code. * Add copyright headers to dbus XML that belongs to the NSC. * Update copyright headers to GENIVI's standard. Notable exceptions are: * dbus XML that is used to communicate with other services (e.g. common/nsm-consumer-dbus.xml) has not had copyright statements added, because the Node Startup Controller does not own that interface.
* Adjust NSM Consumer D-Bus interface to match the real NSMJannis Pohlmann2012-10-101-2/+2
|
* Expand description for ShutdownClientJonathan Maw2012-08-101-1/+13
| | | | Adds some information about the data it contains.
* Rename all com.contiautomotive to org.geniviJonathan Maw2012-08-104-13/+13
|
* Add documentation to the ShutdownClient classJonathan Maw2012-08-071-5/+127
|
* Improve WatchdogClient documentation a bitJannis Pohlmann2012-08-071-6/+10
|
* Add documentation for the WatchdogClient classJonathan Maw2012-08-071-0/+23
|
* Add a type check to avoid a proxy to skeleton cast to failFrancisco Redondo Marchena2012-08-061-2/+3
| | | | | | | | We use the "consumer" property of the ShutdownClient class to store a proxy in the NSC code and a skeleton in the NSM dummy code. When releasing the consumer in shutdown_client_finalize(), we may therefor not cast to a ShutdownConsumerSkeleton unconditionally; otherwise the NSM dummy will segfault when releasing ShutdownClient objects.
* Unregister exported D-Bus objects on finalizationJonathan Maw2012-08-021-1/+4
| | | | | | | | | Adds unregistration to the following services: * legacy app handler * shutdown client * node startup controller * nsm dummy lifecycle control * nsm dummy consumer
* Rename all remaining bits and piecesJannis Pohlmann2012-07-314-31/+42
|
* Rewrite TargetStartupMonitor to monitor ActiveState properties of unitsJannis Pohlmann2012-07-311-9/+9
|
* Fix built sources not always being built in common/Makefile.amJannis Pohlmann2012-07-311-1/+1
|
* Add missing parentheses in macro definitionsJannis Pohlmann2012-07-312-2/+2
| | | | | These are difficult to spot but shouldn't have caused any problems so far because we never use the affected macros in our code.
* Fix missing build rules for .c files of generated D-Bus sourcesFrancisco Redondo Marchena2012-07-301-11/+20
| | | | | | | The order in which make processes the source files can be random. So sometimes it will pick the -dbus.c file before the -dbus.h file. This commit makes sure that we have a rule to build both in the Makefile.am instead of just having a rule for the -dbus.h file.
* Apply a few changes to fix make distcheck and regular buildsJannis Pohlmann2012-07-301-2/+2
|
* Set node state in the TargetStartupMonitor when certain targets startedFrancisco Redondo Marchena2012-07-272-0/+69
| | | | | | | Set the node state from the TargetStartupMonitor when certain targets have been started (focussed, unfocussed, lazy). Also, add a NSMNodeState enum type to nsm-enum-types.{c,h}.
* Make NSMShutdownType a flags type rather than an enum typeJannis Pohlmann2012-07-263-32/+57
| | | | | | This makes more sense because enums are not supposed to be combined using bitwise operators. Flags, however, exist exactly for this purpose.
* Handle re-registration of shutdown clients by updating the mode/timeoutJannis Pohlmann2012-07-262-0/+42
| | | | | | | | Whenever a shutdown client (now identified only by the bus name and object path instead of bus name, object path and shutdown mode) is registered a second or third time, we simply update the shutdown mode by combining the old and new one with a bitwise OR. The shutdown timeout is also replaced with the new one.
* Improve shutdown handling, keep shutdown clients around afterwardsJannis Pohlmann2012-07-252-2/+4
| | | | | | | | | | | | | Use the new ShutdownClient class to bundle information about registered shutdown clients and their units, modes and timeouts. Do not remove shutdown clients from the registered clients list after shutting them down. Instead, wait for a separate unregister request. Shut clients down mode by mode when receiving SIGINT. Start with clients registered for fast, then continue with clients registered for normal. Improve logging output a little bit.
* Add new ShutdownClient class to bundle information about consumersJannis Pohlmann2012-07-244-2/+362
| | | | | | Objects of this class store the bus name, the object path, the shutdown mode, the shutdown timeout and a ShutdownConsumer proxy or skeleton for a shutdown consumer.
* Add a stand-alone legacy-app-handler helper, work on testsJannis Pohlmann2012-07-242-14/+58
| | | | | | | | | | | | The new legacy-app-helper binary translates the shutdown mode strings into NSMShutdownType enum values and passes them on to the legacy app handler D-Bus service. Thus, this commit also updates the org.genivi.BootManager1.LegacyAppHandler interface to use an int for the shutdown mode. This commit furthermore drops the old command-line handling code in the boot manager and reworks the legacy-app-handler tests a little bit.
* Define enums for shutdown mode, error and status code.Francisco Redondo Marchena2012-07-232-0/+120
| | | | Define enums for shutdown mode, error and status code.
* Update NSM-related D-Bus interfaces and codegenJonathan Maw2012-07-234-16/+36
| | | | | | | | | | | | | Change all instances of conti to contiautomotive in bus names, object paths and interfaces. Change shutdown consumers' interface to com.contiautomotive.NodeStateManager.LifeCycleConsumer and replace the Shutdown() method with a LifecycleRequest() method which takes arguments "Request", "RequestId" and returns "ErrorCode". In addition, this commit removes the ShutdownConsumerService object and handles all shutdown consumers directly in the legacy app handler.
* Add a dummy-implementation of the Node State Manager and use itFrancisco Redondo Marchena2012-07-196-0/+415
| | | | | | | | | The Node State Manager (NSM) dummy has all the interfaces relevant to the Boot Manager, and can be instructed to shut down all its shutdown consumers when a SIGINT signal is sent. The Legacy App Handler will connect to the NSM dummy and register shutdown consumers to it.
* Merge into one process, change D-Bus interfaces and write LUC to fileJonathan Maw2012-07-179-797/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following changes were made: - Restructure the D-Bus interfaces: -- The old boot manager interface is removed, we are no longer interested in being a remote controller of systemd. -- The LUC Handler has been rewritten and renamed to org.genivi.BootManager1.BootManager. It has the following methods: --- BeginLUCRegistration() initializes the LUC registration sequence at shutdown. --- RegisterWithLUC(a{ias}) registers one or more apps with different LUC types. --- FinishLUCRegistration() finishes the LUC registration sequence and atomically replaces the previous LUC. -- The legacy application handler has been renamed to org.genivi.BootManager1.LegacyAppHandler. This interface is not for external use. It is meant only for the command- line interface to communicate with the boot manager. -- The LastUserContext property has been removed. - The last user context is now stored in a file rather than with GSettings. This was requested after the Gothenburg F2F, but is included because it is easier to make the change now than modify GSettings only to remove it later. - All services run as part of the same process (i.e. boot-manager). - All services run on the system bus. Because of this, the boot manager's command-line interface is handled differently, as the previous implementation, using GApplication, does not work on the system bus. The command-line interface now works by making a D-Bus call to the boot manager service, instead of using GApplication's remote command-line functionality. - The LUC Handler tests have been renamed to the boot manager tests, and are changed in line with the new interface methods. Note: The legacy app handler tests have not yet been modified to work with these changes.
* Create a shutdown consumer object for every --register activationJonathan Maw2012-07-054-0/+445
| | | | | | | | | | On receiving a --register command line, or a call to the Register() method, the legacy app handler will create a shutdown consumer object (although it will not register it with the NSM yet). When something (e.g. the NSM) tells the shutdown consumer to shut down, it emits the signal "shutdown-requested", which the Legacy App Handler listens for. The Legacy App Handler responds to the "shutdown-requested" signal by calling the boot manager's Stop() method.
* Define D-Bus interface for Shutdown ConsumersJonathan Maw2012-06-292-1/+48
| | | | | | | | | | | | | Shutdown Consumers are D-Bus objects that exist for every application that does not have a Shutdown() method, and are registered with the Node State Manager (NSM). When the NSM shuts down, it calls Shutdown() to all Shutdown Consumers in reverse order to their registration. For legacy applications, a Shutdown Consumer is created and registered with the NSM. When the Shutdown Consumer is told to shut down, it shuts down the legacy application by signalling the Boot Manager.
* Add convenience library 'libcommon.la'Jonathan Maw2012-06-291-0/+30
| | | | | | Reference to individual components of the 'common' directory in components' respective makefiles are replaced with reference to the convenience library 'libcommon.la'
* Fix compiler warnings and add --enable-debug=no to make distcheckJannis Pohlmann2012-06-151-3/+0
|
* Implement org.genivi.LUCHandler1.Deregister()Jonathan Maw2012-06-141-1/+2
| | | | | | | | | | | This commit implements the "handle-deregister" signal handler of the LUCHandler interface skeleton. It essentially copies the current last user context and drops all the apps that are part of the Deregister() call. It then updates the org.genivi.LUCHandler1:LastUserContext property. The deregistration algorithm makes sure that LUC types for which no apps are registered anymore are dropped from the LUC entirely.
* Implement org.genivi.LUCHandler1.Register()Jonathan Maw2012-06-142-0/+58
| | | | | | | | | | | | | | | | | This commit implements the "handle-register" signal handler of the LUCHandler interface skeleton by merging the current LUC and the newly registered LUC types/apps and updating the org.genivi.LUCHandler1:LastUserContext property. It makes sure that the order in which LUC types are added to the final GVariant as dictionary keys is always the same (alphabetical order). This makes testing easier as D-Bus and GVariant both preserve the order of dictionary keys (unlike with a GHashTable). This commit also introduces common/glib-extensions.{c,h} where we can dump functions that extend GLib in simple ways. The first helper function is g_variant_string_array_has_string() which we use to check if a string is included in a string array GVariant.
* Fix coding style, parameter alignments and an unused variableJannis Pohlmann2012-06-131-4/+5
|
* Update systemd's watchdog timeout in luc-handler using WatchdogClientJannis Pohlmann2012-06-132-0/+218
WatchdogClient is a new class that takes a timeout and asks systemd to update its watchdog timeout in regular intervals using sd_notify().