1
0
Fork 0
mirror of https://github.com/pygos/init.git synced 2024-05-18 11:46:14 +02:00
Commit graph

22 commits

Author SHA1 Message Date
David Oberhollenzer 5f28289731 cleanup: merge runsvc back into initd
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-04-24 12:09:18 +02:00
David Oberhollenzer 87a524d931 cleanup: delete remains of libutil
- exec_t belongs to service.h, the main place where it is used/needed
 - code for executing exec_t is moved to runsvc for the same reason
 - what is left are NORETURN and ARRAY_SIZE
   - the former can be replaced with direct attribute usage since
     the only relevant compilers all support the attribute.
   - the later is only used in 3 places and can be trivially replaced
     with direct usage of sizeof().

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-03-31 18:19:27 +02:00
David Oberhollenzer 9f9807d4d3 cleanup: initd: simplify and merge linux specific code into main.c
Targetting anything else than Linux isn't really relevant. All
other systems ($BSD and other Unices) are a closed ecosystem
where kernel & userspace are developed together. They don't need
something like a third party init system, so compatibillity can
be largely ignored.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-03-31 13:09:04 +02:00
David Oberhollenzer 7cfe6e8458 cleanup: move init specific stuff of init socket to initd
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29 21:00:53 +01:00
David Oberhollenzer 028394b8a5 Add service configuration reloading
This commit add the ability to initd to reload the service configuration
while running. The new configuration is merged with the existing one as
follows:

For each target:
 - If the existing service list is not NULL, we have not started that
   target yet. Simply replace it with the new list.
 - If it is NULL, the services have already been started.
    - First, remove all entries for services in that target that no
      loner exist (except from the 'running' list).
    - Second, add new services that we don't have yet. Treat them as
      recently diseased and let the user start them manualy.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29 21:00:53 +01:00
David Oberhollenzer ba12700080 Add start/stop commands to init socket
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-28 15:32:10 +01:00
David Oberhollenzer d16d260181 Add filter argument to status request
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-27 17:48:32 +01:00
David Oberhollenzer 40ad83dc6a initd: implement handling of socket requests
Actually process requests and send an answer to status inquiries.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18 18:29:02 +01:00
David Oberhollenzer 08f72865b2 Add init socket to initd
Create a socket if boot target is done. Close and reopen socket
if SIGUSR1 is received.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18 14:15:58 +01:00
David Oberhollenzer c14c3c0173 Relicense what is left of the init system under OpenBSD style ISC license
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-23 13:16:08 +01:00
David Oberhollenzer b864c727c8 Remove unused telinit code
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04 15:33:00 +01:00
David Oberhollenzer ec74e5bbee initd: restructure and merge service supervision code
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-24 21:17:31 +02:00
David Oberhollenzer ed23d075ca Make mksock() more generic, move to util library
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-09 15:32:29 +02:00
David Oberhollenzer 59731dd69b Add helper program for running services
We no longer need to keep entire scripts in init program (i.e. saving space)
and reduce the code and complexity of the init program.

The runsvc tool can later be extended to do more complex child setup, such
as configuring namespaces or seccomp without adding complexity or memory
footprint to init.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-22 13:41:18 +02:00
David Oberhollenzer 2cb64e48fc Move initd signal setup to platform specific file
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-15 13:24:13 +02:00
David Oberhollenzer 55d4a328c9 Read environment for init from config file
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-12 12:05:15 +02:00
David Oberhollenzer 43274e3910 Remove setup_tty function
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-07 01:33:58 +02:00
David Oberhollenzer 04a23330e4 Merge preprocessing of command lines
- Common function for splitting string into argument vector
 - Preprocess & split command lines while parsing the service file
 - Specify "before" and "after" dependencies in a single line

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-04 14:58:01 +02:00
David Oberhollenzer 09115f9a97 Print status when starting a service marked as respawn
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-25 22:07:33 +02:00
David Oberhollenzer 021f091082 Use services to implement shutdown/reboot sequence
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-25 13:28:07 +02:00
David Oberhollenzer 1b3b98135e Add license headers and comments to source
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-24 22:50:28 +01:00
David Oberhollenzer 9a88f7da45 Initial commit
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-24 17:04:20 +01:00