Commit Graph
922 Commits
Author SHA1 Message Date
Joachim Nilsson e1c0e7fe58 Add install/uninstall for reboot symlinks
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-14 13:20:48 +02:00
Joachim Nilsson 9783e120af Fix install/uninstall of Finit symlinks
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-14 13:20:27 +02:00
Joachim Nilsson 3ad149fb28 Workaround for uninstalling .so plugins
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-14 13:19:35 +02:00
Joachim Nilsson e6430aabc2 Update and remove services script from distribution
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-14 13:19:20 +02:00
Joachim Nilsson 2743a49d91 reboot: Add halt/poweroff/suspend and force cmd
This patch is a complete rewrite of the Finit reboot command.  Not only
does it bring it up to speed with the new signal model, but it also adds
new features like poweroff, halt, and suspend -- including a forced mode
that goes for reboot(2) immediately.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-14 12:27:52 +02:00
Joachim Nilsson 6f99c1db05 initctl: Add missing signal.h include for older systems, e.g. Travis CI
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-11 00:03:20 +02:00
Joachim Nilsson 0eafe8bcd9 initctl: Show error message when trying to signal PID 1 as non-root
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-10 21:39:09 +02:00
Joachim Nilsson b01fae03ec Copy all chars of UTMP fields: id, line, and user
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-09 20:35:44 +02:00
Joachim Nilsson dbbe6b31b8 UTMP: Fix runlevel regression after refactoring
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-09 20:35:03 +02:00
Joachim Nilsson 2718c709aa UTMP: Add support for INIT_PROCESS & DEAD_PROCESS
Services started by Finit are now properly accounted for in UTMP.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-09 00:58:00 +02:00
Joachim Nilsson 8c54fde36c Fix D-Bus plugin, remove old #ifdefs
Still TODO, replace `run_interactive()` start of dbus-daemon with a
proper service.  Possibly only service_register() is needed.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-09 00:12:47 +02:00
Joachim Nilsson 0d1bc167ff initctl: Fix display of UTMP records, add IP addr
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-09 00:12:47 +02:00
Joachim Nilsson f8def336d4 Fix ordering of UTMP events: reboot, then runlevel
This patch fixes the ordering of UTMP events. The first event that is
expected in /var/run/utmp is reboot, next is the runlevel change to
the configured runlevel, e.g. from S --> 2.

Let the bootmisc plugin handle this, it knows when /var/run/utmp has
been created and is writable.  It is not the eact boot time, but close
enough for most usees.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-09 00:12:47 +02:00
Joachim Nilsson addc21bdf6 UTMP: Set BOOT_TIME record and add shutdown
This patch adds support for initializing /var/run/utmp with the initial
reboot as well as a shutdown record in the UTMP db.

Also, the run level change now properly records ~ and ~~ as line and id,
respectively, and the kernel release and time of each UTMP record is now
set properly.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-08 19:06:35 +02:00
Joachim Nilsson 27899feea0 bootmisc: Add /var/log/btmp 0600 support
The file /var/log/btmp holds bad login attempts and must be created with
0600 perms.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-08 00:05:34 +02:00
Joachim Nilsson a016359891 Factor out runlevel handling to new UTMP API
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-07 22:36:31 +02:00
Joachim Nilsson 7cdd42195b initctl: Break out UTMP logic to separate file
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-07 22:22:42 +02:00
Joachim Nilsson 07f06c8b95 inictl: Enable UTMP dump command
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-06 18:51:25 +02:00
Joachim Nilsson 2067fd597f initctl: Raw UTMP dump tool
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-06 18:49:22 +02:00
Joachim Nilsson f0318b0df0 Rephrase
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-05 17:46:44 +02:00
Joachim Nilsson 508c7b225a Prune completed TODO items
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-05 17:45:58 +02:00
Joachim Nilsson 8a79b05a97 Add missing bracket
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-05 17:45:25 +02:00
Joachim Nilsson 7b07d5559c Service status 'crashing' --> 'crashed'
Minor coding style cleanup, code simplification, and change service
'crashing' status text to 'crashed' to fit column width.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-05 17:43:45 +02:00
Joachim Nilsson 23cdd6e438 Update Debian HowTo with new build.sh script
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-05 01:16:35 +02:00
Joachim Nilsson 576cb1075c Boiler plate README for contrib/ section
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-05 01:06:23 +02:00
Joachim Nilsson fc74fb110d README: Further simplication of example in ingress
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-05 01:06:20 +02:00
Joachim Nilsson baa914e995 initctl: add reboot, halt, and poweroff commands
Simple wrappers for the signals Finit responds to.  Will need complete
rewrite when support for delayed reboot/halt is added.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-04 22:45:05 +02:00
Joachim Nilsson 6490735ee9 Remove flux condition emulation, confusing to user
The condition flux state does not work like that, so keeping
this sub-command is only confusing to the user.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-04 22:40:20 +02:00
Joachim Nilsson 13159ea99a Mention support for Debian and Alpine early!
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-04 00:38:45 +02:00
Joachim Nilsson b9fa0f85a2 Update inline documentation for Debian finit.conf
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-03 11:12:56 +02:00
Joachim Nilsson dbbe3cecb3 Debian helper build & install scripts
These scripts help a user to configure, build, and install Finit
correctly on a Debian 8 (Jessie) server install.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-03 10:58:45 +02:00
Joachim Nilsson 1a8f1d9604 getfsent(): Read only six fields per line
The fs.fs_type is only for *BSD, we hard-code it to "rw"
in the meantime.  Should be safe in most cases.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-02 02:01:51 +02:00
Joachim Nilsson d76ecad517 fsck: Prevent debug during interactive fsck
The debug mode cannot be used in run_interactive() that early, so we
must disable it during the complete fsck run.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-02 02:00:01 +02:00
Joachim Nilsson f81750e0b1 fsck: Skip progress, does not work the same with BusyBox fsck
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-02 01:59:14 +02:00
Joachim Nilsson 7fc7faf59a fsck: Prevent double-checking filesystems
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-02 01:58:41 +02:00
Joachim Nilsson c38b452ac4 Add set/get/endfsent() support for musl libc
This patch adds support for the following /etc/fstab API's on systems
that do not have them, e.g. musl libc on Alpine Linux.

- setfsent()
- getfsent(), and
- endfsent()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-02 00:50:23 +02:00
Joachim Nilsson 7eac88b639 Run fsck earlier and print only first 13 chars
Run fsck much earlier, as soon as we can in fact.

The first 13 characters of the UUID, label or device name should
be sufficient to identify the device, without violating max width
of 78 chars.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-01 23:51:11 +02:00
Joachim Nilsson f374f443f4 Allow fsck on UUID= and LABEL= devices
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-01 23:38:55 +02:00
Joachim Nilsson d2a5e65862 Support for checking file systems from /etc/fstab
This patch adds support for running fsck on all file systems listed in
/etc/fstab with a passno > 0.  The fsck runs sequentially, starting with
the root fs (passno 1).

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-08-01 18:08:54 +02:00
Joachim Nilsson 501deae4ed Update doc, support sysctl from all the locations!
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-31 10:21:15 +02:00
Joachim Nilsson 2c29893558 Prune old (and now irrelevant) TODO items
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-31 10:16:52 +02:00
Joachim Nilsson a1a7f69349 Update info on getty, no /bin/login included
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 16:06:35 +02:00
Joachim Nilsson 8d9fbea551 Micro adjustment
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 16:03:32 +02:00
Joachim Nilsson 1d89e1a706 Advertise for new logo ...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 16:02:51 +02:00
Joachim Nilsson 596b7cc413 README: Mention built-in getty
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 16:00:31 +02:00
Joachim Nilsson fbed5cd8cb TODO: Timed shutdown/reboot incl. cancellation
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:55:59 +02:00
Joachim Nilsson 0cb1ce2483 Disable clear screen in getty
Disabled until we decide on config to disable/enable.  It is quite
annoying to not be able to see the boot messages with it on ...

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson e23b62ffb7 Plugin loader fixes for dep handling and unload
- Plugins without declared name registered with full path + ext
  => Strip path and extension
- Plugins registered with __NAME__ => strip extension
- Do *not* call dlclose() from destructor, must be called by Finit

Also, some minor cleanup and code simplifcation.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson 94d41e38f8 Close inotify watcher when TTY plugin is unloaded
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00
Joachim Nilsson 42800a1cc8 ALSA plugin: only run if /usr/sbin/alsactl exists
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-07-30 15:54:37 +02:00