Mostly used during development, doesn't really provide any value to the
user at normal runtime. Leave it commented out though so user can do
debug themselves if needed.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Refactor screen_init()
- use native impl. of TTY probing from pimd project
- check if TIOCWINSZ works
- check if we're running in watch(1), for initctl
- check if ANSI goto(999,999) escape seq. works (invasive)
- fallback to 80x24
- Drop screen_exit()
- Rename screen_init() to get_width(), for now, matching pimd
- Relocate call in main() to banner(), first fn to write to TTY
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
With the recent changes to the condition handling it has become more and
more evident that the canonical reference for a task/run/service is the
NAME:ID representation. Up until now we've kept the older JOB:ID for
some sort of compatibility fallback.
This patch removes the support to simplify maintenance going forward.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is quite possibly the ugliest pieces of code in this project.
It is a quick fix to the problem with strtok() to split up the cmd into
cmd + args[]. Without it wordexp() will later get very cranky about
trying to expand `"Partial` strings from commands like this:
/sbin/udhcpc-wrapper.sh -f -S -V "myOS v9.99" -t 8 -T 5 -A 10 -R -p \
/var/run/udhcpc-vlan1.pid -i vlan1 -x hostname:myos-12-34-50 -o \
-O 1 -O 3 -O 6 -O 7 -O 12 -O 15 -O 42 -O 121 -a
Yes really.
It's an obviously far from perfect solution. One might even start to
question why we have an args[64[64] per svc_t and not just a cmd + arg?
Well, there's a lot of improvement potential here, let's talk!
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
If mg doesn't exist, command doesn't evaluate the second argument (vi),
so we need to use `... || command -v vi` instead. Found during demo,
because why not.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch fixes an issue with rescue mode on Alpine Linux where the
rescue shell was never properly started.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Turns out that on some systems, that has none of the first two, and
neither of the two environment variables set in ${VISUAL:-${EDITOR}},
they evaluate to 'sh /etc/finit.d/file.conf', which is true, so we
wouldn't even try mg or vi ...
This patch reverts to the spirit of Andreas Egebergs initial commit,
which turns out to be a better solution anyway :)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Both Debian and Builroot based systems use /etc/default and
Alpine Linux use /etc/conf.d, so let's just put both in by
default. If the directories exist we monitor them.
The --with-syconfig configure option is now disabled by default.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The module setting is deprecated, other mechanisms exist. This change
is to ensure we don't try to (re)load any modules at runtime, only at
bootstrap.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch collapses the two similar functions parse_conf() and
parse_conf_dynamic() into a single function. It also lifts old
restrictions on what config stanzas are allowed in /etc/finit.d
The only remaining restriction is the global rlimits, they remain
as the last setting only possible to define /etc/finit.conf which
then applies to all other services.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>