aboutsummaryrefslogtreecommitdiff
path: root/lib/include
AgeCommit message (Collapse)Author
2020-05-13Add utility functions for clearing/setting signal maskDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-05-08Implement a "subreaper" service flagDavid Oberhollenzer
For particularly hostile daemons. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-05-08Cleanup: complete redesign of the initd supervisorDavid Oberhollenzer
- Cleanly seperate service description parsed from file from the actual run-time data. - Remove the use of the signalfd and make asyncronous calls into the supervisor from signal context work. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-05-07Temporarily remove initsock handling codeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-04-24Cleanup: remove flag mechanism from config parser entirelyDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-04-24Cleanup: remove rdsvc flagsDavid Oberhollenzer
With the previous changes, there were only used by the status command. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-03-31cleanup: delete remains of libutilDavid Oberhollenzer
- 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>
2019-06-16Add RDSVC_NO_DESC flagDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-06-16Remove unused SOCK_FLAG_* enumDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29Keep original respawn limitDavid Oberhollenzer
We also want this meachanism to still work for manually started service (especially after reloading services). Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29cleanup: init socket wire formatDavid Oberhollenzer
Replace array adhockery with structs and make use of the handy endianness conversion macros. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29cleanup: init status responseDavid Oberhollenzer
- rename init_status_response_t to init_status_t - merge code for handling it - fix memory leak in status command Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29cleanup: move init specific stuff of init socket to initdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-28Add start/stop commands to init socketDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-28Include service ID in initsock status responseDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-28initd: Hand out unique IDs to servicesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-27Add filter argument to status requestDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-27Use fixed size integer for init socket requestDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-20initd: don't start runsvc for services without exec blockDavid Oberhollenzer
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-18Cleanup status reportingDavid Oberhollenzer
- 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-18Add functions to transmit service status accross initd socketDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18Add helpers for initd socketDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2018-11-23Remove some no longer needed cruftDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-23Relicense what is left of the init system under OpenBSD style ISC licenseDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04Move cron library code to crondDavid Oberhollenzer
Nothing else uses it. Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04Remove unused telinit codeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04cleanup: let rdline_init open the fileDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04Add fopenat utility functionDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-04Seperate init specific code from utility codeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-10-10Configuration parser cleanupDavid Oberhollenzer
- 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-09-21Remove pid fron cron serives, reap children in signal handlerDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-19Add simple cron implementationDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-17Add helper library for cron configurationDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-16Move splitkv function to libcfgDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-01Centralize/unify version string printingDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-24Remove ctrl+alt+del target, simply initiate reboot targetDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-07-22Add output truncation flagDavid Oberhollenzer
This commit adds a "truncate" flag that can be added to a service description between the "tty" keyword and the path string. If the flag is set, the output file is truncated to 0 after opening. This probably requires some remodeling in the future as the tty keyword no longer deals with just tty devices. Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-09Make mksock() more generic, move to util libraryDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-09Split configuration parser and utility libraryDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-22Add flags to selectively skip fields in service filesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-22Store original file name in service structureDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-11Don't pre-allocate argument vector for command linesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-11Don't split dependencies into argument vector, keep list of stringsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-11Split bulk of split_argv out into helper functionDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-11Cleanup: redeuce number of allocations in rdsvcDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-11Make line buffer static, move error reporting to rdlineDavid Oberhollenzer
- Expose rdline_t struct and move a lot of extra processing to rdline code - Make line buffer statically allocated - Simplify rdsvc code Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-04Add comments to library headersDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-04Merge preprocessing of command linesDavid Oberhollenzer
- 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-04Simplifiy service file syntaxDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-04Merge argument substitution into rdlineDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>