aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
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-04-24cleanup: merge runsvc back into initdDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-04-06runsvc: make sure we close all fds before running a serviceDavid Oberhollenzer
Just in case initd leaks anything. Also, the service has no buisness writing all over /dev/console. It's a system service, it better use syslog or its own internal logging service. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-04-06cleanup: simplify runsvc environment config parsingDavid Oberhollenzer
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-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-29Add service configuration reloadingDavid Oberhollenzer
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-28Add start/stop commands to service toolDavid 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-24Add hacky utiliy that waits for the presence of some filesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-21Make service status matching fuzzier (also allow service name match)David Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-20cleanup runsvc: merge codepaths for execution, remove cleanup codeDavid Oberhollenzer
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-20Dump more information in service status commandDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-19Seperate service loading/error loging from dumpscript commandDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18cleanup: remove broken stat ... open patternDavid Oberhollenzer
confused deputy is confused. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-18Add filtering parameters to status commandDavid Oberhollenzer
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 status report command to service command line utilityDavid 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-21Remove cron daemon, rewritten and split off into seperate repoDavid Oberhollenzer
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-04Seperate init specific code from utility codeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-11-03Remove usyslogd/klogd and syslog utility programDavid Oberhollenzer
This is split out to a seperate package. 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-19Update documentationDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-09-19Add service commands to manage gcrond servicesDavid 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-01Centralize/unify version string printingDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-31Add man page for service commandDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-31Add man page for syslog commandDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-28Add man page stub for shutdownDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-08-24Cleanup shutdown command, make reboot a symlink to shutdownDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-07-23Clean up service list short listing formatDavid Oberhollenzer
We already print the services in dependency order, for each target individually. There is no need to print the depencies and the target for each service. In addtion, printing name and description in one line shortens the resulting list. 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-11Add utility for producing syslog message from the shellDavid Oberhollenzer
This can can be used by shell scripts to produce syslog messages, as well as aiding in debugging the usyslogd daemon. 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 helper program for running servicesDavid Oberhollenzer
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-22Add flags to selectively skip fields in service filesDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-04-12Build system and directory structure cleanupDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-25Add System V init like killall5 helper programDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-24Add license headers and comments to sourceDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-03-24Initial commitDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>