summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Davin McCall [Mon, 23 Nov 2015 09:25:13 +0000 (09:25 +0000)]
Add possibility to retrieve textual description of errors from service
load exceptions.
Davin McCall [Mon, 23 Nov 2015 08:29:05 +0000 (08:29 +0000)]
Control protocol cleanups.
Davin McCall [Mon, 23 Nov 2015 07:42:13 +0000 (07:42 +0000)]
Comment update.
Davin McCall [Mon, 23 Nov 2015 07:39:42 +0000 (07:39 +0000)]
Fix remaining case of ControlConn being used after being deleted.
Davin McCall [Sun, 22 Nov 2015 14:50:13 +0000 (14:50 +0000)]
In processPacket() always check the response of queuePacket(), to
avoid writing to instance variables after the ControlConn instance
has been deleted.
Also make some functions private.
Davin McCall [Sun, 22 Nov 2015 14:27:17 +0000 (14:27 +0000)]
Various control protocol improvements, still needs significant work.
Davin McCall [Sat, 21 Nov 2015 12:30:12 +0000 (12:30 +0000)]
Introduce queuePacket() variant which takes a `const char *` buffer
rather than a pre-made vector. Use it where appropriate to send ACK
responses.
Davin McCall [Sat, 21 Nov 2015 11:29:35 +0000 (11:29 +0000)]
Add function to queue outgoing packet to a control connection.
Davin McCall [Thu, 19 Nov 2015 22:45:29 +0000 (22:45 +0000)]
Move compiler flags out of the Makefile and into mconfig
Davin McCall [Thu, 19 Nov 2015 22:03:51 +0000 (22:03 +0000)]
Various exception handling fixes and 'noexcept' declarations
Davin McCall [Thu, 19 Nov 2015 18:46:22 +0000 (18:46 +0000)]
Remove incorrect comment
Davin McCall [Thu, 19 Nov 2015 18:42:28 +0000 (18:42 +0000)]
Remove functional TODO comments.
Davin McCall [Thu, 19 Nov 2015 18:28:34 +0000 (18:28 +0000)]
Add a control command to initiate service rollback (and receive
notification when rollback is complete).
Davin McCall [Thu, 19 Nov 2015 18:20:34 +0000 (18:20 +0000)]
Fix some logging, and add a variable to track how many control connections
are open. Don't terminate while there are still control connections.
Davin McCall [Thu, 19 Nov 2015 11:24:08 +0000 (11:24 +0000)]
Commit .gitignore
Davin McCall [Thu, 19 Nov 2015 11:02:18 +0000 (11:02 +0000)]
Add the "termsignal" setting to process services. This allows an
additional signal (alongside SIGTERM) to be sent to the process to
terminate it.
Davin McCall [Wed, 18 Nov 2015 22:40:04 +0000 (22:40 +0000)]
Catch allocation exception when receiving a control socket connection
Davin McCall [Wed, 18 Nov 2015 17:13:05 +0000 (17:13 +0000)]
Documentation updates
Davin McCall [Wed, 18 Nov 2015 17:07:09 +0000 (17:07 +0000)]
Improve the state model.
A service now transitions into the STARTING state from the STOPPED state
as soon as start() is called, rather than after all dependencies have
started. Similarly a service enteres the STOPPING state (from STARTED)
immediately when stop() is called.
Forced re-starts should now work properly in all cases.
Davin McCall [Wed, 18 Nov 2015 14:23:35 +0000 (14:23 +0000)]
Add 'dependencyStarted' method instead of directly overloading 'start'
Davin McCall [Tue, 17 Nov 2015 23:13:37 +0000 (23:13 +0000)]
Add sample config for OpenBSD build
Davin McCall [Tue, 17 Nov 2015 23:11:50 +0000 (23:11 +0000)]
Rename 'reboot' variable to 'do_reboot' to avoid conflict with OpenBSD
'reboot' function.
Davin McCall [Tue, 17 Nov 2015 21:24:16 +0000 (21:24 +0000)]
Remove unintentionally committed debug statements
Davin McCall [Tue, 17 Nov 2015 19:25:37 +0000 (19:25 +0000)]
Logging and comment fixes
Davin McCall [Tue, 17 Nov 2015 19:24:28 +0000 (19:24 +0000)]
Add dinit-log.h as a dependency for objects
Davin McCall [Tue, 17 Nov 2015 19:23:29 +0000 (19:23 +0000)]
Improve logging facilities.
Allow variadic 'log' calls, and automatically convert std::string
and int arguments to char * in an exception-free manner.
Davin McCall [Tue, 17 Nov 2015 18:58:22 +0000 (18:58 +0000)]
Fix bug: "internal" services never properly registered that they had
stopped.
Davin McCall [Tue, 17 Nov 2015 10:46:39 +0000 (10:46 +0000)]
Update README
Davin McCall [Tue, 17 Nov 2015 02:01:33 +0000 (02:01 +0000)]
Update TODO list
Davin McCall [Tue, 17 Nov 2015 01:55:51 +0000 (01:55 +0000)]
Several changes, centered around improving logging and handling
read-only initial filesystem.
* introduce basic logging functions
* allow "onstart" commands to specify if console output should
stop and/or if control socket should be opened after a service
starts
* fix a bug in load_service / service constructor interaction,
caused services with arguments to fail
Davin McCall [Mon, 16 Nov 2015 00:28:41 +0000 (00:28 +0000)]
Use C++11 typesafe enums for service type (ServiceType) and state
(ServiceState).
Davin McCall [Sun, 15 Nov 2015 15:42:01 +0000 (15:42 +0000)]
Make start_ps_process more C++ish and prevent it throwing exceptions
The function already has a status result so it doesn't make much
sense to allow exceptions to propogate out of it.
Davin McCall [Sun, 15 Nov 2015 11:28:50 +0000 (11:28 +0000)]
Allow for quoted program arguments (and executable).
In loadServiceRecord(), the 'command' setting was parsed and unquoted
resulting in a single string. Now, the beginning and end of each part
(i.e. the executable and each argument) are recorded so they can be
stored as part of the service record, and nul terminators are stored
behind each part.
Davin McCall [Fri, 13 Nov 2015 18:15:34 +0000 (18:15 +0000)]
Fix comment in relation to vfork (we are using fork instead now)
Davin McCall [Fri, 13 Nov 2015 18:12:37 +0000 (18:12 +0000)]
Minor cleanup: use C++-style cast and add some comments
Davin McCall [Thu, 5 Nov 2015 00:23:35 +0000 (00:23 +0000)]
Back out incorrect comment introduced earlier.
Davin McCall [Wed, 4 Nov 2015 22:14:58 +0000 (22:14 +0000)]
Improve comments - remove no longer relevant comment, add some new comments.
Davin McCall [Wed, 4 Nov 2015 22:08:37 +0000 (22:08 +0000)]
Add parameter documentation for read_setting_value
Davin McCall [Wed, 4 Nov 2015 22:05:20 +0000 (22:05 +0000)]
Augment read_setting_value so that it can return the position (start and end)
of each part of the setting value.
Davin McCall [Wed, 4 Nov 2015 20:17:38 +0000 (20:17 +0000)]
Change parameter type of read_setting_{name,value} from string_iterator pointer to string_iterator reference.
Davin McCall [Wed, 4 Nov 2015 20:14:21 +0000 (20:14 +0000)]
Improve comment.
Davin McCall [Fri, 25 Sep 2015 19:59:16 +0000 (20:59 +0100)]
Add support for "internal" services (which don't actually run any
external process) and enhance config file parsing a little.
Davin McCall [Mon, 14 Sep 2015 20:56:16 +0000 (21:56 +0100)]
Re-vamp the "build system".
Move compiler options etc into make variables in the "mconfig" file.
The main makefile includes the mconfig file, so it shouldn't generally
be necessary to edit the makefile itself. Includes sample config for
GCC and LLVM+libc+++.
Davin McCall [Mon, 14 Sep 2015 20:52:10 +0000 (21:52 +0100)]
Simple cleanups.
Davin McCall [Wed, 9 Sep 2015 19:52:23 +0000 (20:52 +0100)]
Finish soft dependency support.
If a soft dependency fails to start, it no longer cancels its
dependent's start.
Davin McCall [Mon, 7 Sep 2015 17:12:51 +0000 (18:12 +0100)]
Set dependents desired state to STOPPED immediately
when stop of dependency requested.
Previously, if the state was STARTING when the stop
was issued, dependencies were not stopped.
Davin McCall [Mon, 7 Sep 2015 09:44:15 +0000 (10:44 +0100)]
Implement "soft" dependencies. These are created by using
"depends-soft=" in the service file in place of "depends-on=".
If a service stops or dies, it will not cause dependents with
only a soft dependency to stop. This can be used to control
startup order without creating a real dependency.
Note: if a soft dependency fails to start, it still causes the
dependent to also fail to start.
Davin McCall [Sun, 6 Sep 2015 17:35:36 +0000 (18:35 +0100)]
Just adding some comments.
Davin McCall [Sun, 6 Sep 2015 17:34:27 +0000 (18:34 +0100)]
Filter "auto" from the command line. LILO adds it automatically for
non-interactive boots; we can just ignore it.
Davin McCall [Tue, 1 Sep 2015 19:35:33 +0000 (20:35 +0100)]
forceStop() needs to issue stop().
Both were issued when a process died unexpectedly, but in case of
a dependent, forceStop() would be issued without stop() meaning that
the dependent would not actually stop.
Davin McCall [Tue, 1 Sep 2015 19:20:00 +0000 (20:20 +0100)]
Properly intiiatiise force_stop
Davin McCall [Tue, 1 Sep 2015 15:50:44 +0000 (16:50 +0100)]
Clean up exception throwing/handling during service loading, and fix
dependency cycle detection.
Davin McCall [Thu, 27 Aug 2015 17:54:23 +0000 (18:54 +0100)]
Initial commit.