oweals/dinit.git
5 years 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

5 years 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

5 years 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

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

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

5 years 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

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

5 years 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

5 years 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.

5 years 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.

5 years 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.

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

5 years 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

5 years 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.

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

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

5 years 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).

5 years 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.

5 years 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.

5 years 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

5 years 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.

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

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

5 years 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.

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

5 years 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.

5 years 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.

5 years 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

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

5 years 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

5 years 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

5 years 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

5 years 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

5 years 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

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

5 years 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.

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

5 years 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.

5 years 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.

5 years 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.

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

5 years agodinitctl: update restart handling.
Davin McCall [Wed, 7 Aug 2019 11:39:21 +0000 (21:39 +1000)]
dinitctl: update restart handling.

As per changes in dinit daemon/control protocol.

5 years agoRe-work restart function.
Davin McCall [Wed, 7 Aug 2019 11:04:56 +0000 (21:04 +1000)]
Re-work restart function.

Restart is now always "gentle", i.e. cannot be forced and isn't possible
when dependents (with hard dependency) exist.

5 years agoProperly issue STARTCANCELLED message if restart is cancelled
Davin McCall [Wed, 7 Aug 2019 10:09:56 +0000 (20:09 +1000)]
Properly issue STARTCANCELLED message if restart is cancelled

5 years agoRe-work state propogation/transition logic.
Davin McCall [Sun, 4 Aug 2019 04:23:15 +0000 (14:23 +1000)]
Re-work state propogation/transition logic.

This mostly keeps existing behaviour, hopefully making it more
consistent and predictable in other cases, and simplifies the code.

5 years agoImprove/refactor static_membuf.
Davin McCall [Wed, 31 Jul 2019 11:21:57 +0000 (21:21 +1000)]
Improve/refactor static_membuf.

5 years agoRefactor some packet-building for readability and safety
Davin McCall [Mon, 29 Jul 2019 10:41:23 +0000 (20:41 +1000)]
Refactor some packet-building for readability and safety

5 years agoDocument dinitctl "restart" command.
Davin McCall [Sun, 28 Jul 2019 07:09:30 +0000 (17:09 +1000)]
Document dinitctl "restart" command.

5 years agoUpdate TODO.
Davin McCall [Sun, 28 Jul 2019 05:49:23 +0000 (15:49 +1000)]
Update TODO.

5 years agoUp version, update NEWS.
Davin McCall [Sun, 28 Jul 2019 01:50:48 +0000 (11:50 +1000)]
Up version, update NEWS.

5 years agostop: if not required, treat stop as full manual stop.
Davin McCall [Sat, 27 Jul 2019 12:22:02 +0000 (22:22 +1000)]
stop: if not required, treat stop as full manual stop.

This is needed to properly handle shutdown when a service is alive but
not marked active.

5 years agoImplement dinitctl restart, addresses #14
Davin McCall [Sat, 27 Jul 2019 10:45:29 +0000 (20:45 +1000)]
Implement dinitctl restart, addresses #14

5 years agoDon't add console watcher if not PID 1.
Davin McCall [Sat, 27 Jul 2019 07:03:41 +0000 (17:03 +1000)]
Don't add console watcher if not PID 1.

If not PID 1, we don't need to ask for console input. Adding a watcher
fails if we don't have a (suitable) stdin, eg FreeBSD shell if dinit is
run in background.

5 years agoUpdate manpage/README for new "dinitctl stop" semantics.
Davin McCall [Sat, 27 Jul 2019 06:15:09 +0000 (16:15 +1000)]
Update manpage/README for new "dinitctl stop" semantics.

"dinitctl stop" will now issue an error if dependent services would be
forced to stop. The new --force option can be used to force a service
and dependents to stop.

5 years agoAdd integration test for gentle stop/force stop.
Davin McCall [Sat, 27 Jul 2019 06:03:21 +0000 (16:03 +1000)]
Add integration test for gentle stop/force stop.

5 years agoFix a bunch of issues identified by Coverity scan
Davin McCall [Sat, 27 Jul 2019 05:01:56 +0000 (15:01 +1000)]
Fix a bunch of issues identified by Coverity scan

5 years agodinitctl: print names of dependents which are inhibiting stop
Davin McCall [Sat, 27 Jul 2019 00:16:53 +0000 (10:16 +1000)]
dinitctl: print names of dependents which are inhibiting stop

5 years agodinitctl stop: gentle by default, implement --force.
Davin McCall [Tue, 23 Jul 2019 11:09:15 +0000 (21:09 +1000)]
dinitctl stop: gentle by default, implement --force.

A "gentle" stop won't stop if dependents will be affected, i.e. it warns
and aborts. The `--force' option (or `-f') can be used to force the
service to stop, which will also cause the dependents to stop.

Also sneak in a bug fix where certain options were not recognised.

5 years agoAdd control protocol query-name test
Davin McCall [Mon, 22 Jul 2019 09:14:45 +0000 (19:14 +1000)]
Add control protocol query-name test

5 years agoUpdate gitignore
Davin McCall [Mon, 22 Jul 2019 09:02:27 +0000 (19:02 +1000)]
Update gitignore

5 years agoControl protocol: implement QUERYSERVICENAME to get name from handle
Davin McCall [Sun, 21 Jul 2019 05:08:50 +0000 (15:08 +1000)]
Control protocol: implement QUERYSERVICENAME to get name from handle

5 years agoFix gentle service stop
Davin McCall [Sun, 21 Jul 2019 04:57:19 +0000 (14:57 +1000)]
Fix gentle service stop

Fix some problems with "gentle" service stop as found by test.

5 years agoAdd test for "gentle" stop.
Davin McCall [Sun, 21 Jul 2019 05:01:37 +0000 (15:01 +1000)]
Add test for "gentle" stop.

5 years agoClean up fuzz test source
Davin McCall [Sun, 21 Jul 2019 01:58:29 +0000 (11:58 +1000)]
Clean up fuzz test source

5 years agoImplement careful/"gentle" service stop (abort if dependent would stop).
Davin McCall [Sat, 20 Jul 2019 08:50:41 +0000 (09:50 +0100)]
Implement careful/"gentle" service stop (abort if dependent would stop).

5 years agoUpdate version, NEWS, TODO. v0.6.0
Davin McCall [Sun, 14 Jul 2019 04:48:32 +0000 (05:48 +0100)]
Update version, NEWS, TODO.

5 years agoGenerate man pages with m4.
Davin McCall [Sun, 14 Jul 2019 01:53:39 +0000 (02:53 +0100)]
Generate man pages with m4.

Allows substituting current version and release date.

5 years agoLog more information on exec failure.
Davin McCall [Fri, 12 Jul 2019 13:28:23 +0000 (23:28 +1000)]
Log more information on exec failure.

Log failure stage as well as error-from-errno.

5 years agoAdd integration test for "chain-to" service parameter
Davin McCall [Thu, 11 Jul 2019 12:38:19 +0000 (22:38 +1000)]
Add integration test for "chain-to" service parameter

5 years agoUpdate TODO, CONTRIBUTING
Davin McCall [Thu, 11 Jul 2019 11:33:59 +0000 (21:33 +1000)]
Update TODO, CONTRIBUTING

5 years agoDon't log to syslog if not running as system daemon
Davin McCall [Thu, 11 Jul 2019 10:33:52 +0000 (20:33 +1000)]
Don't log to syslog if not running as system daemon

5 years agoDon't put "shares console" processes in the foreground.
Davin McCall [Mon, 8 Jul 2019 10:25:27 +0000 (20:25 +1000)]
Don't put "shares console" processes in the foreground.

We don't want them to steal signals such as ^C from a real "runs on
console" process.

5 years agoAdd integration test for per-process environment.
Davin McCall [Sat, 6 Jul 2019 02:53:45 +0000 (03:53 +0100)]
Add integration test for per-process environment.

5 years agoImplement --socket-path option for dinitctl.
Davin McCall [Sat, 6 Jul 2019 02:45:07 +0000 (03:45 +0100)]
Implement --socket-path option for dinitctl.

5 years agoImplement "env-file" service setting for service-specific environment.
Davin McCall [Sat, 6 Jul 2019 00:05:09 +0000 (01:05 +0100)]
Implement "env-file" service setting for service-specific environment.

5 years agoUpdate .gitignore.
Davin McCall [Fri, 5 Jul 2019 11:43:17 +0000 (21:43 +1000)]
Update .gitignore.

5 years agoAdd extern definition for environ.
Davin McCall [Fri, 5 Jul 2019 11:39:46 +0000 (21:39 +1000)]
Add extern definition for environ.

POSIX is somewhat ambiguous as to whether unistd.h should declare the
environ variable. It is not listed in the specific requirements for
unistd.h and OpenBSD does not declare it in that header.

5 years agoFix test stub for run_child_proc.
Davin McCall [Fri, 5 Jul 2019 11:32:54 +0000 (21:32 +1000)]
Fix test stub for run_child_proc.

5 years agoMake help output consistent.
Davin McCall [Fri, 5 Jul 2019 11:17:09 +0000 (21:17 +1000)]
Make help output consistent.

5 years agoIgnore addrspace resource limit if system has no RLIMIT_AS.
Davin McCall [Fri, 5 Jul 2019 11:13:31 +0000 (21:13 +1000)]
Ignore addrspace resource limit if system has no RLIMIT_AS.

5 years agoAdd integration test framework (with 2 tests).
Davin McCall [Fri, 5 Jul 2019 11:03:11 +0000 (21:03 +1000)]
Add integration test framework (with 2 tests).

Run integration tests using "make check-igr". This complements the unit
tests ("make check").

5 years agoAdd -q/--quiet option for supressing console output.
Davin McCall [Wed, 3 Jul 2019 09:50:52 +0000 (19:50 +1000)]
Add -q/--quiet option for supressing console output.

5 years agoMinor updates to Linux Dinit-as-init guidelines.
Davin McCall [Wed, 3 Jul 2019 09:50:08 +0000 (19:50 +1000)]
Minor updates to Linux Dinit-as-init guidelines.

5 years agoFix non-POSIXisms in sample rcboot.sh
Davin McCall [Sun, 30 Jun 2019 11:49:52 +0000 (21:49 +1000)]
Fix non-POSIXisms in sample rcboot.sh

5 years agoFix notification environment variable setting.
Davin McCall [Sat, 29 Jun 2019 10:20:55 +0000 (11:20 +0100)]
Fix notification environment variable setting.

Refactor start_ps_process to take a single struct argument, and fix a
bug in the process: the notification environment variable (where the
notification fd should be stored) was never passed through to the
service process.

5 years agoMerge pull request #15 from fpoussin/crossbuild
Davin McCall [Thu, 4 Jul 2019 11:53:03 +0000 (21:53 +1000)]
Merge pull request #15 from fpoussin/crossbuild

Fixed strip on install for cross compilation

5 years agoAdded STRIPOPTS var for install 15/head
Fabien Poussin [Thu, 4 Jul 2019 11:39:27 +0000 (13:39 +0200)]
Added STRIPOPTS var for install

5 years agoUpdate NEWS and version.
Davin McCall [Sat, 29 Jun 2019 05:46:28 +0000 (15:46 +1000)]
Update NEWS and version.

(Commit picked from r0.5.2 release branch).

5 years agoOnly move fds from force_notify_fd if it is set!
Davin McCall [Sat, 29 Jun 2019 05:34:07 +0000 (15:34 +1000)]
Only move fds from force_notify_fd if it is set!

5 years agoShuffle file descriptors as necessary to avoid clash with notify fd.
Davin McCall [Sat, 29 Jun 2019 05:04:21 +0000 (15:04 +1000)]
Shuffle file descriptors as necessary to avoid clash with notify fd.

5 years agoUpdate TODO.
Davin McCall [Sat, 29 Jun 2019 03:52:45 +0000 (13:52 +1000)]
Update TODO.

5 years agoRe-create control socket file node if it disappears.
Davin McCall [Sat, 29 Jun 2019 03:41:38 +0000 (13:41 +1000)]
Re-create control socket file node if it disappears.

In case something is mounted over /dev (or wherever the control socket
lives) it will become inaccessible. When a starts-rwfs service starts,
check the socket node still exists and if not, close the socket and
re-open.

5 years agoBuild/logic fixes in parse_rlimit.
Davin McCall [Fri, 28 Jun 2019 11:16:17 +0000 (21:16 +1000)]
Build/logic fixes in parse_rlimit.

5 years agoAdditional check for bad setting values for rlimit settings.
Davin McCall [Fri, 28 Jun 2019 10:28:05 +0000 (20:28 +1000)]
Additional check for bad setting values for rlimit settings.

5 years agoFix uninitialised variable.
Davin McCall [Fri, 28 Jun 2019 10:26:19 +0000 (20:26 +1000)]
Fix uninitialised variable.

5 years agoFix use of old settings in sample config, see #16.
Davin McCall [Fri, 28 Jun 2019 09:58:35 +0000 (19:58 +1000)]
Fix use of old settings in sample config, see #16.

5 years agoFixed strip on install for cross compilation
Fabien Poussin [Thu, 27 Jun 2019 00:25:34 +0000 (02:25 +0200)]
Fixed strip on install for cross compilation

5 years agoAdd documentation for the resource limit settings.
Davin McCall [Sat, 22 Jun 2019 08:26:11 +0000 (09:26 +0100)]
Add documentation for the resource limit settings.

5 years agoFix typo in function name (workding -> working)
Davin McCall [Sat, 22 Jun 2019 03:03:51 +0000 (04:03 +0100)]
Fix typo in function name (workding -> working)

5 years agoImplement resource limit settings.
Davin McCall [Sat, 22 Jun 2019 02:54:09 +0000 (03:54 +0100)]
Implement resource limit settings.