1
0
Fork 0
mirror of https://github.com/pygos/init.git synced 2024-11-22 11:19:45 +01:00
Commit graph

157 commits

Author SHA1 Message Date
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
e21840cfce initd: don't start runsvc for services without exec block
First in rdsvc, tag the services that *do* have exec lines, even if we don't
read them.

Second, if a service does not have that flag set, don't try to execute it.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-20 15:44:14 +01:00
390175c406 cleanup runsvc: merge codepaths for execution, remove cleanup code
Simply execute the last entry in the list directly instead of forking and
remove the cleanup code.

If the list is empty, we return success.

If the list only has one entry, we directly execute that. No need to make a
distinction between single entry vs list anymore.

If the list is an actual list, we run it as before but execute the last one
directly. Typically, the last one is something like a daemon preceeded by
setup code. The daemon ends up directly underneath init, without a dummy
waiting runsvc stuck in the process list.

If we always do an exec, there is no point in doing cleanup. All our mapped
memory is evicted anyway. Same if we exit appruptly because of an error.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-20 15:09:35 +01:00
4f1b393cee Dump more information in service status command
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-20 14:47:45 +01:00
1850f31d6d Seperate service loading/error loging from dumpscript command
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-19 23:53:49 +01:00
065d3b678d cleanup: remove broken stat ... open pattern
confused deputy is confused.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18 19:49:42 +01:00
11053ebe6a Add filtering parameters to status command
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18 19:16:34 +01:00
a9602ad6e0 Cleanup status reporting
- mimic format of initd
 - skip formatting if not a tty
 - distinguish exited because failed vs exited because done

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18 18:47:20 +01:00
3f40c4d3ed Add status report command to service command line utility
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18 18:42:38 +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
23b713c3b5 Add functions to transmit service status accross initd socket
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
c78bbd2f73 Add helpers for initd socket
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18 14:15:58 +01:00
c544fcc7a3 initd: store completed services in list instead of deleting them
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-15 10:46:11 +01:00
5b106abaed Update e-mail address
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-14 17:18:34 +01:00
David Oberhollenzer
4ee949c1ca Release init-0.9
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-25 02:08:33 +01:00
David Oberhollenzer
d9a5736bdf Remove some no longer needed cruft
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-23 23:00: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
d983a282ed Remove auto-magic release automation script
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-23 13:14:55 +01:00
David Oberhollenzer
bf878d08dd Remove cron daemon, rewritten and split off into seperate repo
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-21 12:01:39 +01:00
David Oberhollenzer
dc6358b0e1 rdline: always do substitution of '%%'
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-13 19:11:33 +01:00
David Oberhollenzer
7ee95668ca Release init-0.8 2018-11-05 20:19:25 +01:00
David Oberhollenzer
4bcfd98764 Cleanup header dependencies
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-05 20:18:48 +01:00
David Oberhollenzer
a8f3360e93 Split default init scripts into seperate package
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-05 16:01:57 +01:00
David Oberhollenzer
5923ad488a Move cron library code to crond
Nothing else uses it.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04 15:37:15 +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
c0e8c7e245 cleanup: let rdline_init open the file
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04 15:02:11 +01:00
David Oberhollenzer
074fe20a47 Add fopenat utility function
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04 14:45:46 +01:00
David Oberhollenzer
34f542b7cc Seperate init specific code from utility code
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04 14:30:16 +01:00
David Oberhollenzer
1ffc240b3f cleanup normalize_line state machine
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04 14:20:23 +01:00
David Oberhollenzer
acd09007a1 Remove usyslogd/klogd and syslog utility program
This is split out to a seperate package.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-03 19:26:00 +01:00
David Oberhollenzer
d4ce928fc0 Release init-0.7.1 2018-11-03 19:26:00 +01:00
David Oberhollenzer
b3773d09ea Only parse arguments if index actually is numeric
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-03 19:26:00 +01:00
David Oberhollenzer
24e98f1e5b Fix parameter substitution escape of '%'
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-10-20 17:41:22 +02:00
David Oberhollenzer
ef51a8e06f Silence nginx service
Make sure it *only* prints to its log files and doesn't spam all
over the TTY if it cannot find the favicon that $BROWSER requested.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-10-20 16:36:12 +02:00
David Oberhollenzer
53bc182e09 Fix argv_exec allocation size of argument vector
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-10-16 23:06:58 +02:00
David Oberhollenzer
24c90b7700 Configuration parser cleanup
- Do a getline() & process in rdline instead of doing a read per character
   and feeding it through a state machine.
 - Move splitkv to rdcfg.c, the only place where it is used

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-10-10 16:45:11 +02:00
David Oberhollenzer
7b647eefef Release init-0.7 2018-10-07 02:10:17 +02:00
David Oberhollenzer
209121cdeb Add nginx service
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-10-07 02:10:17 +02:00
David Oberhollenzer
e171f88865 Remove pid fron cron serives, reap children in signal handler
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-21 18:08:48 +02:00
David Oberhollenzer
a191a7cc18 Fix gitignore service exclusion
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-21 14:40:52 +02:00
David Oberhollenzer
66dde441bc Add helper script to update the time from NTP
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-21 12:41:42 +02:00
David Oberhollenzer
33aa4cedff Update documentation
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-19 12:22:14 +02:00
David Oberhollenzer
a4dddb7777 Add cron job for swclocksave
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-19 12:22:14 +02:00
David Oberhollenzer
b9ba11b4db Add service commands to manage gcrond services
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-19 12:22:14 +02:00
David Oberhollenzer
f38163772c Add simple cron implementation
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-19 12:22:14 +02:00
David Oberhollenzer
5cd5f48f76 Add helper library for cron configuration
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-17 14:53:19 +02:00
David Oberhollenzer
481744a2ba Move splitkv function to libcfg
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-16 01:12:06 +02:00
David Oberhollenzer
5b78d4d695 Add an optional service for switching the console font
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-12 18:44:29 +02:00
David Oberhollenzer
ce7c79a639 Release init-0.6 2018-09-01 17:46:14 +02:00