Commit Graph
1073 Commits
Author SHA1 Message Date
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