Joachim Nilsson
e4401f92ad
Bump version for v3.0 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-19 09:58:05 +02:00
Joachim Nilsson
0197a9427c
Update ChangeLog for v3.0 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-19 09:58:05 +02:00
Joachim Nilsson
49481053a4
Fix GCC 7 string truncation warning, too small temporary buffer
...
In GCC 7 the -Wall infers the new -Wformat-truncation which finds
problems with string truncation in functions like snprintf().
This patch suppresses the warning by allowing only a subset of the
parent inetd service description to be copied to the child connection.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-19 09:58:05 +02:00
Joachim Nilsson
13887f323a
Fix GCC 7 string truncation warning, too small temporary buffer
...
In GCC 7 the -Wall infers the new -Wformat-truncation which finds
problems with string truncation in functions like snprintf().
This patch fixes a possibly problem in path name creation which,
combined with the scandir() function, might cause loss of .conf
files, failure to call run-parts properly, and kill services at
shutdown.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-19 09:58:05 +02:00
Joachim Nilsson
faca84a590
Fix GCC 7 string truncation warning, too small temporary buffer
...
In GCC 7 the -Wall infers the new -Wformat-truncation which finds
problems with string truncation in functions like snprintf().
This patch fixes a problem in condition parsing for very long
PID filenames which might be truncated in internal buffers
causing a mismatch in Finit condition tracking.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-19 09:58:05 +02:00
Joachim Nilsson
920df09cd5
Fix GCC 7 warning, convert "Fall through" to "fallthrough" comment
...
In GCC 7 the -Wextra infers the new -Wimplicit-fallthrough which can be
suppressed by adding a simple comment
/* fallthrough */
Which we had, but was too verbose (and misspelled) for GCC to notice.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-19 09:58:05 +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
5c3a07e8e6
tty_exist(): Simplify, no need to call access() and then open()
...
Found by Coverity Scan, classified as security issue but was just
unnecessary overhead.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 23:06:04 +02:00
Joachim Nilsson
11dd877484
initctl: Fix possible divide by zero, found by Coverity Scan
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 23:01:07 +02:00
Joachim Nilsson
921fd1e363
service_start(): Don't fclose() invalid file pointer, found by Coverity Scan
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:58:31 +02:00
Joachim Nilsson
f949017596
logrotate(): Ignore any error from rename(), file may not exist
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:57:18 +02:00
Joachim Nilsson
03a33fc0ee
Check stat() return value, found by Coverity Scan
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:56:02 +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
500d301700
tty_unregister(): Fix possible out-of-bounds access, found by Coverity Scan
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:45:02 +02:00
Joachim Nilsson
e8f26709e2
service_register(): Fix possible memory leak, found by Coverity Scan
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:41:13 +02:00
Joachim Nilsson
91b3e5eeb4
inetd: Fix possible tcp socket leaks, found by Coverity Scan
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:37:21 +02:00
Joachim Nilsson
71026adf03
tty_register(): Fix possible memory leak, found by Coverity Scan
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:32:26 +02:00
Joachim Nilsson
978beb8e7e
Don't log if failed to remove non-existing condition
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 22:05:00 +02:00
Joachim Nilsson
3ef75ac176
debian: Mention the possibility to change the default init to Finit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 21:49:19 +02:00
Joachim Nilsson
83b613581a
void: Clean up README
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 21:48:58 +02:00
Joachim Nilsson
d4c28f87d1
void: Update installation instruction, recommend manual edit of grub
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 19:15:28 +02:00
Joachim Nilsson
5b53f001a2
Revert parts of c2bf7d3, core-services scripts not executable
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 11:24:29 +02:00
Joachim Nilsson
f1c9581da9
service_start(): Must set GID before dropping user privs, obvs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 11:05:59 +02:00
Joachim Nilsson
5301bcb4f1
void: Drop-privs to correct @username:group
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:51:39 +02:00
Joachim Nilsson
c2bf7d3a50
void: Call runit core startup scripts using run-parts at bootstrap
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:30:21 +02:00
Joachim Nilsson
685771aef2
void: Simplify uuidd service description
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:29:53 +02:00
Joachim Nilsson
3ebb697910
Install a proper #!/bin/sh style rc.local on Void Linux
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:18:11 +02:00
Joachim Nilsson
bacaea0e02
bootmisc: Fix misspelled uuidd
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:14:56 +02:00
Joachim Nilsson
07d6e69c30
bootmisc: Check return value from getgroup()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:10:13 +02:00
Joachim Nilsson
d2053bd07d
bootmisc: Follow-up to f4662d8
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:09:15 +02:00
Joachim Nilsson
1e8a45cbe2
void: Remove non-working hack to create /run/uuid in <service>.conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:06:12 +02:00
Joachim Nilsson
f4662d8c06
boomisc: Create /run/uuid for Void Linux if uuid user exists
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:05:46 +02:00
Joachim Nilsson
38ba9930d0
helpers.c:getuser() - Make @home an optional argument
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 10:03:54 +02:00
Joachim Nilsson
00fe37174d
Refactor initial /dev popoulation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 09:57:38 +02:00
Joachim Nilsson
33916a2097
Fix #82 : Revert parts of 34a1524 and add workaround from Void Linux
...
In commit 34a1524 the start of udevd was refactored to allow it to be a
properly monitored service caused systems using eudev to malfunction.
This patch reverts part of that commit and adds a workaround found when
trying to reproduce issue #82 on Void Linux:
- Start a temporary udevd in the background
- Call udevadm to trigger bringup of all subsystems and devices
- Wait for everything to settle
- Tell temporary udevd to exit (new)
In the world of `mdev` this song and dance act is not required.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 09:43:37 +02:00
Joachim Nilsson
dd8dd67106
void: Create /run/uuid directory and start uuidd as @uuid:uuid
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 09:14:22 +02:00
Joachim Nilsson
eb870efaff
Add support for setting effective group ID of services
...
Finit has long since supported an @user:group syntax to services, tasks,
and run stanzas. Setting UID was implemented at that time, but setting
GID never was. This patch fixes that oversight.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 09:11:23 +02:00
Joachim Nilsson
84369ab8b5
void: No syslogd to wait for in Void Linux
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 08:54:24 +02:00
Joachim Nilsson
7ef3959a45
Minor, consistency in presentation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-18 08:14:29 +02:00
Joachim Nilsson
858f793ad2
Initial support for Void Linux
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-17 23:53:24 +02:00
Joachim Nilsson
8749459206
doc/condiitions.md: Update and simplify, hopefully more readable
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-16 17:07:52 +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
e88241316b
Prune bootstrap tasks/services that never ran
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-16 09:42:08 +02:00
Joachim Nilsson
f91205cbad
initctl: list, only print whitespace separator between services
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-16 08:43:29 +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
11026d9da3
initctl: Minor, use local screen_cols rather than SCREEN_WIDTH
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-16 08:42:03 +02:00
Joachim Nilsson
a6a3299f08
Free cmd from which() after having registered the udevd service
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 23:10:42 +02:00
Joachim Nilsson
34a15241ca
Convert udevd to a regular system service
...
This patch, similar to the work done in the d-bus plugin, converts the
udevd service from a non-monitored run_interactive() task that forks
itself into the background, to a proper Finit monitored service.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 23:10:18 +02:00
Joachim Nilsson
7a2667d34c
plugins/dbus: Free cmd returned from which() when done
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 23:01:10 +02:00
Joachim Nilsson
f39cd50762
plugins/dbus: Use cmd found by which() to start dbus-daemon
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 22:48:04 +02:00
Joachim Nilsson
ddeed15191
plugins/dbus: Start dbus-daemon with absolut path
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 22:45:01 +02:00
Joachim Nilsson
2b173e831f
service_start(): Redirect service output to /dev/null by default
...
This patch prevents output of stderr/stdout from services to leak to the
console. Use the 'log' keyword to service/run/task stanza to redirect
output to syslog.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 21:39:58 +02:00
Joachim Nilsson
b02f241e5e
plugin/dbus.c: Minor, documentation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 21:18:21 +02:00
Joachim Nilsson
1a45045a0f
service_register(): Do not modify input string, may be read-only
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 21:17:00 +02:00
Joachim Nilsson
e131b20a6c
service_register(): Make sure to initialize username to NULL
...
Follow-up to 7d9f873 , which converted this from a function argument to a
local variable.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 20:47:18 +02:00
Joachim Nilsson
888ce56f3e
plugin/dbus.c: Register dbus-daemon as a service
...
This patch changes how the D-Bus plugin starts dbus-daemon, from being
started in the background to letting Finit start and monitor it.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 20:46:22 +02:00
Joachim Nilsson
7d9f873b7c
Follow-up to a2f4b35, remove username arg from service_register()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 20:32:11 +02:00
Joachim Nilsson
cf60cdd9c9
Fix termios regression on PPC introduced in 907595d
...
For some reason PPC is much more sensitive than ARM when it comes to
termios changes. This patch fixes a regression in Ctrl-C handling
after login introduced in 907595d when blocking of Ctrl-C was added
to prevent breaking the login-prompt.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 20:12:37 +02:00
Joachim Nilsson
bb27dde3ca
Nope, keep original logo to home page instead, this is Finit3
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 13:34:39 +02:00
Joachim Nilsson
6d02c6a71c
New logo on top maybe?
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 13:33:17 +02:00
Joachim Nilsson
f0c5c2d7f2
Play around a bit with altering logo
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 13:32:23 +02:00
Joachim Nilsson
29357acf18
Update bootstrap.md to match Finit3 changes
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 13:09:26 +02:00
Joachim Nilsson
a32d3b0c87
Update ChangeLog upcoming v3.0 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-15 12:41:55 +02:00
Joachim Nilsson
510b53e62d
Add simple ToC
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:35:51 +02:00
Joachim Nilsson
23481b197b
build.md: Simplify and sectionalize better
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:34:09 +02:00
Joachim Nilsson
4782b1dc54
conditions.md: Remove ToC heading and rewrite introduction
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:30:31 +02:00
Joachim Nilsson
1ee1b9cec4
signals.md: Clarify and update slightly
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:22:45 +02:00
Joachim Nilsson
cef2ef82b6
Add mini ToC for overview
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:20:46 +02:00
Joachim Nilsson
cafa759edb
distro.md: Clarify vague leading paragraph
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:18:15 +02:00
Joachim Nilsson
cf0554405b
bootstrap.md: Start updating, needs more work ...
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:17:42 +02:00
Joachim Nilsson
f6071d6701
contrib: Rename tty.conf to getty.conf to reduce confusion
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:09:35 +02:00
Joachim Nilsson
7104296396
Remove ToC heading and audit grammar + wording in Limitations section
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 16:04:56 +02:00
Joachim Nilsson
38a274114d
Allow registering TTYs that are not yet available
...
This patch removes the following very annoying warning for TTY devices
not yet available, i.e. plugged-in to the system.
Loading configuration ............................................................................. [ OK ]
[ 11.097414] finit[1]:tty_register():Incomplete or non-existing TTY device given, cannot register.
[ 11.101457] finit[1]:tty_register():Incomplete or non-existing TTY device given, cannot register.
Mounting filesystems .............................................................................. [ OK ]
Finit will not start a getty (built-in or external) if the TTY does not
exist, but having the configuration enabled makes it possible to do a
simple `initctl reload` to activate a plugged in TTY.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-14 13:14:48 +02:00
Joachim Nilsson
97eca563b6
Reduce indent and remove non-matching keyword conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 08:34:32 +02:00
Joachim Nilsson
0174347039
Use Apache .conf highlighting for finit.conf sample
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 08:32:43 +02:00
Joachim Nilsson
02cc426f05
Update Alpine screenshot, removed failing/missing D-Bus service
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 08:17:37 +02:00
Joachim Nilsson
06d9d95723
Minor updates, linking to scripts, grammar
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 08:11:59 +02:00
Joachim Nilsson
b8a7f3e0cc
Link to Alpine Linux home page
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 08:08:18 +02:00
Joachim Nilsson
7db0e265ad
Link to Alpine Linux home page
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 08:07:06 +02:00
Joachim Nilsson
6818813ff8
plugins/dbus: Conditionalize, don't run if dbus-daemon is missing
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 08:02:59 +02:00
Joachim Nilsson
5b8f7ce2a3
Update screenshot, TroglOS Linux --> Alpine Linux
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 07:59:33 +02:00
Joachim Nilsson
1f9a6a42c1
Push badges even further down
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 07:37:22 +02:00
Joachim Nilsson
1c2d987bea
Place logo first, then badges
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 07:36:06 +02:00
Joachim Nilsson
906827cc88
Move documentation to doc/ sub-directory, all except README
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-13 07:35:09 +02:00
Joachim Nilsson
b2d98dc010
Update path to sample finit.conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 23:10:47 +02:00
Joachim Nilsson
d027b4ff9c
Relocate old sample finit.conf to contrib/
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 23:09:32 +02:00
Joachim Nilsson
843621aded
Move documentation to doc/ sub-directory, all except README + TODO
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 23:07:21 +02:00
Joachim Nilsson
da5ac16670
Minor
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 23:05:27 +02:00
Joachim Nilsson
2c68183045
Clarify actions of Alpine Linux install script
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 22:51:15 +02:00
Joachim Nilsson
c40cd06d60
Update Alpine README, we now have an install script
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 22:44:56 +02:00
Joachim Nilsson
c901b65581
Simplify
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 22:44:00 +02:00
Joachim Nilsson
27abcb5682
Add option to install Finit as system default init
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 22:41:20 +02:00
Joachim Nilsson
b7617248ce
Simple install script for Alpine Linux
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 22:35:17 +02:00
Joachim Nilsson
c400d35f83
Also include /usr/lib/pkgconfig in PKG_CONFIG_LIBDIR
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 22:26:37 +02:00
Joachim Nilsson
d236709457
Minor, script output updates
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 22:26:24 +02:00
Joachim Nilsson
07790f4044
Debian/REDAME: Clarify last paragraph, add reminder of /etc/rc.local
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 19:03:53 +02:00
Joachim Nilsson
3d5128be77
Remove Emacs Local Variables, not really needed and looks bad
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 19:01:25 +02:00
Joachim Nilsson
b37ea48e5d
Debian/README: Update, modernize, simplify, and clarify
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 18:54:34 +02:00
Joachim Nilsson
92616d2ac0
README: Add URLs for the various RFC inetd services available
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 18:46:14 +02:00
Joachim Nilsson
46bc75e7f3
README: Add more examples on conditions and multiple dependencies
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 18:43:47 +02:00
Joachim Nilsson
5f81404162
xdm.conf: Remove lightdm, now has its own .conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 18:25:51 +02:00
Joachim Nilsson
6ba7cfc851
Rename Debian xdm.com --> xdm.conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 18:24:41 +02:00
Joachim Nilsson
09d2243eba
Add Debian .conf for LightDM
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 18:23:19 +02:00
Joachim Nilsson
e97c5e5860
Increase log level for poweroff/reboot/halt
...
In case the kernel is incapable of handling a reboot,
power-off, or halt request we want to be able to let
the user perform some basic diagnose of the system.
The existing debug messages are good enough, and use
the correct grammar form, to be enabled always.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 09:03:24 +02:00
Joachim Nilsson
660a09c7c1
Reduce log level when skipping re-register of boostrap tasks
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 09:02:05 +02:00
Joachim Nilsson
41c003b221
Don't reload *.conf files when changing to runlevel reboot
...
... or if someone manages (regression) to change to runlevel bootstrap.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 08:56:08 +02:00
Joachim Nilsson
12d8ac2399
service_register(): Skip bootstrap services if not in bootstrap
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 08:55:42 +02:00
Joachim Nilsson
8dc263d508
Revert live logging of state machine
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 01:28:38 +02:00
Joachim Nilsson
afb3fada50
cond_reassert(): Use cond_set_path(), not cond_clear(), for reconf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 01:23:43 +02:00
Joachim Nilsson
227dda34f7
cond_set_path(): Log error if unlink() fails
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 01:23:16 +02:00
Joachim Nilsson
06479aa5f1
Remove reconf condition when .conf reload completes
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-12 01:07:09 +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
40fc95047d
Prevent 100% CPU, allow bootstrap tasks to fully complete
...
When collecting a bootstrap task we need to allow its state machine to
complete before cleaning them out.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 23:53:34 +02:00
Joachim Nilsson
5551324291
Minor, comment style
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 23:52:20 +02:00
Joachim Nilsson
46cef811d6
Make sure to step state machine when collecting bootstrap tasks
...
During the runlevel change from S --> 2 the state machine will pause,
waiting to collect all S-only tasks/services, before continuing.
When an S-only task/service is collected we therefore need to call the
state machine again so that it can reassert all conditions properly.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 23:02:13 +02:00
Joachim Nilsson
52ccd6d662
Use correct grammar form
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 22:54:48 +02:00
Joachim Nilsson
70afaa16f5
sm_step(): Log pending stopped svc if we exit state machine
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 22:05:33 +02:00
Joachim Nilsson
8a1015cf3e
API refactor, allow svc_stop_completed() to return the pending svc
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 22:04:17 +02:00
Joachim Nilsson
586f0a7799
Live debug stopped but not yet collected tasks
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 21:56:49 +02:00
Joachim Nilsson
474bd2f361
Minor, comment style
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 21:56:31 +02:00
Joachim Nilsson
0caa8330b7
Increase live debugging of main state machine
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 21:41:42 +02:00
Joachim Nilsson
c8d8c817e7
Minor, cleanup
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 21:29:21 +02:00
Joachim Nilsson
0d9542c222
Live debug
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-11 21:29:15 +02:00
Joachim Nilsson
b6be354508
Minor, whitespace
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 23:39:22 +02:00
Joachim Nilsson
448c6749d6
Add missing debug calls to RTM_NEWLINK and RTM_DELLINK
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 22:53:19 +02:00
Joachim Nilsson
0f09c1b0dc
Minor, comment fix
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 22:53:05 +02:00
Joachim Nilsson
7db6611593
Debian GNU/Linux: Minor caveats
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 22:15:27 +02:00
Joachim Nilsson
c9b13759a2
Debian GNU/Linux: Install finit.* using install and cp
...
A recursive cp is requried for finit.d
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 18:50:58 +02:00
Joachim Nilsson
449c712329
Remove old symlinks and install finit.d directory instead
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 16:15:36 +02:00
Joachim Nilsson
e27283c5e6
Add extra spacing
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 16:14:27 +02:00
Joachim Nilsson
f337efcc35
Debian GNU/Linux: Update install script
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 16:13:22 +02:00
Joachim Nilsson
3c7eaff7b3
Debian GNU/Linux: Update and sync build instructions with Alpine
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 12:00:04 +02:00
Joachim Nilsson
d4d42a7a75
Debian GNU/Linux: Convert finit.conf to finit.d/*.conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 11:59:29 +02:00
Joachim Nilsson
3c1c5621a5
Alpine Linux: Slight update + sync with Debian
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-10 11:46:02 +02:00
Joachim Nilsson
2d9c147e0e
Minor, fix comment within comment GCC warning
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-09 09:03:58 +02:00
Joachim Nilsson
53de1c8575
Follow-up to issue #81 , don't append error message again.
...
Also, when called multiple times, return workaround immediately instead
of warning again.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-01 22:07:21 +02:00
Joachim Nilsson
3d4e3c99ed
Fix #81 : Workaround for systems without SYSV shm IPC support
...
We should not let PID 1 fail on systems where Linux is built without
CONFIG_SYSVIPC, or the libc does not support shmget()/shmat().
This workaround implements a fallback to using calloc() for PID 1,
which means the initctl tool will not work properly. A better fix
would be to refactor the shm implementation to instead have initctl
call Finit using api.c for each svc_t. This has been added to the
TODO file as future work.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-01 20:52:01 +02:00
Joachim Nilsson
c1b6c7e840
TODO: Remove shm, as soon as possible
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-01 20:01:57 +02:00
Joachim Nilsson
f17515d791
Merge pull request #80 from joerg-krause/patch-1
...
helpers.h: fix build error: unknown type name ‘va_list’
2017-10-01 18:56:45 +02:00
Jörg Krause
48262e4250
helpers.h: fix build error: unknown type name ‘va_list’
...
Building finit with a uclibc-ng-toolchain fails with:
```
../src/helpers.h:53:43: error: unknown type name ‘va_list’
void printv (const char *fmt, va_list ap);
```
2017-10-01 16:50:39 +02:00
Joachim Nilsson
9d9dc74768
Minor corrections
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-01 01:26:43 +02:00
Joachim Nilsson
e1d1d1c795
Makefile: Remove service script wrapper from distribution as well
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-30 12:16:33 +02:00
Joachim Nilsson
fcfef0af47
Initial cleanup + refactor of Debian contrib files
...
We should no longer need to rely on runparts to handle initial set up of
keyboard and console.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-30 10:26:03 +02:00
Joachim Nilsson
c44c217c4a
Clean up unused and long since deprecated contrib files/patches
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-30 10:23:21 +02:00
Joachim Nilsson
d60fc1ce62
Refactor, simplify
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-29 01:22:10 +02:00
Joachim Nilsson
0a12997d32
Try right aligning Finit3 logo
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-29 01:21:07 +02:00
Joachim Nilsson
dce8031c83
Clarify, early on, that conditions also stop services.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-28 08:22:41 +02:00
Joachim Nilsson
bd9d9c8303
Add early example of conditions in service stanza
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-28 08:22:28 +02:00
Joachim Nilsson
956acc4b93
Update getty overview
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-28 08:10:31 +02:00
Joachim Nilsson
5ed54d79fc
Update configure flags
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-27 09:27:15 +02:00
Joachim Nilsson
acc77c27c3
Add URL to initctl reference
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-27 09:23:54 +02:00
Joachim Nilsson
bcb9fe039a
Move running and debugging to doc/build.md
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-27 09:22:04 +02:00
Joachim Nilsson
55f44386d1
Clarify focus, refer to examples and tell what the screenshot is
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-27 09:09:23 +02:00
Joachim Nilsson
37983e69c4
Clarify service stanza and simplify text further
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-27 09:08:32 +02:00
Joachim Nilsson
a45a872c28
Simplify introduction a lot, focus on screenshot and example
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-27 08:43:53 +02:00
Joachim Nilsson
152b2be8ea
Clarify warning
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-27 08:43:27 +02:00
Joachim Nilsson
1677436137
initctl: Allow C99 style
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-26 10:39:45 +02:00
Joachim Nilsson
c69ca6847a
Update ToC and move references to alternative init systems here
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-25 19:06:07 +02:00
Joachim Nilsson
f8147214f1
doc/config.md: Significant update, less limitations for /etc/finit.d
...
- Detail limitations in separate section
- Focus on syntax early in document
- Overhaul and simplify introduction
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-25 19:03:22 +02:00
Joachim Nilsson
56eec5164d
Minor, update code comment
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-25 19:02:19 +02:00
Joachim Nilsson
e58f84f3fb
Update introduction, much system config can be done using finit.d
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-24 20:54:27 +02:00
Joachim Nilsson
d22ffa05bd
initctl: Refactor initctl list slightly
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-24 20:41:40 +02:00
Joachim Nilsson
2e66db3fea
helpers.c:printv() - Iterate over size of buffer
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-24 20:40:44 +02:00
Joachim Nilsson
376811c1a7
doc/config.md: Update run and task, mention pipes + redirects
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-21 22:52:48 +02:00
Joachim Nilsson
9b5f2388c1
Alpine Linux: Add LXDM service .conf
...
Enable LXDM using:
initctl enable lxdm
initctl reload
The latter command reloads all /etc/finit.d/*.conf files and starts lxdm
in runlevels 2-5.
Remember to first edit /etc/lxdm/lxdm.conf, necessary to get a session.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 15:33:56 +02:00
Joachim Nilsson
686193b701
Only load modules at bootstrap
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 14:03:56 +02:00
Joachim Nilsson
b43bca529c
Minor, fix build error
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 13:57:23 +02:00
Joachim Nilsson
545171a8b2
Minor, improve comments in parse_dynamic()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 13:50:44 +02:00
Joachim Nilsson
d54d5b7f20
Allow kernel modules to be loaded from /etc/finit.d/*.conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 13:48:07 +02:00
Joachim Nilsson
e52d952ca5
Alpine: Move bootstrap services and setup from finit.conf to finit.d/*.conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 13:30:36 +02:00
Joachim Nilsson
633a56054b
Add support for boot[S]trap services in /etc/finit.d/*.conf
...
This patch enables support for bootstrap services in /etc/finit.d/
Please note, however, that this does not mean that all configuration
directives are now allowed in /etc/finit.d/*.conf -- the intention is
only to simplify distribution setups.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 13:21:11 +02:00
Joachim Nilsson
3eeb966f15
Alpine Linux: Simplify build instructions by referencing script
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 12:55:32 +02:00
Joachim Nilsson
d09253bdbd
Make Alpine build script executable
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 12:50:36 +02:00
Joachim Nilsson
0052793a46
Update Alpine Linux README
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 11:41:05 +02:00
Joachim Nilsson
333871caf2
Minor, reorder
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 11:40:56 +02:00
Joachim Nilsson
ef9d0c479e
Load mousedev kernel driver for Alpine installs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 01:40:24 +02:00
Joachim Nilsson
d5cce03a76
Enable D-Bus plugin for Alpine installs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-10 01:39:23 +02:00
Joachim Nilsson
744903d455
Alpine Linux finit.conf, clear space at end for easy script append
...
Restore original file layout somewhat, it's better if we clear the space
at the end of the file for easy `cat BOOTSTRAP.conf >>/etc/finit.conf`
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-06 08:12:44 +02:00
Joachim Nilsson
cc00be48b5
Move runlevel stanza to the end, possibly more intuitive
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 21:24:59 +02:00
Joachim Nilsson
b45a37ca47
Add simple build script for targeting Alpine
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 21:20:32 +02:00
Joachim Nilsson
f1f9ee712a
Refactor Alpine example to use /etc/finit.d/*.conf for services
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 21:15:11 +02:00
Joachim Nilsson
7c4a9ad5af
alpine: Migrate rc.local bootstrap tasks to finit.conf
...
Finit now supports pipes and redirects in run/task stanzas. Hence, we
can reduce rc.local to an example template.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 20:16:54 +02:00
Joachim Nilsson
f3a000560f
exec_runtask(): Refactor, remove GLIBC:isms to build with musl
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 20:05:22 +02:00
Joachim Nilsson
fdd13c1ae1
README: New shell redirect + pipe possibilities with task + run
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 16:35:22 +02:00
Joachim Nilsson
0585767258
README: Update tty configuration examples with noclear + nowait
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 16:35:04 +02:00
Joachim Nilsson
9e7e92b4b7
run stanzas are never caught in service_monitor()
...
A run stanza blocks operation by calling waitpid(), so it will never be
caught by the service_monitor() function. Hence, we need to clean up
any bootsrap calls after waitpid(), or at least perform a manual state
change.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 16:02:23 +02:00
Joachim Nilsson
29822ef0f7
Always collect bootstrap tasks, regardless of previous runlevel
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 16:02:01 +02:00
Joachim Nilsson
718e82bc10
svc_clean_dynamic(): Actually clean dirty services ...
...
Add missing call to svc_mark_clean() in while() loop.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 16:01:05 +02:00
Joachim Nilsson
684314db0f
Allow pipe + redirect in task/run stanzas, exec() in /bin/sh
...
This patch extends the capabilities of task and run .conf stanzas by
enabling pipes and redirects.
Example:
task [s] echo "foo" | cat >/tmp/bar
run [s] echo "$HOME" >/tmp/secret
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 16:00:49 +02:00
Joachim Nilsson
442598282f
Update Alpine Linux sample to latest Finit dev.
...
- Show progress when booting
- Use noclear + nowait on TTY's
- Update `loadkmap` args
Works on Alpine Linux 3.4 .. 3.6
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-04 07:19:12 +02:00
Joachim Nilsson
3e2b78305d
Update finit.conf tty documentation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-01 06:45:29 +02:00
Joachim Nilsson
8eea64cebf
getty: Set $TERM environment variable if given in tty config
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-01 06:41:22 +02:00
Joachim Nilsson
b8a7cb6b93
tty-register(): Fix regression in built-in TTY baud + term parser
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-01 06:40:52 +02:00
Joachim Nilsson
529b39ebba
tty: Add 'noclear' + 'nowait' options to built-in and external tty's
...
This patch aligns the two tty configuration stanzas, thus clear and wait
are now the default for both.
tty [LVLS] <DEV> [BAUD] [noclear] [nowait] [TERM]
tty [LVLS] <CMD> <ARGS> [noclear] [nowait]
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-01 06:10:08 +02:00
Joachim Nilsson
f029ba2111
Reorder functions a bit, group run_getty*() family
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-01 05:50:50 +02:00
Joachim Nilsson
277c3dbb14
getty: Remove TTY clear from built-in getty, delegate to run_getty()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-01 05:47:53 +02:00
Joachim Nilsson
f273ecc135
Fix #79 : Add 'nowait' option to tty setting, external getty
...
This patch makes it possible to disable the "Please press Enter" prompt
when using an external getty. Simply append `nowait` to the .conf entry
and Finit will spawn the getty immediately.
A future patch will add support for `noclear` as well to external getty,
as well as a change in default (=> `wait`) for the built-in getty.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-31 00:51:11 +02:00
Joachim Nilsson
2fe257b7af
getty.c: Handle Ctrl-U properly, erase line to beginning
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-30 17:19:43 +02:00
Joachim Nilsson
907595d9ed
getty.c: Ignore signals like SIGINT, SIGHUP
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-30 17:19:12 +02:00
Joachim Nilsson
55c12aa6f6
Remove developer debug message
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-30 15:08:14 +02:00
Joachim Nilsson
04891d3e5b
Update and align service descriptions in finit.conf example
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-30 15:05:31 +02:00
Joachim Nilsson
9973cd22a5
Update sample .conf files after purge of startx and user settings
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-30 15:02:39 +02:00
Joachim Nilsson
a2f4b35e4e
Fix #77 : Remove deprecated startx and user .conf settings
...
It is strongly recommended to instead use the service stanza to start
XDM/GDM, or use startx after a regular login.
Note: the `user NAME` setting was always reserved for use with startx
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-30 15:01:05 +02:00
Joachim Nilsson
1de540dd67
Update external getty TTY documentation, remove limitations
...
Also, provide an agetty example.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-30 14:47:15 +02:00
Joachim Nilsson
dec21e758a
Fix #78 : Support agetty cmd line format for external getty
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-30 14:44:10 +02:00
Joachim Nilsson
513f03b897
Merge branch 'external-getty-support'
2017-08-27 17:08:21 +02:00
Joachim Nilsson
371fb3d0d0
Add example for using an external getty
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-27 17:07:12 +02:00
Joachim Nilsson
f9f1846c8b
Document alternative tty ... config option for external getty
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-27 17:03:39 +02:00
Joachim Nilsson
f7b9b7be96
tty.c: Free memory for external getty on tty_unregister()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-27 16:57:26 +02:00
Joachim Nilsson
74affb32d3
tty_register(): Fix parser for external getty
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-27 16:43:01 +02:00
Joachim Nilsson
675f82a6b9
run_getty2(): Minor fixes only, whitespace + cautionary _exit()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-27 16:41:58 +02:00
Joachim Nilsson
19fcfcfef4
Initial support for external getty
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-27 15:02:55 +02:00
Joachim Nilsson
7c50d86a55
Restore pre built-in run_getty() as run_getty2()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-27 15:01:42 +02:00
Joachim Nilsson
b629348973
Refactor TTY exec, prepare for external getty
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-27 15:00:43 +02:00
Joachim Nilsson
7c185b4575
Fix really bizarre inetd builtin example ...
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-21 21:23:51 +02:00
Joachim Nilsson
fefa6a93ca
Merge branch 'emergency-shell-improvements'
2017-08-19 20:17:31 +02:00
Joachim Nilsson
299962118a
Update debug section with info on rescue shell, issue #76
2017-08-19 20:16:44 +02:00
Joachim Nilsson
054baed134
Reap zombie processes in emergency shell mode, issue #76
...
The emergency shell is just a Finit debug mode. This patch adresses a
concern from GitHub issue #76 , with zombie processes in this mode.
Emergency shell could be further improved, e.g. informing the real Finit
process of each collected child (zombie) to be restarted if needed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-15 08:09:19 +02:00
Joachim Nilsson
b20fafd9fa
tty.c: Add support for reloading a single TTY
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-14 11:03:59 +02:00
Joachim Nilsson
62081d9525
tty.c: Refactor, break out enabled check + stop/start
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-14 11:03:10 +02:00
Joachim Nilsson
100b4c70e4
tty_enabled(): Simplify, tty_exists() checks for existence
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-14 10:54:51 +02:00
Joachim Nilsson
5631849ced
Travis-CI: Update build dependency, libite --> v1.9.2
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-10 17:48:14 +02:00
Joachim Nilsson
14ee218443
Refactor, use libite (-lite) version of initscr()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 16:25:22 +02:00
Joachim Nilsson
52fe525442
Update version requirement for libite, v1.9.2
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 16:25:01 +02:00
Joachim Nilsson
fec00377e5
Update documentation for tty .conf option
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:36:31 +02:00
Joachim Nilsson
c9ab70e30f
Update section on built-in getty, add info on noclear option
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:18:16 +02:00
Joachim Nilsson
8aef1e76c3
Follow-up to eec32e2: Support for removing TTYs at runtime
...
In commit eec32e2 support for reloading TTY configurations was added.
This patch is a follow-up to that with support for cleaning up and
removing allocated TTYs.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:05:32 +02:00
Joachim Nilsson
44f69bd575
Check if symlink with lstat(), mtime with stat()
...
With the new scheme using /etc/finit.d/available/, and symlinks from
there to the enabled directory, we need to check mtime of .conf files
using stat(), not lstat() which we need to check if .conf is a symlink.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:05:32 +02:00
Joachim Nilsson
963b736d8b
tty: Refactor, remove useless runlevel argument
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:05:32 +02:00
Joachim Nilsson
4cc3aed139
Avoid 2 sec block of Finit when stopping TTYs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:05:32 +02:00
Joachim Nilsson
e791e3dbe9
Make silent bootup the default, use --enable-progress for old style
...
This patch disables console heading and bootup progress messages by
default. Use --enable-progress to get the old behavior back, or try
the new HOOK_BANNER and HOOK_SVC_UP to run a custom progress.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:05:32 +02:00
Joachim Nilsson
d34ee62f77
Update copyright years
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 15:32:24 +02:00
Joachim Nilsson
e48901b90f
tty: Clear tty before login: prompt by default, add 'noclear' option
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 15:31:59 +02:00
Joachim Nilsson
60f73dc952
tty.c: Refactor parsing of tty .conf stanza in tty_register()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 15:30:51 +02:00
Joachim Nilsson
eec32e299b
Allow loading TTYs from /etc/finit.d rather than /etc/finit.conf
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 15:28:22 +02:00
Joachim Nilsson
fe362341dc
finit.conf: Remove check config, replaced by fsck over /etc/fstab
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 15:01:31 +02:00
Joachim Nilsson
8505db24b7
Refactor, rename local variables
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 12:28:52 +02:00
Joachim Nilsson
560adb2065
Remove debug message(s) from tty_fallback()
...
When the TTY fallback mechanism is enabled tty_fallback() prints this
annoying debug message whenever *any* is process is collected by PID 1:
"Not starting fallback (%d) shell, lost pid %d", fallback, lost"
This patch removes it, and a two other useless debug messages.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 11:06:28 +02:00
Joachim Nilsson
6676d4b50c
Silence service start/stop *before* launching TTYs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 11:04:50 +02:00
Joachim Nilsson
c1bd3961cf
log_init(): If called with debug disbled set (or restore) LOG_NOTICE
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 00:11:24 +02:00
Joachim Nilsson
4fa47eaf71
log_init(): If debug mode enabled, set loglevel LOG_DEBUG
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 00:08:27 +02:00
Joachim Nilsson
e5f47024af
early_logit(): If debug mode enable, also print to stderr
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 00:07:49 +02:00
Joachim Nilsson
115b5f1ca7
Add HOOK_BANNER for plugins to override the default Finit banner()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 00:07:21 +02:00
Joachim Nilsson
878885e2b2
Load plugins much earlier, for future banner plugin
...
This patch moves the plugin loader much earlier, making it possible to
provide a custom banner/logo in a plugin.
To facilitate this move we need to also move banner later and parsing
of the kernel cmdline earlier, right after mouting /proc.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-08 00:05:07 +02:00
Joachim Nilsson
709e4230c8
plugin: Add private method plugin_exists() to check for HOOKs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 23:33:43 +02:00
Joachim Nilsson
46c5e41b68
README: Reduce indentation of code blocks, use ``` instead
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 23:18:06 +02:00
Joachim Nilsson
0b43d0dc70
Refactor screen_init(), preparing for migration to libite
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 23:00:27 +02:00
Joachim Nilsson
99f3f0291a
Makefile.am: Fix cut-and-paste error
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 21:48:16 +02:00
Joachim Nilsson
6d3d190134
reboot: Add search path to libite (-lite) headers and .so
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 21:40:46 +02:00
Joachim Nilsson
769659767c
Minor, comment fixes only
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 21:12:54 +02:00
Joachim Nilsson
99818f9ce0
Convert banner() and printv() to use new screen_init() values
...
This patch changes the traditional look of the Finit boot sequence.
Now we stick to the screen width probed by screen_init(), or max
132 chars.
Also, some minor cleanup of the currently unused print_timestamp()
method used by printv() when showing [ OK ] or [FAIL] of services
at boot.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 20:59:49 +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
91480a0f02
configure: Check for termios.h, needed by screen_width()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 12:55:10 +02:00
Joachim Nilsson
90793c71a2
util: Import screen_width() developed for the SMCRoute project
...
This patch introduces the screen_width() method from the SMCRoute
project. The code is hereby also available under MIT/X11.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-04 12:53:19 +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
c4b6fab3f3
Travis-CI: Update with latest version of libite, v1.9.1
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-03 16:46:52 +02:00
Joachim Nilsson
109b5bb9df
Update TODO, some completed and some deprecated features
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-03 15:16:36 +02:00
Joachim Nilsson
6f61e8e915
Remove hard-coded paths to system tools available in $PATH
...
Since at least a44daf2 both run() and run_interactive() can access all
system tools in _PATH_STDPATH. A system that uses non-standard paths,
e.g. /system/bin and /apps/bin, should update _PATH_STDPATH.
For reference, see issue #69 and PRs #70 and #72 .
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-03 13:18:42 +02:00
Joachim Nilsson
9c6e046d93
Remove hard-coded paths to system tools available in $PATH
...
This patch implemements a new feature of libite v1.9.1, whichp(), which
instead of fexist() that requires an absolute path, searches $PATH.
For reference, see issue #69 and PRs #70 and #72 .
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-03 13:13:55 +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
e46e3cdcb6
log.c: Filter debug messages by default, like before refactor
...
Ways to log:
- Set debug, using kernel cmdline, or edit the sources
- Change loglevel severity, default blocks > LOG_NOTICE
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 21:56:19 +02:00
Joachim Nilsson
260335a19f
Usability, a servivce stopped by a user is stopped, not blocked
...
The generic term for a non-running service is blocked, but a service may
be blocked for several different reasons. When a user stops a service
with `initctl stop` the intuitive expected output from `initctl show` is
"stopped" not "blocked".
When the user later restarts the service with `initctl start` it may of
course be blocked due to wrong runlevel or a missing condition. As can
be expected from the service's configuration.
The rest of the patch refactors the internal API names a bit to reflect
this change.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 15:42:44 +02:00
Joachim Nilsson
516dbcc512
Remove --disable-quiet and quiet mode, default to a sane behavior
...
This patch is a follow-up to 1f1c2e0 which introduced the new semantics
for the very confusing quiet and silent modes.
The initial idea was to loosely follow the kernel cmdline 'quiet' option
and as a working concept this was good. The resulting code, however,
became unnecessarily complex and the configure options impossible to
explain.
With this patch the quiet mode, and thus the --disable-quiet configure
option, is removed. Finit now defaults to a sane behavior: services are
shown only at startup. The --enable-silent option works like it did
before, silencing everything.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 13:40:54 +02:00
Joachim Nilsson
7a48240856
log.c: Do reopen syslog() when toggling debug => LOG_PERROR
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 13:19:22 +02:00
Joachim Nilsson
cda5938215
helpers.c: New function, printv()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 12:43:41 +02:00
Joachim Nilsson
cd947a69a8
log.c: New functions to hide access to quiet and silent flags
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 12:42:44 +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
51e1a907e6
log.c: New log_is_debug() function, hide access to debug variable
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 12:40:50 +02:00
Joachim Nilsson
e9d5512e1a
Refactor, simplify ... print() APIs already check if silent
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 12:38:35 +02:00
Joachim Nilsson
bd54cf6dee
log.c: New log_init() function, called at initial bootstrap
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 12:34:12 +02:00
Joachim Nilsson
1036c365b8
log.c: New log_exit() function, called at shutdown
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 12:31:38 +02:00
Joachim Nilsson
8ce330bcdb
log.c: Rename log_toggle_debug() --> log_debug()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 12:28:16 +02:00
Joachim Nilsson
8161e8d153
Simplify log message from kernel cmdline parser
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 01:26:36 +02:00
Joachim Nilsson
ec52a6a240
Set correct syslog() log level based on debug flag
...
Also, refactor logging to /dev/kmsg to separate function.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 22:23:53 +02:00
Joachim Nilsson
9a4f46dba4
Install log.h for external plugins
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 20:36:47 +02:00
Joachim Nilsson
5e8cb63f9a
Refactor, _d() et al to use logit() instead of err.h
...
This patch is the first in a series of changes to clean up the internal
logging APIs of Finit:
1. Convert log macros to use logit() for everything (this patch)
2. Set correct syslog() log level based on debug flag
3. Do closelog()/openlog() when toggling debug flag to control LOG_PERROR
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 20:34:37 +02:00
Joachim Nilsson
d1df837d04
Refactor, move debug toggle to log.c:log_toggle_debug()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 20:34:37 +02:00
Joachim Nilsson
670f08ce51
Refactor, move logit() and log macros to log.c + log.h
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 20:34:37 +02:00
Joachim Nilsson
82661346b7
Follow-up to 885056a, collapse and simplify code
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 20:34:26 +02:00
Joachim Nilsson
b2ac81540f
Merge branch 'enable-disable-services'
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 18:02:52 +02:00
Joachim Nilsson
fd861e1691
conf.c: Log warning for dangling .conf symlinks in /etc/finit.d/
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 17:52:15 +02:00
Joachim Nilsson
76b5bdc2c4
conf.c: Simplify .conf load/parse debug messages
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 16:06:01 +02:00
Joachim Nilsson
0ec5ad6961
TODO: Remember the idea of creating service stanzas using initctl
...
See issue #69 for a background.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 12:18:46 +02:00
Joachim Nilsson
1c2dcd9acc
doc: Add distribution recommendations and tips, issue #71
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-01 12:17:57 +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
d0a3b4b019
Note neat feature of Solaris SMF, enable service temporarily
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-30 10:41:24 +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
023a881fb9
Enable more compiler warnings by default, except unused parameters
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-29 22:23:09 +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
d4001064a0
configure: Fix hard coded FIFO path, found by previous commit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-11 22:52:09 +02:00
Joachim Nilsson
fffdad7645
configure: Add neat summary of settings, from lldpd
...
Hat tip to @vincentbernat
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-11 22:19:54 +02:00
Joachim Nilsson
32612929d9
doc/conditions.md: Attempt to clarify PID file dependency handling
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-10 19:49:36 +02:00
Joachim Nilsson
d49683cfb6
TODO: Update and clarify introduction a bit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-10 19:46:19 +02:00
Joachim Nilsson
9ca5ec16af
doc/config.md: Minor refactor to add an Introduction section
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-10 19:44:48 +02:00
Joachim Nilsson
7041813966
Update Makefile after service script move
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 01:08:46 +02:00
Joachim Nilsson
a31ecb32e1
Fix problem with building from a separate build directory
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 01:07:47 +02:00
Joachim Nilsson
b1ea279940
Move helper script 'service' to contrib/
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 01:00:40 +02:00
Joachim Nilsson
82172e65fa
Fix indentation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 00:56:24 +02:00
Joachim Nilsson
dfedb231dc
Add MIT license badge to README
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-05 00:54:45 +02:00
Joachim Nilsson
5f5be8d74e
Merge pull request #73 from westermo/wmo/inetd-remove-ntoh-on-proto
...
inetd: remove ntoh on proto
2017-04-25 13:34:19 +02:00
Petrus Hellgren
fafeaf661a
inetd: remove ntoh on proto
...
getprotobyname() returns p_proto in host endian, so it should not be
converted with ntoh. (Note: getservbyname() on the other hand does
return s_port in network endian)
Signed-off-by: Petrus Hellgren <petrus.hellgren@westermo.se >
2017-04-25 10:39:09 +02:00
Joachim Nilsson
06d3161ffe
Merge pull request #72 from abucodonosor/master
...
Some cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-28 18:43:32 +02:00
crazy
885056a6c9
networking(): check first ifup exists
...
Check first ifup exists before using it since
this is really something only exits on some
distros an in different ways. Debian/Ubunu has
an package for this while others have it in the
initscripts package(s) , meaning the file can be
around even without the prog.
Signed-off-by: crazy <crazy@frugalware.org >
2017-03-28 13:21:20 +02:00
crazy
a44daf20cb
finit.c: set _PATH_STDPATH much earlier
...
This should allow us to run 'prog' without
absolute paths. Eg:
run("/bin/foo"); -> run("foo");
However we still need absolute PATH for
checking since fexist() need full path right now.
Signed-off-by: crazy <crazy@frugalware.org >
2017-03-28 13:21:18 +02:00
crazy
67435d2034
finit.h: added fallback for _PATH_{STDPATH,VARRUN} in case is not defined
...
That should never be needed , however I saw
already systems with broken paths.h so better
have something around in case something breaks.
Signed-off-by: crazy <crazy@frugalware.org >
2017-03-28 13:21:14 +02:00
Joachim Nilsson
cd5348dffd
Add a set of contributing guidelines
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-21 07:58:57 +01:00
Joachim Nilsson
6e4b698fac
Add Code of Conduct document
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-21 07:49:19 +01:00
Joachim Nilsson
c135a83cb3
Check if /proc/bus/usb exists before trying to mount it
...
Most newer kernels have usbfs disabled by default.
See issue #69 for details.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-20 20:41:09 +01:00
Joachim Nilsson
37d391d53a
doc/build.md: Remove mention of --enable-embedded configure option
...
As suggested in GitHub issue #68 .
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-17 16:55:02 +01:00
Joachim Nilsson
d335c9833c
It is difficult to write readable technical text.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 16:25:14 +01:00
Joachim Nilsson
ab7df43ccb
Clarify link target a bit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 16:17:05 +01:00
Joachim Nilsson
ead92b3a27
Fix Markdown link
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 16:15:52 +01:00
Joachim Nilsson
647a79ffbd
README: Add explanation of service early and link to doc/config.md
...
Also, update the service help text in doc/config.md to include info on
both runlevels and explain the condition in the listed example.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 16:09:40 +01:00
Joachim Nilsson
47793dcdf2
sm.c: Add missing header
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-08 08:26:13 +01: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
5ea1ac7582
Followup to #66 : Gzip log files >= .2
...
This patch to the logrotate() function extends the log rotattion of a
file with a gzip of .2 and older log files. If gzip is not available
in $PATH then @num files are left uncompressed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 11:00:17 +01:00
Joachim Nilsson
9f7604848c
initctl: Remove no longer neede source files from build
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:21:27 +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
d56031db7d
svc.c: Replace daemon-only logging API with API from err.h
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-02-10 10:19:00 +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
9974d65756
Fix #66 : Rotate /var/log/wtmp log max:2, size:100k
...
This patch adds a simple log-rotate function to the UTMP, WTMP, BTMP,
and lastlog files. Enabled by default, disable with:
configure --disable-logrotate
Even though it can rotate /run/utmp it is unlikely this file will grow
that much during a system's uptime.
The hard-coded defaults are to keep up to two (2) previous versions
of the files and rotate on file size >= 100k.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-25 19:40:06 +01:00
Joachim Nilsson
a0e17c8f47
Relocate create() from bootmisc plugin to helpers.h
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-25 19:40:06 +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
Joachim Nilsson
8d74a12628
Fix #64 : Skip fsck of already mounted devices
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-24 08:03:53 +01:00
Joachim Nilsson
33ae64495a
finit.c: Mount /proc and /sys before fsck()
...
For issue #64 we need to have /proc/mounts, or /etc/mtab but that's
usually symlinked to /proc/mounts.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-24 07:57:19 +01:00
Joachim Nilsson
750712d28d
Merge pull request #63 from mattiaswal/add-cond-dump
...
initctl: Add 'initctl cond dump' to show all conditions in the system
2017-01-18 19:06:48 +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
205db919f5
Move service script: $PREFIX/bin --> $PREFIX/sbin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:43:24 +01:00
Joachim Nilsson
9b5d12bf22
Install service script wrapper in $PREFIX/bin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:37:55 +01:00
Joachim Nilsson
3b53dfcaed
configure: Simplify description
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:37:34 +01:00
Joachim Nilsson
1d39decaf1
Update .gitignore files
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:32:09 +01:00
Joachim Nilsson
8129ea32aa
Remnant of GIT submodule era
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:25:03 +01:00
Joachim Nilsson
2bf024d3c3
Remnant of the old build system
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 07:23:44 +01:00
Joachim Nilsson
19d89d627b
Add src/.gitignore
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:35:06 +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
Joachim Nilsson
044ded3045
Fix #61 : Reassert net/* conditions after initctl reload
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:09:06 +01:00
Joachim Nilsson
0cccc629bf
pidfile: Ensure svc is always followed by a slash
...
A service need no longer be fully qualified path.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:02:40 +01:00
Joachim Nilsson
57181264e9
pidfile: Make sure to set a default name for plugin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:02:16 +01:00
Joachim Nilsson
0b5888ed22
cond.c: Use utimensat() instead of utime() for nanosecond precision
...
We have repeatedly seen use-cases when sub-second resolution for
updatating the mtime of files have been needed. Yes, all those
cases have been Autobots.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 01:00:10 +01:00
Joachim Nilsson
4321038518
bootmisc: Minor refactor
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-16 00:59:32 +01:00
Joachim Nilsson
b84e32a6fe
Add initctl log [SVC] command
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:21:19 +01:00
Joachim Nilsson
21a293beae
Fix #60 : initctl start/stop/restart ignores non-existing services
...
This patch improves the error handling of initctl so that it returns
non-zero if a service does not exist.
$ initctl <start|stop|restart> SVC
$ echo $?
1
In verbose mode an error message is also returned:
$ initctl -v <start|stop|restart> SVC
No such service SVC
$ echo $?
1
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:15:10 +01:00
Joachim Nilsson
47b4850aa8
api.c: Factor out SVC|JOB:ID string parser
...
This patch breaks out the JOB:ID parser from api.c, placing it in a new
function called svc_parse_jobstr().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:12:53 +01:00
Joachim Nilsson
1999956d91
fixup! API: Show debug level in log after initctl debug
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:07:27 +01:00
Joachim Nilsson
698f736b65
Relocate and export sanitize() function
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:06:45 +01:00
Joachim Nilsson
618744cc52
fixup! Fix compiler warnings after do_sleep() relocation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 23:05:06 +01:00
Joachim Nilsson
67125fedab
API: Show debug level in log after initctl debug
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 21:16:31 +01:00
Joachim Nilsson
f7cd46abc9
API: Check input argument
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 21:15:58 +01:00
Joachim Nilsson
9f62153966
Whitespace: reindent and relocate function declaration(s)
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 20:53:13 +01:00
Joachim Nilsson
978771a3fb
Fix compiler warnings after do_sleep() relocation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-15 20:19:44 +01:00
Joachim Nilsson
adc340e4c3
reboot: Use do_sleep() instead of sleep() to prevent wakeups due to SIGTERM
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:56:48 +01:00
Joachim Nilsson
50668161ad
Move do_sleep() from helper.c --> util.c
...
This move makes it possible to share the code between the Finit daemon
and its client tools.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:55:44 +01:00
Joachim Nilsson
6507136bdd
reboot: Mention why CMD_SUSPEND is not managed in regular flow
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:54:48 +01:00
Joachim Nilsson
5cdbd57875
reboot: Ignore SIGTERM at halt/poweroff
...
We want to emulate the behavior of the reboot() syscall on success.
Primarily for a coherency/symmetry, but also to prevent printing
a new shell prompt in the middle of system shutdown messages.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:48:00 +01:00
Joachim Nilsson
1550c34d65
reboot: Simplify applet transformation.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-13 07:47:29 +01:00
Joachim Nilsson
ec6e3bc9e7
TODO: Minor update/clarification
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-11 17:45:13 +01:00
Joachim Nilsson
d5942f3267
Minor whitespace fixes
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-11 17:40:10 +01:00
Joachim Nilsson
e272710e36
Merge pull request #62 from mattiaswal/fix-fluxstate
...
Fix fluxstate
2017-01-11 17:21:27 +01:00
Mattias Walström
a95df9d64b
svc: The timestamp should have subsecond resolution
...
When finit completes quicker than one second it will
not find if any configurations has been changed.
Signed-off-by: Mattias Walström <mattias.walstrom@westermo.se >
2017-01-11 16:28:03 +01:00
Mattias Walström
816aa9a17c
pidfile: Run the reconf-callback again until no application are in flux
...
If a service depend on the service last in the list the application
will be kept in flux state forever.
Signed-off-by: Mattias Walström <mattias.walstrom@westermo.se >
2017-01-11 16:25:04 +01:00
Joachim Nilsson
f95cd38ddb
Refactor #ifndef INETD_DISABLED --> #ifdef INETD_ENABLED
...
This patch changes the confusing logic in all #ifndef INETD_DISABLED
statements to instead be #ifdef INETD_ENABLED, which is quite a bit
more readable.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-30 13:34:31 +01:00
Joachim Nilsson
d9de2717a2
Merge pull request #59 from reverendhomer/master
...
run: fix array overflow
2016-12-30 11:40:11 +01:00
Reverend Homer
11d5019103
run: fix array overflow
2016-12-29 14:31:28 +03:00
Joachim Nilsson
0946dbb287
Merge pull request #58 from reverendhomer/master
...
Another typo fix :)
2016-12-29 10:52:00 +01:00
Reverend Homer
cfcdedd508
doc: fix typo in signals.md
2016-12-29 12:43:01 +03:00
Joachim Nilsson
3fac6ed6af
Merge pull request #57 from reverendhomer/master
...
fix typo in config.md
2016-12-26 20:13:42 +01:00
Reverend Homer
ef7497094c
doc: fix typo
2016-12-26 20:44:08 +03:00
Joachim Nilsson
de05070ccc
tty: Debug messages when TTY is not started
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-25 10:35:51 +01:00
Joachim Nilsson
f68daf1b14
Update ChangeLog with -rc2 fixes
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-24 09:43:09 +01:00
Joachim Nilsson
88039f3d65
Fix #56 : Check TTY before trying to start getty
...
This (initial) patch for issue #56 adds a very basic validation of the
device before attempting to start a getty on it.
TODO: Verify a USB/serial device can be plugged in at any point at
runtime, either automatically start getty or by `initctl reload`
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-23 23:11:53 +01:00
Joachim Nilsson
2c0421f2e6
Fix #54 : Allow halt and poweroff despite --enable-watchdog
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-13 20:36:34 +01:00
Joachim Nilsson
a672988e35
Merge branch 'fix-mpc85xx-getty-regression'
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-12 22:30:08 +01:00
Mattias Walström
74f3a3f5c8
Actually disable modem specific flags
...
Signed-off-by: Mattias Walström <lazzer@gmail.com >
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-12 22:29:02 +01:00
Joachim Nilsson
f335e74cb8
Add missing #include <signal.h>, non GLIBC targets
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-09 07:29:45 +01:00
Joachim Nilsson
83915b42f3
Bump version for 3.0-rc2, second pre-release
...
All known major issues triaged or fixed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-09 01:03:18 +01:00
Joachim Nilsson
babcd117b1
Fix #43 : Add TODO for optimizing HTTP/HTTPS inetd redirect
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-09 00:56:39 +01:00
Joachim Nilsson
892ac2edb2
Fix #47 : Relocate sysctl.conf setup to procps plugin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-08 08:17:38 +01:00
Joachim Nilsson
5b12d17b56
Fix #52 : Add implicit "initctl reload" adter run-parts and rc.local
...
This patch (untested) patch calls `service_reload_dynamic()` after both
run-parts (if directory exists) and after `/etc/rc.local` has run. The
intention is to reload any services modified/added/removed by a user
script so the system is properly up to date.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-08 01:43:32 +01:00
Joachim Nilsson
1b6930126e
Fix #50 : Reset TTY properly in stty()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-08 01:38:05 +01:00
Joachim Nilsson
8def97a465
Add missing ctype.h header for whitespace stripper
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-08 01:37:56 +01:00
Joachim Nilsson
7bbc0847b1
Unblock udp/wait parent inetd service on child exit
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-07 23:31:54 +01:00
Joachim Nilsson
88dc3f0061
Strip leading whitespace from service -- description
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-07 22:09:51 +01:00
Joachim Nilsson
02e69932ae
Fix inetd regression introduced in 10b72f1
...
This patch allows all services to go from READY -> RUNNING, this to
prevent started inetd connections from being treated as "stubborn"
and inadvertently killing them off after a few seconds.
The same actually applies to run/task applications.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-07 21:51:54 +01:00
Joachim Nilsson
662dfbe777
Travis-CI: Update libuEv build dependency
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-05 08:43:48 +01:00
Joachim Nilsson
c249cbdbe1
Remove duplicate header
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-05 08:40:29 +01:00
Joachim Nilsson
a47171891f
fixup! Make blocked state more generic
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-05 08:40:07 +01:00
Joachim Nilsson
1dc67acd40
chargen: Make sure to check target buffer size
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-05 08:37:41 +01:00
Joachim Nilsson
146685c2c2
Fix inverted --enable-quiet option
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-12-03 06:15:46 +01:00
Joachim Nilsson
3cc2df20f9
Update minimum libuev requirement, v1.5.2
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 20:39:36 +01:00
Joachim Nilsson
4f3d246100
Make blocked state more generic
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 20:38:50 +01:00
Joachim Nilsson
11bfec1a23
Add missing header include guards
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 17:38:39 +01:00
Joachim Nilsson
f24a03a32c
Refactor little progname() for all applictions
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 17:38:01 +01:00
Joachim Nilsson
829ff0b9f7
Fix #51 : Catching SIGSEGV not needed anymore
...
This patch fixes issue #51 by reverting b4b63d3 , which is not needed
anymore since service callbacks have been removed from Finit3.
The `sig_unblock()` function, called for each forked off child, should
now be balanced with caught signals.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-27 17:28:15 +01:00
Joachim Nilsson
b9ae4d04ef
bootmisc: Replace homegrown desym() with realpath()
...
Followup to issue #49 .
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-21 15:01:59 +01:00
Joachim Nilsson
47060c9738
bootclean: Resolve any symlinks in tmpfs check
...
Followup to issue #49 .
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-21 09:41:30 +01:00
Joachim Nilsson
846692ca03
Fix #49 : Skip tmpfs directories at bootclean
...
We can safely skip tmpfs, nothing to clean from previous boot there.
In fact, if we clean it we may spoil things for udev, which saves
pre-boot files in /run/udev.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-20 19:29:42 +01:00
Joachim Nilsson
985d53bec4
Restore "udevadm settle" from 8f05b36, see #49
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-20 19:29:42 +01:00
Joachim Nilsson
8548e67dcd
Update install warning text slightly.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-20 19:29:42 +01:00
Joachim Nilsson
1c60e949e7
Fix regression from bc84d66 preventing cond_update(NULL)
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-18 13:32:55 +01:00
Wang He
86f02e8553
Fix ordering bug, progname() must be called before translate()
...
Signed-off-by: Wang He <xw897002528@gmail.com >
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-12 16:51:29 +01:00
Joachim Nilsson
2c7332583c
reboot: Fix build problem after prognm refactor.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-12 13:46:50 +01:00
Joachim Nilsson
a96b74ea5e
reboot: Replace __progname with a small function
...
This patch removes the use of non-standard __progname and replaces it
with a small function.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-11 21:28:19 +01:00
Joachim Nilsson
5a1b13ff41
Improve initctl show SVC output
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-11 21:27:08 +01:00
Joachim Nilsson
4a71f19c40
Code cleanup and improved svc abstraction
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-01 16:00:20 +01:00
Joachim Nilsson
5c672885f1
Minor cleanup of README, comments, and whitespace
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-31 19:07:43 +01:00
Joachim Nilsson
e38eb7cbd5
Minor: relocate code to get rid of #ifdefs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-24 00:25:58 +02:00
Joachim Nilsson
ba9ae0337d
TODO: Good enough watchdog implementation now in place
...
This patch removes the long standing Watchdog daemon from the TODO list.
We now have a bare-bones watchdog service built-in to Finit, with
support for handing over to an external, and possibly more advanced,
using the initctl API.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-24 00:08:58 +02:00
Joachim Nilsson
b674aad802
watchdog: Add simple built-in watchdog daemon
...
This patch adds a simple but effective watchdog daemon with support for
handover to an external daemon, should one register using the API.
Disabled by default, enable by:
configure --enable-watchdog
The watchdog forks to the background, opening /dev/watchdog setting a
three second timeout, and kicking every second. At shutdown/reboot the
daemon will receive SIGPWR from Finit to exit and cause a WDT reboot.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-24 00:06:04 +02:00
Joachim Nilsson
88f9458c6e
reboot: Wait a bit on successful signal delivery
...
To prevent returning the prompt too soon, and thereby messing up the
output from Finit, wait a bit after successful delivery of signal to
reboot/halt/poweroff.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-24 00:02:19 +02:00
Joachim Nilsson
6cb3d86cd1
Add support for registering a watchdog daemon
...
This patch adds initial support for registering a watchdog daemon with
Finit. Needed for situations when you want the system to actually be
rebooted by the watchdog timer (WDT) circuitry rather than the kernel.
The initctl API has been extended with a INIT_CMD_WDOG_HELLO command
that is used to both register and "ping" Finit periodically. As long as
Finit responds (with an ACK) the watchdog daemon knows Finit is alive.
At shutdown Finit stops all services (except kernel threads and daemons
marked with @ in the first character of their process name) and, if a
watchdog has registered, SIGPWR is sent to it when Finit has finished
unmounting etc., just prior to kernel reboot/halt/poweroff.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-24 00:02:19 +02:00
Joachim Nilsson
5cde809909
Add debug messages to signal handlers
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-24 00:02:19 +02:00
Joachim Nilsson
1b6931eaea
Protect API socket from unauthorized access
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-24 00:02:19 +02:00
Joachim Nilsson
c3b7530b98
Reenable terse mode at shutdown/reboot
...
Now that we change runlevel at shutdown/reboot, we also need to restore
terse mode before calling the shutdown hooks, like before.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-24 00:02:18 +02:00
Joachim Nilsson
0f61b0792b
Minor cleanup
...
No need to assign result = 0 since that is the default, also
no other case sets result to OK.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-23 13:10:20 +02:00
Joachim Nilsson
bab13c9cef
bootclean: Followup to a013e48, reduced verbosity
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-23 11:28:24 +02:00
Joachim Nilsson
9c9fe51eee
Fine grained signaling of processes at shutdown
...
This patch replaces kill(-1, signo) with a more fine grained
do_kill(signo) that traverses each /proc/PID, skipping kernel
threads and special [0][0] == '@' processes.
The reason for this patch is not only future compliance with
freedesktop.org standards, but also a way of not killing any
critical processes at shutdown, e.g. mdadm or watchdogd.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-23 00:28:41 +02:00
Joachim Nilsson
4f8211f6a1
Beautify 'mount -a' error message at boot
...
This patch from TroglOS makes sure to print any error message from mount
after [FAIL] is printed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-22 18:36:51 +02:00
Joachim Nilsson
5fc3a0a3b9
Move HOOK_SHUTDOWN so it runs right before runlevel change
...
The shutdown hook is supposed to run right before services start
receiving SIGTERM. Change due to previous refactor.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-16 23:06:17 +02:00
Joachim Nilsson
67c55145b9
Fix warning for comment in comment
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-10 00:03:08 +02:00
Joachim Nilsson
fc2489d9e1
Remove or mark unused variables
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-10 00:02:45 +02:00
Joachim Nilsson
a384a95529
Add missing warning flags and enable STD:GNU99
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-10 00:02:10 +02:00
Joachim Nilsson
a013e48ab5
Run bootclean() from bootmisc plugin instead
...
This patch moves both the definition and the call to bootclean() from
finit.c to the bootmisc plugin. We want to call bootclean() *after*
any /run and /var file systems have been mounted.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-09 23:15:06 +02:00
Joachim Nilsson
24a0ddfc59
Minor, remove TODO comment, fixed now.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-06 23:07:07 +02:00
Joachim Nilsson
3da4c2abe9
README: Add requirements to ToC
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-05 23:16:09 +02:00
Joachim Nilsson
2950820d34
README: Add requirements section
...
- New requirements section about what Finit expects from the system
- Remove commented out `udevadm settle` code, now in README
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-05 23:14:21 +02:00
Joachim Nilsson
75b1ac8199
Fix CID 171497, ignore return value from remove()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-04 12:37:36 +02:00
Joachim Nilsson
8f05b36551
Do not call udevadm settle, only Debian uses this
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-04 12:12:59 +02:00
Joachim Nilsson
0f840e6576
Do not force silent mode on udev systems
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-04 12:12:59 +02:00
Joachim Nilsson
451f63ebe0
Clean up unused local variables
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 23:11:49 +02:00
Joachim Nilsson
2dc9daf118
Clear screen in silent mode
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 23:10:49 +02:00
Joachim Nilsson
3c67a10347
Actually unblock signals for child processes
...
Also, make them session leader so they can manage their own offspring if
needed.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 23:08:39 +02:00
Joachim Nilsson
6885a9f868
Systems with udev/udevadm mess up /dev/console => silence console
...
On systems with systemd-udev/udevadm the trigger addition of devices at
boot wrecks havoc of /dev/console. This patch forces Finit to go silent
by default on such systems. Far from ideal, but since the actual root
cause for this messup is unknown this will have to do for now.
Also, add a settle timeout of 120 sec to the udev device tree population.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 23:08:18 +02:00
Joachim Nilsson
38142baa93
Do not fork external process, use sync(2) instead
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 14:06:06 +02:00
Joachim Nilsson
34bdbdb3b1
resolvconf: Simplify and fix buglet
...
- The /dev/shm/ directories are no longer needed
- Do not create the resolv.conf symlink
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 13:14:16 +02:00
Joachim Nilsson
83af7e8e9d
resolvconf: Initial cleanup of plugin
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 13:06:03 +02:00
Joachim Nilsson
4eb5f8a0dc
bootmisc: /var/lock/subsys created by D-Bus plugin
...
No need to create it twice.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 12:05:27 +02:00
Joachim Nilsson
e03b358ff0
Fix #46 : Set correct umask() before makedir() and chmod()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 11:42:40 +02:00
Wang He
d2846b805a
Fix issue #42 : Skip base directories in bootclean.
...
Signed-off-by: Wang He <xw897002528@gmail.com >
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 11:07:54 +02:00
Joachim Nilsson
07d767e1af
Fix issue #42 : Use ftw() to recursively clean up dirs.
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-30 23:01:26 +02:00
Joachim Nilsson
d423e6b774
doc: Reminder about conditions for run/task/service/inetd
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-26 21:43:56 +02:00
Joachim Nilsson
bb89bdd8a9
Refactor fallback handling in getent()
...
This patch factors out the fgetint() fallback code for parsing
/etc/services and /etc/protocols. Useful on systems with a
malfunctioning C library.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-26 21:42:34 +02:00
Joachim Nilsson
5cc98f6e53
inetd: List service/proto in error message
...
Improve error when failing to register an inetd service.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-26 21:41:28 +02:00
Joachim Nilsson
a6300f6ac6
Fix warning on 32-bit ARM: 2 << 31 overflows int
...
Thanks to GCC 6.1 for finding this.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-26 21:40:31 +02:00
Joachim Nilsson
aeabb4d2ea
Realign logo and mention systemd
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-21 15:40:27 +02:00
Joachim Nilsson
dcbb429863
Remove logo HTML+CSS alignment screws up rendering
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-21 15:11:14 +02:00
Joachim Nilsson
077d52d209
Attempt new right-floating logo
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-21 15:09:55 +02:00
Joachim Nilsson
44f5de188d
Update screenshot to Finit3
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 19:04:55 +02:00
Joachim Nilsson
191e5440b2
tty.c: Fix minor regression from f9732a6
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 18:52:56 +02:00
Joachim Nilsson
a2b0d00058
reboot: Add poweroff symlink, now also supported
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 18:32:53 +02:00
Joachim Nilsson
e8fa827026
README: Further cleanup and refactoring
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 18:32:38 +02:00
Joachim Nilsson
89105090ed
Massive update, cleanup of README
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 16:53:20 +02:00
Joachim Nilsson
6ce218612b
Fix build warnings if fallback shell is disabled
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 12:11:07 +02:00
Wang He
dd87c81adc
Create missing /var/lock/subsys dir in dbus plugin
...
Signed-off-by: Wang He <xw897002528@gmail.com >
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 12:09:05 +02:00
Wang He
37f3478873
Run udev triggers to add subsystems and devices
...
Without trigger, kernel modules won't be loaded automatically. Also
devices are not managed. For example, i915 was not loaded after boot
and my network card was not renamed from wlan0 to wlp3s0, which means
it was not handled properly by udev.
Signed-off-by: Wang He <xw897002528@gmail.com >
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 12:06:12 +02:00
Wang He
a64259362e
Clean up hidden dot files from /tmp
...
Signed-off-by: Wang He <xw897002528@gmail.com >
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 12:02:36 +02:00
Wang He
3554138118
Sync needed before remount R/O
...
Signed-off-by: Wang He <xw897002528@gmail.com >
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 12:00:16 +02:00
Joachim Nilsson
f7d6d269c7
Change to runlevel 0/6 on reboot/halt/poweroff
...
This patch fixes a long-standing issue with how Finit handles shutdown,
reboot and poweroff -- and even runlevel changes to runlevel 0 and 6.
Prior to this patch sig.c:do_shutdown() was called immediately on any
of the above events, disregarding any services that a user might have
wanted to run as part of the shutdown/reboot.
With this change the handling is unified in all frontends to instead
do a runlevel change followed by the do_shutdown() action.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 11:50:07 +02:00
Joachim Nilsson
2c1e9877f9
Touch /etc/nologin when runlevel change comes in
...
The /etc/nologin file must be set as soon as the runlevel change to
0/1/6 comes in, not when done with runlevel change and services have
been started, if any.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 11:24:10 +02:00
Joachim Nilsson
a94c97221e
Force all log messages to console in --debug mode
...
As a last ditch effort to understand why an embedded system doesn't
boot, the operator should be able to see as much logs as possible
when enabling --debug mode on the kernel command line.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 10:27:03 +02:00
Joachim Nilsson
f9732a6fb9
Fix warnings: type mismatch and unused parameters
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 10:27:03 +02:00
Joachim Nilsson
581fc956be
Staticify local variable
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 10:27:03 +02:00
Joachim Nilsson
ee901b018c
Finit bringup: add optional fallback shell
...
This patch adds an `--enable-fallback-shell` option to confiugre.
When enabled Finit will start `/bin/sh` on the console, but only
if there are no active TTYs running in the current runlevel.
With this it will be easier to do board bringup with Finit, but it also
enables using the fallback shell in a rescue mode (runlevel) where no
TTYs are allowed to run.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-18 10:27:03 +02:00
Joachim Nilsson
d373ebfdd7
New function tty_num_active()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-17 22:52:21 +02:00
Joachim Nilsson
698b87dd35
Clean out remnants of old (now unused) fallback shell
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-17 21:09:45 +02:00