Robert Andersson
f2cab53e55
Add service/task name config option
...
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 >
2018-10-22 12:51:58 +02:00
Joachim Nilsson
7fdb280712
initctl: Introduce -b[atch] mode for non-interactive use
...
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 >
2018-02-16 10:06:37 +01:00
Joachim Nilsson
84e9569be6
initctl: Adjust field widths in show/status
...
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 >
2018-01-17 18:42:24 +01:00
Joachim Nilsson
112ab2c22f
initctl: Refactor, use struct command rather than command_t
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2018-01-04 11:15:55 +01:00
Joachim Nilsson
8fd431f3e9
initctl: Show uptime of running services in show <NAME> output
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-12-31 18:30:08 +01:00
Joachim Nilsson
b26d30757d
Document new initctl status <JOB|NAME> command
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-12-31 17:11:15 +01:00
Joachim Nilsson
bb3d9c8670
initctl: Add support for touch <CONF>, mark .conf for reload
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-12-22 12:50:18 +01:00
Joachim Nilsson
db50c09ec5
initctl: Improve show SVC command output a bit, provide summary
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-12-18 21:04:17 +01:00
Joachim Nilsson
c0515d112e
New client side API to access svc_t entries without shared memory
...
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 >
2017-12-18 11:06:19 +01:00
Joachim Nilsson
7362e6d00a
initctl: Fix error handling for intictl start/stop if missing arg
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-12-17 12:12:57 +01:00
Joachim Nilsson
d94d11e00a
initctl: Allow short forms of commands
...
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 >
2017-12-17 12:09:41 +01:00
Joachim Nilsson
f06a0fcb71
initctl: Support printing previous runlevel
...
This patch adds support for "PREVLEVEL RUNLEVEL" output to the initctl
runlevel command.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-12-17 10:54:06 +01:00
Joachim Nilsson
cae61ad6df
initctl refactor, break out domain socket/client API
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-12-16 12:15:28 +01:00
Joachim Nilsson
fcdb5c2965
initctl: Refactor, reduce code duplication
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-12 22:58:50 +01:00
Joachim Nilsson
c82dc54205
initctl: Minor refactor, handle errors first
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-12 02:46:19 +01:00
Joachim Nilsson
51c5f3cbfa
Length of the ANSI escaped runlevels string is 20 chars, need 21
...
Problem reported by @wkz
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-23 19:20:25 +02:00
Joachim Nilsson
a36dafaa6c
README: Update initctl usage
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-19 20:16:37 +02:00
Joachim Nilsson
c092d22d48
initctl: Default to show services listing, not usage text
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-19 20:01:15 +02:00
Joachim Nilsson
3e71d43bff
Follow-up to 22192ac, missing semicolon
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 23:19:41 +02:00
Joachim Nilsson
22192acce4
initctl: Make sure to NUL terminate info string from Finit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:53:23 +02:00
Joachim Nilsson
1c9f2e9b55
initctl: Fix set/clear condition
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-16 16:49:35 +02:00
Joachim Nilsson
9b8e7a0793
Minor, update documentation on raw condition dumps
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-16 14:54:48 +02:00
Joachim Nilsson
3f150901fe
initctl: Align STATUS output from cond show and dump
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-16 11:26:43 +02:00
Joachim Nilsson
fd090a6785
initctl: Fix 'cond dump/set/clear' commands, only show worked
...
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 >
2017-10-16 11:23:57 +02:00
Joachim Nilsson
83445f1ebe
initctl: show, use '-' for runlevels service is not member of
...
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 >
2017-10-16 09:43:58 +02:00
Joachim Nilsson
94aec26e8c
initctl: shoow, adjust width of runlevels column, needs 12 chars
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-16 08:42:47 +02:00
Joachim Nilsson
75d29de3cc
initctl: Use entire screen width for task/service description
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 00:19:10 +02:00
Joachim Nilsson
be6f0de0df
Add util.c:screen_init() to probe screen size once per boot
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 20:58:43 +02:00
Joachim Nilsson
405cf4d997
initctl: Use actual terminal/screen width for table listings
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 12:55:34 +02:00
Joachim Nilsson
9bcb3e5778
initctl: top:ify table headings, i.e. use captial letters
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 12:39:41 +02:00
Joachim Nilsson
c97e23bd58
initctl: Remove currently unused -d debug flag
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 12:38:22 +02:00
Joachim Nilsson
73f1b986dd
initctl: Fix regression in initctl utmp
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 12:37:59 +02:00
Joachim Nilsson
b06502b0cb
initctl: Use printheader() from libite for table headings
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 12:37:20 +02:00
Joachim Nilsson
30822f0d68
Remove UNUSED() macro and disable the compiler warning instead
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 21:59:23 +02:00
Joachim Nilsson
60df2f2ea9
Minor, cleanup old requirement for clients to set silent
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 12:41:23 +02:00
Joachim Nilsson
018a87286c
initctl: Sort commands in usage according to topic
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-30 12:12:13 +02:00
Joachim Nilsson
3428cd48b7
Fix #71 : Add support for enabling/disabling services in /etc/finit.d
...
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 >
2017-06-29 22:23:38 +02:00
Joachim Nilsson
36f38d5a13
initctl: Only append space between args, not at last arg
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-29 22:21:33 +02:00
Joachim Nilsson
9df0454b64
initctl: Support for utmp show FILE
...
This patch adds support for showing a log rotated (uncompressed)
UTMP/WTMP file in initctl.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 11:44:57 +01:00
Joachim Nilsson
bbbaba7b47
Minor cleanup
...
initctl: Replace daemon-only API from user tool
utmp-api.c: Remove not needed header
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:20:29 +01:00
Joachim Nilsson
0f64e18f27
Relocate utmp_show() to initctl.c
...
Only used by this tool, no need to keep it in the shared utmp-api.c
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:17:41 +01:00
Joachim Nilsson
958cab8cc7
Relocate runlevel_string() to initctl.c
...
Only used by this tool, no need to keep it in helpers.c
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:11:52 +01:00
Joachim Nilsson
f76268dec9
initctl: Fix build warnings after de4bf53
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-24 09:15:30 +01:00
Mattias Walström
de4bf53536
initctl: Add 'initctl cond dump' to show all conditions in the system
...
Remove verbose of initctl cond, and replace it with 'initctl cond dump'
Show all conditions if they are in flux/on even if there are no other
services depending on this condition.
Signed-off-by: Mattias Walström <lazzer@gmail.com >
2017-01-18 16:15:52 +01:00
Joachim Nilsson
fff68b7b06
Relocate source files to an src/ subdirectory
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:31:02 +01:00