- Increase size of resulting path buffer, unlikely a real problem
- Check return value from snprintf() to detect errors and truncation
- Add logit() function wrapper to initctl, maps to _e()/_d()/_pe()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The commands are both unsafe (insecure) and send the wrong message,
that initctl can be used to script conditions. Only plugins are
officially supported to manage conditions.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Similar to how systemd creates cgroups for all services, for purposes of
tracking, Finit now does the same. We also mount all available cgroups
in the /sys/fs/cgroup namespace.
This patch adds support for grouping processes in logical cgroups, like
systemd, and an `initctl ps` command to list the hieararchy.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Allows the service/task name derived from the binary to be
overridden with a custom name.
Example:
service name:dhcpd [2] /usr/sbin/udhcpd -f -- DHCP Server
Signed-off-by: Robert Andersson <robert.m.andersson@se.atlascopco.com>
This patch introduces a new option to initctl; -b, --batch skips
screen_init(), which might otherwise leak ANSI screen resize codes
to the console.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
The job:id field can now be used to display job:INET_PORT_NUMBER, e.g.
100:16161 for job 100 localhost SNMP port 16161.
The service name field has been reduced from 20 --> 16 bytes since the
full path has been reduced to display the basename.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This change is one of the required intermediate steps to remove the
shared memory store for all svc_t, this in turn to avoid any external
programs manipulating the internal memory of PID 1.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
For ease of use, allow short forms of commands, like:
initctl h
initctl c d
initctl l
Also, default to show conditions if no argument to cond is given.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch fixes an invalid use of strpbrk() causing all cond
sub-commands, except initctl cond show, to fail.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds a '-' for each runlevel a service/task is not part of.
The resulting listings are easier to read and also makes it clearer to
the user what happens when changing runlevels.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This patch adds support for enabling and disabling services in
/etc/finit.d/ by adding another subdirectory:
/etc/finit.d/available
Enabled service/run/task stanzas are by convention symlinked
to the parent dir. The initctl tool has three new convenience
commands to facilitate operating with this:
initctl list
initctl enable <CONF>
initctl disable <CONF>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>