Francisco Redondo Marchena [Fri, 3 Aug 2012 13:20:15 +0000 (14:20 +0100)]
Fix the title of the Test legacy application handler.
Replace the previous title by "Tests for legazy application handling".
Fix some paragraphs.
Jonathan Maw [Fri, 3 Aug 2012 12:20:59 +0000 (13:20 +0100)]
Better test case titles and always set the node state in TSM tests
Test titles are made more descriptive by including the name of the node
state which is being set.
A link is included to the enum which defines the NSMNodeState.
Tests are changed to always set the node state. This is done by
starting the unit twice in most cases. In addition, the less-important
lines in the DLT log output are no longer specified.
Capitalization in titles has been cleaned up somewhat.
Francisco Redondo Marchena [Fri, 3 Aug 2012 11:30:42 +0000 (12:30 +0100)]
Add the documentation for legacy app handling tests
Add the documentation for legacy app handling tests.
The following tests are provided:
1. Register a normal and a fast shutdown consumer.
- Check that node-startup-controller.service registers itself
as a shutdown consumer.
- Check that the registration for the shutdown consumer are ok.
- Check that in the process of shutting down the fast consumers
shutting down first and the normal consumers second.
- Check that the shutdown consumers are unregister as a shutdown
consumers when they have been shutting down.
- Check that node-startup-controller.service unregisters itself
as a shutdown consumer when it has been shutting down.
2. Register two normal shutdown consumers
- Check that in the process of shutting down the consumers are
shutting down in reverse order of registration.
3. Register a shutdown consumer twice within different modes and timeouts
- Check that the re-registration modify the final mode to a combination
of both modes (normal and fast) and the timeout has been set to the
last registration value of timeout.
- Check that in the process of shutting down the consumer is shutting down
for the both modes.
4. Register a shutdown consumer with invalid arguments
- Check that register a consumer without unit name fails.
- Check that register a consumer within mode 0 fails
- Check that register a consumer with a negative timeout fails.
Francisco Redondo Marchena [Fri, 3 Aug 2012 09:27:27 +0000 (10:27 +0100)]
Document that timeout is non-mandatory parameter and its default value
Modify in the documentation for legacy app handler that timeout is a
non-mandatory legacy app handler argument and its default value is
1000 milliseconds.
Jannis Pohlmann [Fri, 3 Aug 2012 11:55:51 +0000 (12:55 +0100)]
Add NSM dummy documentation page
Jonathan Maw [Fri, 3 Aug 2012 10:33:58 +0000 (11:33 +0100)]
Restructure and number the Target Startup Monitoring tests
Tests are restructured in the same way as the previous commit
Jonathan Maw [Fri, 3 Aug 2012 09:57:33 +0000 (10:57 +0100)]
Number and restructure luc management test cases
Test cases are restructured into:
* Description
* Test Commands
* Desired behaviour and Output
Jannis Pohlmann [Fri, 3 Aug 2012 10:57:10 +0000 (11:57 +0100)]
Add missing XML files to the reference manual Makefile.am
Jannis Pohlmann [Fri, 3 Aug 2012 09:56:03 +0000 (10:56 +0100)]
Work on documentation of functional scope and interfaces
Also fix a mistyped systemd command.
Jannis Pohlmann [Thu, 2 Aug 2012 17:42:22 +0000 (18:42 +0100)]
Rework reference manual a bit, start reworking test case layout
Jonathan Maw [Thu, 2 Aug 2012 14:20:51 +0000 (15:20 +0100)]
Split test scenarios into separate pages, add legacy app skeleton
Each test scenario (i.e. luc, legacy app, tsm) has been split into a
separate file.
Setup steps which have to be performed for every scenario are moved into
test-general-setup.xml
Cross-references are used so that the test overview links to each test
case, and the "Testing" page links to the general setup and also each
test.
test-example has been removed because it is no longer necessary.
Jonathan Maw [Thu, 2 Aug 2012 08:44:33 +0000 (09:44 +0100)]
Add test scenarios for the Last User Context handling
The following test scenarios are added to the documentation:
* Registration of a simple dictionary
* Registration does not happen on an isolated RegisterWithLUC() call
* An isolated FinishLUCRegistration() call will not change the LUC
* Registration of a complex dictionary
* Registration can happen with a series of RegisterWithLUC() calls
* Repeated registration of an app changes the order in the LUC
Jonathan Maw [Wed, 1 Aug 2012 13:08:41 +0000 (14:08 +0100)]
Specify difference between NSM and NSM dummy in docmentation
Explicitly states the difference between the Node State Manager Dummy
and the real Node State Manager, i.e.
* The NSM dummy toggles between successfully setting the node state
and failing to set the node state.
* The NSM dummy toggles between the LUC being required, and the LUC
not being required.
* The NSM dummy will shut down its fast shutdown clients, then its
normal shutdown clients, on receiving the SIGHUP signal
Jonathan Maw [Wed, 1 Aug 2012 12:30:59 +0000 (13:30 +0100)]
Add TSM test and improve layout of test document
The improvements to the layout of the test document are that the
individual tests will now show up on the table of contents.
The Target Startup Monitor (TSM) tests check that the following cases
attempt to change the node state:
* The Node Startup Controller starting
* focussed.target starting
* unfocussed.target starting
* lazy.target starting
The following case should not attempt to change the node state:
* focussed.target stopping
Jonathan Maw [Wed, 1 Aug 2012 09:22:54 +0000 (10:22 +0100)]
Add testing skeleton
Lays out the structure of the test document XML
Jannis Pohlmann [Thu, 2 Aug 2012 14:15:55 +0000 (15:15 +0100)]
Change required version of systemd from 37 to 183
Jannis Pohlmann [Thu, 2 Aug 2012 14:14:03 +0000 (15:14 +0100)]
Fix build instructions to include creating the m4 directory
Jonathan Maw [Thu, 2 Aug 2012 10:10:49 +0000 (11:10 +0100)]
Unregister exported D-Bus objects on finalization
Adds unregistration to the following services:
* legacy app handler
* shutdown client
* node startup controller
* nsm dummy lifecycle control
* nsm dummy consumer
Jannis Pohlmann [Wed, 1 Aug 2012 16:31:50 +0000 (17:31 +0100)]
Rework log messages a bit to make them more readable
Jannis Pohlmann [Wed, 1 Aug 2012 15:47:50 +0000 (16:47 +0100)]
Use DLT_LOG_INFO rather than DLT_LOG_DEBUG for everything
We can't get DLT to log our debug messages, setting LoggingLevel to 7
(LOG_DEBUG) in /etc/dlt.conf does not work as expected. So for now we'll
have to resort to logging all debug messages as info messages.
Jannis Pohlmann [Wed, 1 Aug 2012 15:04:02 +0000 (16:04 +0100)]
Adjust DLT log levels (info -> debug, some warnings, some errors)
Jannis Pohlmann [Wed, 1 Aug 2012 14:48:35 +0000 (15:48 +0100)]
Exclusively use DLT facilities to build log strings
We used to build the log strings using g_strdup_printf() but this
results in a certain amount of overhead and extra code.
Jannis Pohlmann [Wed, 1 Aug 2012 12:48:09 +0000 (13:48 +0100)]
Fix the name used for the LUCStarter::node-startup-controller property
Jannis Pohlmann [Wed, 1 Aug 2012 11:37:08 +0000 (12:37 +0100)]
Replace g_debug/g_warning calls with DLT logging
Jannis Pohlmann [Wed, 1 Aug 2012 11:26:29 +0000 (12:26 +0100)]
Unregister the NSM dummy DLT connection at exit
Jannis Pohlmann [Tue, 31 Jul 2012 18:17:18 +0000 (19:17 +0100)]
Fix small issues in Makefiles to make "make distcheck" happy
Jannis Pohlmann [Tue, 31 Jul 2012 18:06:03 +0000 (19:06 +0100)]
Rename all remaining bits and pieces
Jannis Pohlmann [Tue, 31 Jul 2012 17:41:33 +0000 (18:41 +0100)]
Rename service files and boot-manager binary
Jannis Pohlmann [Tue, 31 Jul 2012 17:36:44 +0000 (18:36 +0100)]
Rename BMGR DLT app ID to NSC, rename MGR context to CTRL
Jannis Pohlmann [Tue, 31 Jul 2012 17:32:30 +0000 (18:32 +0100)]
Rename BootManagerApplication to NodeStartupControllerApplication
Jannis Pohlmann [Tue, 31 Jul 2012 17:15:06 +0000 (18:15 +0100)]
Rename boot manager D-Bus interface and BootManagerService class
Jannis Pohlmann [Tue, 31 Jul 2012 16:45:10 +0000 (17:45 +0100)]
First step of renaming the Boot Manager to Node Startup Controller
This includes mostly files, directories and the package/tarball name.
The classes and D-Bus interfaces will be renamed in the next step.
Francisco Redondo Marchena [Tue, 31 Jul 2012 15:52:06 +0000 (16:52 +0100)]
Query the "active-state" property of units in the "job-removed" handler
Our previous attempt to fix the TargetStartupMonitor failed because when
a target is stopped, systemd drops the unit from the system bus and the
proxies we created in TargetStartupMonitor were no longer associated
with these unit objects that previously existed on the bus. When such a
target is started again, the proxy will no longer receive property
change signals from systemd.
This commit tries to implement the TargetStartupMonitor in yet another
way, which is to listen to systemd's "job-removed" signal again. In
response to receiving "job-removed" signals, we now create a SystemdUnit
for the affected unit and query that for its current "active-state"
value. Perhaps this will work.
Francisco Redondo Marchena [Tue, 31 Jul 2012 15:17:07 +0000 (16:17 +0100)]
Avoid a segmentation fault by fixing a GVariant format string
Francisco Redondo Marchena [Tue, 31 Jul 2012 14:55:51 +0000 (15:55 +0100)]
Retrieve invalidated properties before emitting "g-properties-changed"
It seems like the "active-state" property might be part of the
invalidated properties, not the changed ones. By passing
G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES to the proxy constructor
we force GDBusProxy to retrieve the new "active-state" value before
calling "g-properties-changed".
Hopefully this will fix TargetStartupMonitor for real.
Francisco Redondo Marchena [Tue, 31 Jul 2012 14:34:23 +0000 (15:34 +0100)]
Try the units' "g-properties-changed" signal to monitor the active state
For some reason the cached "active-state" property of the SystemdUnit
objects was NULL even when the "notify::active-state" signal had been
emitted.
Francisco Redondo Marchena [Tue, 31 Jul 2012 13:55:35 +0000 (14:55 +0100)]
Remove the assertion for an unused parameter
Apparently the callback for g_dbus_proxy_new() does not receive a
GDBusConnection as the first parameter, so this assertion fails.
However, since we don't need the parameter, we can just drop the
assertion.
Jannis Pohlmann [Tue, 31 Jul 2012 15:12:24 +0000 (16:12 +0100)]
Rework small bits of the legacy-app-handler documentation
Jonathan Maw [Tue, 31 Jul 2012 14:57:40 +0000 (15:57 +0100)]
Document the legacy app handler API
Jannis Pohlmann [Tue, 31 Jul 2012 12:20:06 +0000 (13:20 +0100)]
Rewrite TargetStartupMonitor to monitor ActiveState properties of units
Francisco Redondo Marchena [Tue, 31 Jul 2012 10:17:05 +0000 (11:17 +0100)]
Try to query systemd jobs synchronously in the "job-removed" handler
When we query the jobs asynchronously, systemd might have removed the
job we are looking for, and it will not be in the list of jobs it
returns. Perhaps querying jobs synchronously in the "job-removed"
handler helps to work around that.
Francisco Redondo Marchena [Tue, 31 Jul 2012 10:03:05 +0000 (11:03 +0100)]
Revert "Indicate the system manager that the job remove callback finished."
This reverts commit
97e53e2458589c5a7f7ad65b5af45626fa4d1ea1.
The "job-removed" signal doesn't expect signal handlers to return a
boolean value, so adding such a return value to our handlers will not
have any effect.
Jannis Pohlmann [Tue, 31 Jul 2012 09:59:17 +0000 (10:59 +0100)]
Fix built sources not always being built in common/Makefile.am
Jannis Pohlmann [Tue, 31 Jul 2012 09:52:06 +0000 (10:52 +0100)]
Add missing parentheses in macro definitions
These are difficult to spot but shouldn't have caused any problems
so far because we never use the affected macros in our code.
Jannis Pohlmann [Tue, 31 Jul 2012 09:45:28 +0000 (10:45 +0100)]
Remove LUC registration debug output
Francisco Redondo Marchena [Tue, 31 Jul 2012 07:15:28 +0000 (08:15 +0100)]
Indicate the system manager that the job remove callback finished.
Return a boolean to indicate is the job remove callback was
successful or failure.
Francisco Redondo Marchena [Mon, 30 Jul 2012 17:04:31 +0000 (18:04 +0100)]
Add even more debug output to TargetStartupMonitor
Francisco Redondo Marchena [Mon, 30 Jul 2012 16:31:55 +0000 (17:31 +0100)]
Add more debugging output to TargetStartupMonitor
Francisco Redondo Marchena [Mon, 30 Jul 2012 16:09:33 +0000 (17:09 +0100)]
Fix missing build rules for .c files of generated D-Bus sources
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.
Jannis Pohlmann [Mon, 30 Jul 2012 14:51:04 +0000 (15:51 +0100)]
Remove unused org.freedesktop.systemd1.Manager D-Bus methods
We don't need to generate code for these methods unless we actually
intend to use them.
Francisco Redondo Marchena [Mon, 30 Jul 2012 13:21:23 +0000 (14:21 +0100)]
Set the node state only in response to start jobs
The node state only should be set it for systemd start jobs.
To avoid setting the node state for other types of jobs like kill,
stop etc. we query systemd for a list of all jobs and check if
the type of the removed job is "start". Only then do we change
the node state.
Jannis Pohlmann [Mon, 30 Jul 2012 14:43:14 +0000 (15:43 +0100)]
Apply a few changes to fix make distcheck and regular builds
Jannis Pohlmann [Mon, 30 Jul 2012 13:45:54 +0000 (14:45 +0100)]
Add initial version of the reference manual templates
Most of the chapters in this manual still need to be written but this
is a start.
Jannis Pohlmann [Fri, 20 Jul 2012 14:24:52 +0000 (15:24 +0100)]
Add rudimentary gtk-doc support to the project
This includes adjusting the configure script to check for gtk-doc as
well as creating the necessary directories and Makefile.am files.
At the moment, no documentation is generated. We'll have to add initial
templates that include the docbook XML generated for the D-Bus API.
Francisco Redondo Marchena [Fri, 20 Jul 2012 11:41:29 +0000 (12:41 +0100)]
Add option to gdbus-codegen to generate DocBook for the public interface
Add --generate-docbook to gdbus-codegen in Makefile.am in order to
get the documentation for org.genivi.BootManager1.BootManager
interface. It makes a .xml file called
boot-manager-dbus-doc-org.genivi.BootManager1.BootManager.xml
Jannis Pohlmann [Mon, 30 Jul 2012 12:18:38 +0000 (13:18 +0100)]
Add build dependencies to the README file
Jannis Pohlmann [Mon, 30 Jul 2012 12:12:41 +0000 (13:12 +0100)]
Add licensing/build/testing instructions to the README file
Jannis Pohlmann [Fri, 27 Jul 2012 15:50:22 +0000 (16:50 +0100)]
Fix make distcheck, rework tests, reorganise files
This commit fixes make distcheck by making the LUC handler test part of
"make installcheck" and by disabling the legacy app tests in "make
check".
For the LUC handler test to not interfere with the LUC on the system,
the boot-manager binary is now aware of a LUC_PATH environment variable
that overrides the LUC_PATH string defined at build-time. This way we
can use a different LUC file for the test.
This commit also drops the nsm-dummy/dbus/ and nsm-dummy/systemd/
directories and moves the corresponding files to nsm-dummy/.
Jannis Pohlmann [Sat, 28 Jul 2012 15:27:08 +0000 (16:27 +0100)]
Fix a crash caused by using the old JobRemoved signature in JobManager
The signature of the JobRemoved signal recently changed in systemd, when
a new "unit" parameter was added. This commit changes the JobManager to
include this parameter in its JobRemoved handler and thereby avoids
segmentation faults caused by assuming fourth parameter is a JobManager
object.
Jannis Pohlmann [Sat, 28 Jul 2012 14:41:47 +0000 (15:41 +0100)]
Log more information when completing lifecycle requests
Jannis Pohlmann [Fri, 27 Jul 2012 16:43:15 +0000 (17:43 +0100)]
Use $(sysconfdir) and $(libdir) in NSM dummy Makefiles
Francisco Redondo Marchena [Fri, 27 Jul 2012 12:55:18 +0000 (13:55 +0100)]
Set node state in the TargetStartupMonitor when certain targets started
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}.
Jannis Pohlmann [Fri, 27 Jul 2012 13:27:15 +0000 (14:27 +0100)]
Use the WATCHDOG_USEC env variable to define the watchdog timeout
Also, set WatchdogSec to 5 seconds in boot-manager.service.in and
nsm-dummy.service.in.
The way this works is that systemd will take the WatchdogSec value,
convert it to micro-seconds and set the WATCHDOG_USEC environment
variable for the boot manager or nsm-dummy process. The boot manager
or NSM dummy then halves that value and creates the WatchdogClient
so that it calls sd_notify(0, WATCHDOG=1) twice in each
WATCHDOG_USEC interval. If WATCHDOG_USEC can't be parsed into a
number or if it is not set, the systemd watchdog timestamp is
never updated.
This is what systemd's requires services to do in order to support its
watchdog feature properly.
Jannis Pohlmann [Fri, 27 Jul 2012 11:29:43 +0000 (12:29 +0100)]
Add 'luc-groups-started' signal to send sd_notify(READY=1) to systemd
We need to notify systemd when the boot manager process has finished
starting the LUC. What we did so far was to call sd_notify() while
constructing the BootManagerApplication. This commit adds a
'luc-groups-started' signal to LUCStarter. BootManagerApplication now
connects to that in order to call sd_notify() at the right time.
Francisco Redondo Marchena [Thu, 26 Jul 2012 17:42:44 +0000 (18:42 +0100)]
Unregister the boot manager itself as a shutdown client
Unregister the boot manager as a shutdown client after it has been
shutting down. Handle gracefully the application lifecycle request to
manage the shutting down and the unregistration correctly.
Francisco Redondo Marchena [Thu, 26 Jul 2012 17:40:12 +0000 (18:40 +0100)]
Avoid compiler warnings due to casting pointers to uint
Francisco Redondo Marchena [Thu, 26 Jul 2012 15:26:40 +0000 (16:26 +0100)]
Check with NSM whether to load the LUC or not
If the NSM is not available or the NSMLifecycleControl proxy cannot be
created, we assume that we should start the LUC anyway.
Jannis Pohlmann [Thu, 26 Jul 2012 16:25:35 +0000 (17:25 +0100)]
Upon receiving SIGHUP, shut down all clients asynchronously
This is done by asynchronously processing the list of registered
shutdown clients once for each shutdown mode. We start with fast and
then continue with normal once all clients registered for fast shutdown
have been shut down.
This commit also implements waiting for pending lifecycle requests using
a timeout and advances to the next client in the queue if the timeout is
triggered before LifecycleRequestComplete is called by the client we are
currently waiting for.
Jannis Pohlmann [Thu, 26 Jul 2012 15:59:49 +0000 (16:59 +0100)]
Make sure to release the NSMConsumer in LAHandlerService
Otherwise we'd be leaking memory
Jannis Pohlmann [Thu, 26 Jul 2012 13:07:59 +0000 (14:07 +0100)]
Fix LifecycleRequest handler by returning a boolean value
This caused a GLib-internal critical warning about g_object_unref being
called with something that wasn't a GObject. It works fine now.
Francisco Redondo Marchena [Thu, 26 Jul 2012 11:12:31 +0000 (12:12 +0100)]
Register boot manager itself as a shutdown consumer asynchronously
Replace the synchronous registration by an asynchronous
registration for the boot manager. Gracefully handle/ignore any
errors in the finish callback apart from logging them using the DLT
framework.
Jannis Pohlmann [Thu, 26 Jul 2012 12:43:15 +0000 (13:43 +0100)]
Remove debugging output we no longer need
Jannis Pohlmann [Thu, 26 Jul 2012 12:41:33 +0000 (13:41 +0100)]
Make NSMShutdownType a flags type rather than an enum type
This makes more sense because enums are not supposed to be combined
using bitwise operators. Flags, however, exist exactly for this
purpose.
Jannis Pohlmann [Thu, 26 Jul 2012 12:39:11 +0000 (13:39 +0100)]
Move deregistration of shutdown consumers into LAHandlerService
LAHandlerService is a better place for this functionalit than
BootManagerApplication. Apart from this deregistration, anything related
to legacy app shutdown consumers is already handled solely by the
LAHandlerService anyway, so it makes sense to move the deregistration
there as well.
Jannis Pohlmann [Thu, 26 Jul 2012 12:36:52 +0000 (13:36 +0100)]
Allow shutdown consumers for legacy apps to be re-registered
Until now we always ignored re-registrations of legacy apps. In order
to allow the shutdown mode or timeout of a shutdown consumer for a
legacy app to be updated, however, this commit now forwards legacy app
re-registrations to the NSM.
Jannis Pohlmann [Thu, 26 Jul 2012 10:51:35 +0000 (11:51 +0100)]
Use an int for the --shutdown-mode/-m option of legacy-app-handler
This allows to register for multiple modes at the same time, e.g. by
passing in 3 for normal and fast.
Jannis Pohlmann [Thu, 26 Jul 2012 10:10:16 +0000 (11:10 +0100)]
Handle re-registration of shutdown clients by updating the mode/timeout
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.
Francisco Redondo Marchena [Wed, 25 Jul 2012 14:05:52 +0000 (15:05 +0100)]
Deregister shutdown consumer when shutting down boot manager
Implement deregister shutdown consumer when boot manager is
shutting down. Change the shutdown tables replacing shutdown
consumers by shutdown clients. Modify in the same terms the
boot manager registration (from shutdown consumer registration
to shutdown client registration).
Jannis Pohlmann [Wed, 25 Jul 2012 14:20:51 +0000 (15:20 +0100)]
Fix the previous commit, forgot to rename the SIGINT handler
Jannis Pohlmann [Wed, 25 Jul 2012 13:55:27 +0000 (14:55 +0100)]
Use SIGHUP instead of SIGINT for simulating an NSM shutdown
In the SIGHUP handler, we no longer shut down the NSM process so that we
can keep it around for debugging purposes.
Jannis Pohlmann [Wed, 25 Jul 2012 13:52:06 +0000 (14:52 +0100)]
Fix corrupted list after reverse shutdown client traversal
The problem is that g_list_reverse() modifies the list in place, so in
order to not corrupt the shutdown client list of the NSMConsumerService,
we would have to copy the list. What this commit does instead is to not
call g_list_reverse() and instead traverse the list in reverse order
directly.
This commit also improves the shutdown logging a bit.
Jannis Pohlmann [Wed, 25 Jul 2012 13:49:33 +0000 (14:49 +0100)]
Implement the LifecycleRequestComplete by logging request ID and status
Jannis Pohlmann [Wed, 25 Jul 2012 13:45:44 +0000 (14:45 +0100)]
Start the boot manager D-Bus services in main()
Before we started them in boot_manager_application_constructed() but
that meant that we could not react to errors properly. We now log a
fatal error using the DLT framework and exit if we can't bring up the
D-Bus services.
Jannis Pohlmann [Tue, 24 Jul 2012 15:51:11 +0000 (16:51 +0100)]
Improve shutdown handling, keep shutdown clients around afterwards
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.
Jannis Pohlmann [Tue, 24 Jul 2012 16:18:14 +0000 (17:18 +0100)]
Add new ShutdownClient class to bundle information about consumers
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.
Francisco Redondo Marchena [Tue, 24 Jul 2012 12:16:04 +0000 (13:16 +0100)]
Implement a shutdown consumer for the boot manager itself
Create a ShutdownConsumer skeleton in BootManagerApplication and
implement its "handle-lifecycle-request" signal to shutdown the
process.
In addition to that, the "handle-lifecycle-request" implementation also
cancels the LUC startup. It replaces the SIGINT handler, which is
removed with this commit.
Jannis Pohlmann [Tue, 24 Jul 2012 13:19:32 +0000 (14:19 +0100)]
Fix the systemd unit associated with the boot manager D-Bus service
Jannis Pohlmann [Tue, 24 Jul 2012 13:18:50 +0000 (14:18 +0100)]
Rename gvariant_writer.c to gvariant-writer.c
We don't use underscores in filenames anywhere else so why would we do
that here?
Jannis Pohlmann [Mon, 23 Jul 2012 16:41:17 +0000 (17:41 +0100)]
Add a stand-alone legacy-app-handler helper, work on tests
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.
Francisco Redondo Marchena [Mon, 23 Jul 2012 15:18:43 +0000 (16:18 +0100)]
Define enums for shutdown mode, error and status code.
Define enums for shutdown mode, error and status code.
Jannis Pohlmann [Fri, 20 Jul 2012 16:06:42 +0000 (17:06 +0100)]
Drop GApplication, fix D-Bus activation, further NSM integration work
We no longer want GApplication because (a) D-Bus already guarantees that
there is only one unique instance that provides a certain service, (b)
we no longer use the GApplication command-line forwarding anyway and (c)
there might be no session bus anyway. We want to own the bus names on
the system bus and GApplication doesn't help with that.
The D-Bus activation did not work for various reasons: (a) the systemd
.service files had the type set to "notify" instead of "dbus" and also
had BusName set to "foo.bar.baz.service" where it should be just
"foo.bar.baz", (b) the NSM dummy .service files for D-Bus were pointing
to the wrong systemd .service files and were installed under the wrong
name (I think there needs to be one .service file per interface, but
this may not be 100% true).
The rest of this commit is changes necessary for the integration of
the Node State Manager.
Jonathan Maw [Fri, 20 Jul 2012 10:14:02 +0000 (11:14 +0100)]
Update NSM-related D-Bus interfaces and codegen
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.
Francisco Redondo Marchena [Mon, 23 Jul 2012 10:28:18 +0000 (11:28 +0100)]
Install boot-manager.service to $(libdir) rather than /lib
Installing to /lib causes troubly when building the boot manager as part
of the Yocto-based GENIVI Excalibur baseline.
Jannis Pohlmann [Thu, 19 Jul 2012 15:24:08 +0000 (16:24 +0100)]
Improve use of GError and writing to the LUC
Make use of convenience functions for clearing and propagating GErrors.
Drop g_file_create() because g_file_replace_contents() handles the
on-demand file creation for us.
Jannis Pohlmann [Thu, 19 Jul 2012 14:53:53 +0000 (15:53 +0100)]
Fix/finish implementation of integer-based LUC types
This commit fixes the use of integers as keys for GHashTable. It also
parses the prioritised LUC types into integer values and stores them
in a GArray. The code for computing the start order is updated to also
use integers for the startup groups.
This change also fixes luc_starter_compare_luc_types(), which (a) didn't
work at all and (b) had to be converted to comparing integers, not
strings.
Jannis Pohlmann [Thu, 19 Jul 2012 12:46:11 +0000 (13:46 +0100)]
Use $(sysconfdir)/boot-manager/last-user-context to store the LUC file
$(sysconfdir) is where system-wide configuration files belong.
Jannis Pohlmann [Thu, 19 Jul 2012 12:28:58 +0000 (13:28 +0100)]
Improve the initial construction of the GVariant for the new LUC
The GVariantBuilder is now statically allocated on the stack to avoid
memory allocations at run-time. Using g_variant_builder_end() is used
to obtain the new GVariant rather than allocating a new one from the
contents of the builder separately.
Francisco Redondo Marchena [Mon, 25 Jun 2012 17:15:00 +0000 (18:15 +0100)]
Add a dummy-implementation of the Node State Manager and use it
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.
Jannis Pohlmann [Thu, 19 Jul 2012 11:01:57 +0000 (12:01 +0100)]
Move service files back to source directory, rename systemd service file
Jannis Pohlmann [Wed, 18 Jul 2012 13:27:49 +0000 (14:27 +0100)]
Apply a few coding style fixes and adjust a few debug messages