1
0
Fork 0
mirror of https://github.com/pygos/init.git synced 2024-11-05 12:17:10 +01:00
Commit graph

26 commits

Author SHA1 Message Date
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
ba12700080 Add start/stop commands to init socket
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-28 15:32:10 +01:00
d16d260181 Add filter argument to status request
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-27 17:48:32 +01:00
a6c059203b Fix warnings from gcc 8.3 + musl build
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-20 20:43:41 +01:00
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
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
066efaa33e initd: automatically do a shutdown/reboot when the target is completed
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-24 21:17:31 +02:00
David Oberhollenzer
ec6264bad5 initd: accept sigterm and simply initiate shutdown target
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-24 21:17:31 +02:00
David Oberhollenzer
25afc0b3d0 Remove ctrl+alt+del target, simply initiate reboot target
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-24 21:17:31 +02: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
720220a3c3 Add flags to selectively skip fields in service files
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
b81668e045 Minor cleanup
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-07 16:19:38 +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
ffb655126a Create init socket after reaching boot target
Filesystem might not be available before then.

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
160ef94e8b Add service respawn limit
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-26 00:40:28 +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
a71c92b33d Unify naming of service to shorthand svc
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-25 12:14:06 +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