oweals/dinit.git
10 months agoFix mistakes in cptest asserts master
Davin McCall [Thu, 25 Jun 2020 11:15:45 +0000 (21:15 +1000)]
Fix mistakes in cptest asserts

10 months agoFix missing #include (needed for compiling with GCC 10)
Davin McCall [Thu, 25 Jun 2020 11:12:35 +0000 (21:12 +1000)]
Fix missing #include (needed for compiling with GCC 10)

10 months agoBump version to 0.8.2 v0.8.2
Davin McCall [Wed, 24 Jun 2020 22:45:21 +0000 (08:45 +1000)]
Bump version to 0.8.2

10 months agoFix setting group when only uid specified
Davin McCall [Wed, 24 Jun 2020 22:07:02 +0000 (08:07 +1000)]
Fix setting group when only uid specified

For run-as, and socket-uid, the primary group of the specified user - if
specified by name - should be set as the group, unless otherwise
specified.

10 months agoSet group id before user id in child process
Davin McCall [Tue, 23 Jun 2020 11:36:40 +0000 (21:36 +1000)]
Set group id before user id in child process

Should fix issue where the group id wasn't getting set at all.

10 months agoAdd integration test for add/rm dep via dinitctl
Davin McCall [Tue, 23 Jun 2020 09:51:37 +0000 (19:51 +1000)]
Add integration test for add/rm dep via dinitctl

10 months agoImprove diagnostic on attempt to add dependency from service to itself
Davin McCall [Sun, 21 Jun 2020 11:01:50 +0000 (21:01 +1000)]
Improve diagnostic on attempt to add dependency from service to itself

10 months agoFix dinitctl add/remove dependency
Davin McCall [Sun, 21 Jun 2020 07:36:38 +0000 (17:36 +1000)]
Fix dinitctl add/remove dependency

12 months agoAdd unit test for bgprocess smooth recovery
Davin McCall [Sat, 18 Apr 2020 01:23:27 +0000 (11:23 +1000)]
Add unit test for bgprocess smooth recovery

12 months agoFix smooth recovery of bgprocess services
Davin McCall [Sat, 18 Apr 2020 01:22:19 +0000 (11:22 +1000)]
Fix smooth recovery of bgprocess services

13 months agoAdd mock 'open' system call to bpsys
Davin McCall [Tue, 14 Apr 2020 22:56:21 +0000 (08:56 +1000)]
Add mock 'open' system call to bpsys

This allows a test harness to supply file content for particular paths;
opening a "file" will then allow reading the supplied content.

13 months agoFix bug with activation count for auto-restart services
Davin McCall [Mon, 13 Apr 2020 02:12:13 +0000 (12:12 +1000)]
Fix bug with activation count for auto-restart services

This could result in shutdown failure. Also, when stopping such a
process via dinitctl, the process would always restart if it had any
dependents (including soft); fix that.

16 months agoCompilation fix for Musl systems v0.8.1
Davin McCall [Wed, 1 Jan 2020 06:01:48 +0000 (16:01 +1000)]
Compilation fix for Musl systems

16 months agoMake sure we don't try to enable log watcher after deregistration
Davin McCall [Wed, 1 Jan 2020 05:46:49 +0000 (15:46 +1000)]
Make sure we don't try to enable log watcher after deregistration

If the watcher for the log has been deregistered (log closed), set the
release flag to prevent attempts to enable the watcher.

16 months agoBump version to 0.8.1
Davin McCall [Wed, 1 Jan 2020 05:37:42 +0000 (15:37 +1000)]
Bump version to 0.8.1

16 months agoUpdate TODO
Davin McCall [Wed, 1 Jan 2020 03:35:48 +0000 (13:35 +1000)]
Update TODO

16 months agoFix typo and use of hard-coded value
Davin McCall [Wed, 1 Jan 2020 01:00:54 +0000 (11:00 +1000)]
Fix typo and use of hard-coded value

16 months agoAdd another log subsystem test
Davin McCall [Wed, 1 Jan 2020 01:00:06 +0000 (11:00 +1000)]
Add another log subsystem test

16 months agoImprove unit test infrastructure - allow control of write()
Davin McCall [Wed, 1 Jan 2020 00:53:13 +0000 (10:53 +1000)]
Improve unit test infrastructure - allow control of write()

In the unit test infrastructure, allow behaviour of the write() call
(i.e. bp_sys::write()) to be overridden with a custom handler.

16 months agodinitcheck: fix nullptr deref if service can't be loaded
Davin McCall [Mon, 30 Dec 2019 22:28:35 +0000 (08:28 +1000)]
dinitcheck: fix nullptr deref if service can't be loaded

16 months agoAdd a simple logging test development
Davin McCall [Sun, 29 Dec 2019 06:05:41 +0000 (16:05 +1000)]
Add a simple logging test

16 months agoUse bp_sys aliases to write from log
Davin McCall [Sun, 29 Dec 2019 04:17:09 +0000 (14:17 +1000)]
Use bp_sys aliases to write from log

This allows for future unit testing of the log infrastructure.

16 months agoMark main log closed on write failure
Davin McCall [Sun, 29 Dec 2019 04:16:12 +0000 (14:16 +1000)]
Mark main log closed on write failure

Record the main log as being closed (external_log_open false) if there
is a write failure while trying to write the log buffer. This allows the
log to be re-opened by restarting the logging service.

Also we avoid waiting for the log buffer to flush if it has failed.

16 months agodinitcheck: check for missing service command
Davin McCall [Thu, 26 Dec 2019 05:07:18 +0000 (05:07 +0000)]
dinitcheck: check for missing service command

16 months agoAdd int. test for failing to load service
Davin McCall [Thu, 26 Dec 2019 05:03:29 +0000 (05:03 +0000)]
Add int. test for failing to load service

16 months agoFlush main log (as well) before exit
Davin McCall [Thu, 26 Dec 2019 05:00:30 +0000 (05:00 +0000)]
Flush main log (as well) before exit

The console log is flushed before exit (with a timeout of 5 seconds),
but the primary log was not flushed until now.

16 months agoFix issue when service fails to load
Davin McCall [Thu, 26 Dec 2019 04:15:27 +0000 (04:15 +0000)]
Fix issue when service fails to load

Introduced during earlier refactoring.

16 months agoFix error messages from proc_service launch stages
Davin McCall [Wed, 25 Dec 2019 07:42:28 +0000 (07:42 +0000)]
Fix error messages from proc_service launch stages

16 months agoBUILD: explain the USE_UTMPX option a little better
Davin McCall [Mon, 23 Dec 2019 05:19:29 +0000 (15:19 +1000)]
BUILD: explain the USE_UTMPX option a little better

16 months agoquery_name: always return with NAK if service handle invalid
Davin McCall [Mon, 23 Dec 2019 03:44:22 +0000 (13:44 +1000)]
query_name: always return with NAK if service handle invalid

Existing code looks like a copy-pasto: returns ACK (not NAK?) and falls
through to a potential null-pointer dereference if the service handle
can't be found.

16 months agoAdd SHUTDOWN_PREFIX build variable, controls name of shutdown executable
Davin McCall [Mon, 23 Dec 2019 02:57:49 +0000 (12:57 +1000)]
Add SHUTDOWN_PREFIX build variable, controls name of shutdown executable

Useful for installing Dinit alongside eg Sys V init.

16 months agoAvoid building constant strings on the stack
Davin McCall [Mon, 23 Dec 2019 01:03:12 +0000 (11:03 +1000)]
Avoid building constant strings on the stack

In a few places cts::literal was used locally within a function,
resulting in the (constexpr) result string object being allocated on the
stack. Move these to namespace scope.

16 months agoAdd dinitcheck(8) to dinit.8 "see also" section
Davin McCall [Sun, 22 Dec 2019 12:59:35 +0000 (22:59 +1000)]
Add dinitcheck(8) to dinit.8 "see also" section

16 months agoUpdated bundled Dasynq to 1.1.7
Davin McCall [Sun, 22 Dec 2019 10:28:42 +0000 (20:28 +1000)]
Updated bundled Dasynq to 1.1.7

This fixes a slow memory leak.

16 months agoFix --help option in dinitcheck
Davin McCall [Sun, 22 Dec 2019 10:25:05 +0000 (20:25 +1000)]
Fix --help option in dinitcheck

17 months agoUpdate COMPARISON; give more details of Dinit up-front
Davin McCall [Sat, 14 Dec 2019 08:49:52 +0000 (18:49 +1000)]
Update COMPARISON; give more details of Dinit up-front

17 months agoAvoid copying string arguments to log functions (always pass by ref)
Davin McCall [Fri, 13 Dec 2019 10:05:47 +0000 (20:05 +1000)]
Avoid copying string arguments to log functions (always pass by ref)

17 months agoBump version. v0.8.0
Davin McCall [Sun, 8 Dec 2019 09:09:48 +0000 (19:09 +1000)]
Bump version.

17 months agodinitctl: make unload/reload respect --quiet
Davin McCall [Sun, 8 Dec 2019 08:52:12 +0000 (18:52 +1000)]
dinitctl: make unload/reload respect --quiet

17 months agodinitcheck: output overall result after checks complete
Davin McCall [Sun, 8 Dec 2019 08:47:44 +0000 (18:47 +1000)]
dinitcheck: output overall result after checks complete

17 months agoPush some TODO items back to 0.9+
Davin McCall [Sun, 8 Dec 2019 08:23:00 +0000 (18:23 +1000)]
Push some TODO items back to 0.9+

We already have two major features in 0.8: dinitcheck, and dinitctl
reload; that's enough for a new version.

17 months agodinitctl man: note that can't add non-running dep to started service
Davin McCall [Sun, 8 Dec 2019 07:45:30 +0000 (17:45 +1000)]
dinitctl man: note that can't add non-running dep to started service

17 months agoClean up clang warnings
Davin McCall [Sun, 8 Dec 2019 07:29:36 +0000 (17:29 +1000)]
Clean up clang warnings

17 months agoUpdate default build configs
Davin McCall [Sun, 8 Dec 2019 07:26:08 +0000 (17:26 +1000)]
Update default build configs

17 months agoRefactoring: load new / reload existing service in single function
Davin McCall [Sun, 8 Dec 2019 03:43:59 +0000 (03:43 +0000)]
Refactoring: load new / reload existing service in single function

Loading a new service and reloading a service share a lot of common
code, so refactor them into a single function.

17 months agoFix IGR makefile (spaces to tab)
Davin McCall [Sun, 8 Dec 2019 00:42:26 +0000 (00:42 +0000)]
Fix IGR makefile (spaces to tab)

17 months agoUpdate TODO, minor updates to COMPARISON/DESIGN
Davin McCall [Thu, 5 Dec 2019 13:47:03 +0000 (23:47 +1000)]
Update TODO, minor updates to COMPARISON/DESIGN

17 months agoFix reload of stopped service
Davin McCall [Thu, 5 Dec 2019 13:45:45 +0000 (23:45 +1000)]
Fix reload of stopped service

17 months agoAdd 2nd reload test
Davin McCall [Thu, 5 Dec 2019 13:45:16 +0000 (23:45 +1000)]
Add 2nd reload test

17 months agoSet target state to STOPPED when stop is issued
Davin McCall [Wed, 4 Dec 2019 12:19:19 +0000 (22:19 +1000)]
Set target state to STOPPED when stop is issued

17 months agoAdd integration test for reload
Davin McCall [Tue, 3 Dec 2019 11:40:18 +0000 (21:40 +1000)]
Add integration test for reload

17 months agoImplement additional checks for reload
Davin McCall [Mon, 2 Dec 2019 11:13:32 +0000 (21:13 +1000)]
Implement additional checks for reload

The settings/flags inittab-id, inittab-line, shares-console,
runs-on-console, and pid-file cannot be changed for a running service.

17 months agoImprove some dinitctl error messages
Davin McCall [Sun, 1 Dec 2019 05:55:10 +0000 (15:55 +1000)]
Improve some dinitctl error messages

17 months agoRemove unneeded release
Davin McCall [Sun, 1 Dec 2019 05:07:44 +0000 (15:07 +1000)]
Remove unneeded release

17 months agoImplement reload command for dinitctl
Davin McCall [Sun, 1 Dec 2019 04:46:27 +0000 (14:46 +1000)]
Implement reload command for dinitctl

17 months agoImplement control protocol for reloading services
Davin McCall [Sun, 1 Dec 2019 02:44:45 +0000 (12:44 +1000)]
Implement control protocol for reloading services

17 months agoInitial implementation of service reloading
Davin McCall [Sun, 1 Dec 2019 01:27:12 +0000 (11:27 +1000)]
Initial implementation of service reloading

17 months agodinitcheck: return EXIT_FAILURE if problem found
Davin McCall [Fri, 22 Nov 2019 14:40:32 +0000 (14:40 +0000)]
dinitcheck: return EXIT_FAILURE if problem found

17 months agoIntegration test for dinitcheck dependency cycles detection
Davin McCall [Fri, 22 Nov 2019 13:29:57 +0000 (13:29 +0000)]
Integration test for dinitcheck dependency cycles detection

17 months agodinitcheck: check for and report dependency cycles
Davin McCall [Fri, 22 Nov 2019 13:19:42 +0000 (13:19 +0000)]
dinitcheck: check for and report dependency cycles

17 months agoFix inconsistencies/typos in help text, man pages
Davin McCall [Thu, 21 Nov 2019 18:44:14 +0000 (18:44 +0000)]
Fix inconsistencies/typos in help text, man pages

17 months agodinitcheck: support specifying services to check on command line
Davin McCall [Thu, 21 Nov 2019 18:43:48 +0000 (18:43 +0000)]
dinitcheck: support specifying services to check on command line

17 months agoInitial manpage for dinitcheck
Davin McCall [Thu, 21 Nov 2019 16:51:37 +0000 (16:51 +0000)]
Initial manpage for dinitcheck

17 months agoUpdate TODO
Davin McCall [Thu, 21 Nov 2019 16:28:28 +0000 (16:28 +0000)]
Update TODO

17 months agoInstall dinitcheck on install, clean binary on clean
Davin McCall [Thu, 21 Nov 2019 16:28:12 +0000 (16:28 +0000)]
Install dinitcheck on install, clean binary on clean

17 months agoRemove accidental marker comment
Davin McCall [Thu, 21 Nov 2019 16:24:21 +0000 (16:24 +0000)]
Remove accidental marker comment

17 months agoAdd integration test for basic dinitcheck functionality
Davin McCall [Thu, 21 Nov 2019 12:09:43 +0000 (12:09 +0000)]
Add integration test for basic dinitcheck functionality

17 months agodinitcheck: use previously factored-out parameter processing
Davin McCall [Thu, 21 Nov 2019 12:06:15 +0000 (12:06 +0000)]
dinitcheck: use previously factored-out parameter processing

dinitcheck now shares parameter processing with dinit, providing
consistent error messages and parsing.

17 months agoFactor out service parameter processing
Davin McCall [Thu, 21 Nov 2019 10:41:34 +0000 (10:41 +0000)]
Factor out service parameter processing

Factor service parameter processing into a template method, to enable
sharing (later) between load_service in dinit and dinitcheck.

17 months agoService description loading: improve error messages
Davin McCall [Tue, 19 Nov 2019 18:10:27 +0000 (18:10 +0000)]
Service description loading: improve error messages

Include parameter name and improve consistency in error messages when
parsing service descriptions.

17 months agodinitcheck: fix checking of dependencies
Davin McCall [Sun, 17 Nov 2019 18:39:20 +0000 (18:39 +0000)]
dinitcheck: fix checking of dependencies

17 months agoUse common option processing for dinit/dinitcheck service dir
Davin McCall [Fri, 15 Nov 2019 19:39:27 +0000 (19:39 +0000)]
Use common option processing for dinit/dinitcheck service dir

18 months agoFactor out service directory option processing
Davin McCall [Sat, 9 Nov 2019 07:03:15 +0000 (17:03 +1000)]
Factor out service directory option processing

Service directory options need to be processed/handled by dinit and by
dinitcheck, so factor out the processing into a separate module.

19 months agoFix typo in comment
Davin McCall [Sun, 6 Oct 2019 01:58:55 +0000 (02:58 +0100)]
Fix typo in comment

19 months agodinitcheck: process all dependencies
Davin McCall [Sun, 6 Oct 2019 01:58:38 +0000 (02:58 +0100)]
dinitcheck: process all dependencies

19 months agoDon't enable reporting exceptions on failbit (only to then disable).
Davin McCall [Sat, 21 Sep 2019 01:35:25 +0000 (02:35 +0100)]
Don't enable reporting exceptions on failbit (only to then disable).

19 months agoBeginnings of "dinitcheck" utility
Davin McCall [Sat, 10 Aug 2019 04:20:40 +0000 (14:20 +1000)]
Beginnings of "dinitcheck" utility

This will be a utility to check service configuration for errors/lint.

19 months agoConvert system_error to service_load_exc in load_service.
Davin McCall [Mon, 16 Sep 2019 09:02:57 +0000 (19:02 +1000)]
Convert system_error to service_load_exc in load_service.

20 months agoMore re-wording of "dinit as init" Linux documentation
Davin McCall [Sat, 10 Aug 2019 04:09:31 +0000 (14:09 +1000)]
More re-wording of "dinit as init" Linux documentation

20 months agoRestore -s option to dinitctl
Davin McCall [Tue, 10 Sep 2019 21:57:39 +0000 (07:57 +1000)]
Restore -s option to dinitctl

This is hardly needed since it is the default if run as root now, but is
nice to have for backwards compatibility / overriding -u option.

20 months agoUpdate gitignore
Davin McCall [Tue, 10 Sep 2019 21:30:14 +0000 (07:30 +1000)]
Update gitignore

20 months agoRemove integration test output
Davin McCall [Tue, 10 Sep 2019 21:28:27 +0000 (07:28 +1000)]
Remove integration test output

20 months agoMerge pull request #22 from travankor/makefile
Davin McCall [Mon, 9 Sep 2019 21:21:09 +0000 (07:21 +1000)]
Merge pull request #22 from travankor/makefile

Fix missing dependencies on mconfig.h in Makefile.

20 months agoFix makefile. 22/head
travankor [Mon, 9 Sep 2019 06:22:29 +0000 (23:22 -0700)]
Fix makefile.

20 months agoMerge pull request #23 from travankor/doc-fixes
Davin McCall [Mon, 9 Sep 2019 12:05:05 +0000 (22:05 +1000)]
Merge pull request #23 from travankor/doc-fixes

Fix typo in dinitctl man page. Document restart for help option.

20 months agoFix typo in dinitctl man page. Document restart for help option. 23/head
travankor [Sat, 7 Sep 2019 11:28:01 +0000 (04:28 -0700)]
Fix typo in dinitctl man page. Document restart for help option.

20 months agoMerge pull request #21 from fpoussin/contrib
Davin McCall [Tue, 3 Sep 2019 12:15:04 +0000 (22:15 +1000)]
Merge pull request #21 from fpoussin/contrib

Adding fpoussin to contributors

20 months agoAdding myself to contributors 21/head
Fabien Poussin [Tue, 3 Sep 2019 11:19:36 +0000 (13:19 +0200)]
Adding myself to contributors

20 months agoMerge pull request #20 from fpoussin/root
Davin McCall [Tue, 3 Sep 2019 10:19:09 +0000 (20:19 +1000)]
Merge pull request #20 from fpoussin/root

Adding root check on default control socket

Closes #18

20 months agoUpdated documentation for the new user flag 20/head
Fabien Poussin [Tue, 3 Sep 2019 09:09:01 +0000 (11:09 +0200)]
Updated documentation for the new user flag

20 months agoReplaced system flag with user flag
Fabien Poussin [Tue, 3 Sep 2019 09:08:37 +0000 (11:08 +0200)]
Replaced system flag with user flag

20 months agoMerge pull request #19 from fpoussin/modules
Davin McCall [Mon, 26 Aug 2019 12:16:25 +0000 (22:16 +1000)]
Merge pull request #19 from fpoussin/modules

Kernel modules script

20 months agoAdding boot link for modules 19/head
Fabien Poussin [Mon, 26 Aug 2019 10:28:44 +0000 (12:28 +0200)]
Adding boot link for modules

20 months agoAdding kernel modules script
Fabien Poussin [Mon, 26 Aug 2019 10:25:52 +0000 (12:25 +0200)]
Adding kernel modules script

21 months agoUp version to 0.7.0. v0.7.0
Davin McCall [Fri, 9 Aug 2019 11:52:25 +0000 (21:52 +1000)]
Up version to 0.7.0.

21 months agoSome documentation updates.
Davin McCall [Thu, 8 Aug 2019 13:07:31 +0000 (23:07 +1000)]
Some documentation updates.

21 months agoAdd integration test for service "restart" function.
Davin McCall [Thu, 8 Aug 2019 12:18:26 +0000 (22:18 +1000)]
Add integration test for service "restart" function.

21 months agoUpdate man page for revised restart/wake semantics.
Davin McCall [Thu, 8 Aug 2019 11:53:32 +0000 (21:53 +1000)]
Update man page for revised restart/wake semantics.

21 months agoChange semantics of "wake" command.
Davin McCall [Thu, 8 Aug 2019 11:48:33 +0000 (21:48 +1000)]
Change semantics of "wake" command.

"Wake" now re-attaches dependencies (from the dependents of the named
service). You can no longer wake a service if it has no active
dependents.

21 months agoAvoid signed-unsigned comparison warning.
Davin McCall [Wed, 7 Aug 2019 11:53:16 +0000 (21:53 +1000)]
Avoid signed-unsigned comparison warning.