- Show if exited/signaled
- Show status code and the std /NAME
- Show signal value and the std /NAME
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- List /etc/finit.conf
- Allow edit of /etc/finit.conf, using finit/finit.conf or NULL
- Add helpful question to edit /etc/finit.conf if no edit arg.
- Show available files if delete has no arg, like disable
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The main purpose of this patch is to remove top-level cgroups when they
are remvoed from finit.conf. However, this is tricky, becasue there may
still be supervised services (and children of them) running. We must
postpone removal until a cgroup.events change. To make matters worse,
events may arrive out-of-order, i.e. the last-child event for the parent
cgroup before the sub-group.
A spin-off from this patch is that we can now support arbitrarily long
group names and group config. (Only applies to top-level cgroups, not
run/task/services.)
Limitations:
- Processes in "removed" cgroups are not migrated/orphaned, the reasons
are several: overhead and complexity and the fact that memory cannot
be migrated
- A lingering child of a moved service may prevent an old top-level
cgroup from being removed.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
We have these neat extras for added value, if they should fail, for
whatever reason, we still want to present 'top' to the user, which may
have to use 'reset' if exited improperly and lost cooked/cursor.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
We check it everywhere else, and a log message for failing to move PID 1
to the init cgroup is useful as well.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
No need to zero out whole buffer for strlcat(), or other string check
ops. Also drop a few completely useless memset() calls.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Set TTY in raw mode to be able read a single char at a time
- Hide cursor
- Trap 'q', Ctrl-C, Ctrl-\ and SIGTERM to restore TTY and cursor
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is intended to be used with the 'top' command to aid in setting up
and verifying proper limits for services.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Replacing write() with dprint() without thinking leads to duplicate
output in getty. In particular '\n login: foo login: ".
Must check if length is > 0, or dprint() will calculate it on its own.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch corrects a logical glitch, or design flaw, in initctl. The
'restart FOO' command did not stop+start FOO only send SIGHUP (provided
FOO supports SIGHUP). Hence, a new command 'reload FOO' is introduced,
which does exactly that, and 'restart FOO' now stops and restarts FOO.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Fixes the GCC warning for unchecked return value from write():
... ignoring return value of ‘write’, declared with attribute warn_unused_result
The new dprint() function wraps write() in a bounded retry-loop that
catches EINTR. The length argument is optional computed with strlen()
if omitted (zero).
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>