Commit Graph
100 Commits
Author SHA1 Message Date
Joachim Wiberg 985df20519 cgroup: don't warn on cgroup.events EINVAL for top-level groups
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-24 07:42:31 +02:00
Joachim Wiberg f6161b9be9 doc: Add blurb on bundled vs external watchdog, handover and reset
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-24 07:41:46 +02:00
Joachim Wiberg 25c5014d3c Also check env: file for changes to detect svc->args_dirty
This patch fixes an issue where services that support SIGHUP are not
properly stop/started on changes to their command line arguments.

A change to a service's env: file, e.g. /etc/default/foo for service
foo, must also be counted as a change to the foo args.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-23 17:12:59 +02:00
Joachim Wiberg b8b7b53d96 External plugins require exporting cgroup.h, svc.h needs it
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-20 01:48:03 +02:00
Joachim Wiberg 7707c4b8e6 initctl: only show key capture in debug mode
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 15:56:39 +02:00
Joachim Wiberg 437f95f00f Bump version for final (?) release candidate, v4.0-rc4
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 15:40:26 +02:00
Joachim Wiberg 099672fabb configure: change --enable-redirect -> --disable-redirect
This changes the default to redirect output from run/task/services to
/dev/null.  Use --disable-redirect to get the old pre v4.0 behavior.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 15:25:57 +02:00
Joachim Wiberg 860515a716 contrib: load softdog module on Alpine/Void Linux for finit-watchdog
We need at least the softdog watchdog driver loaded for proper watchdog
reset at reboot.  This can safely be replaced with a hardware specific
module that provides /dev/watchdog ... without one Finit will try to
restart the built-in finit-watchdog service 10 times to no avail.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 14:52:28 +02:00
Joachim Wiberg c85551a42e watchdog: wait for WDT reset only if watchdogd is running
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 14:41:48 +02:00
Joachim Wiberg 79dc6e7472 Update Travis, Alpine, and Void build options
- Fallback shell has been removed
 - Built-in watchdog has been renamed

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 13:55:24 +02:00
Joachim Wiberg 06e456384c watchdog: Enable --with-watchdog[=DEV] and improve log messages
This patch changes the configure option to enable the built-in watchdog
from --enable-watchdog to --with-watchdog[=DEV].  This is the convention
for features that take arguments.

Also, improve log messages to aid debugging when finit-watchdogd does
not start properly.  This means flushing logs to syslogd with closelog()

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 13:41:31 +02:00
Joachim Wiberg 38f7d24a80 tty: clean up developer debug messages
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 11:05:07 +02:00
Joachim Wiberg 145c78ef3e Follow-up to 7f76202: Remove fallback-shell from configure summary
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 11:05:07 +02:00
Joachim Wiberg dd437bf0a5 Follow-up to 18ab7d3: restore start of built-in watchdogd
This patch restores the start of the built-in/bundled watchdogd.  It is
tracked in the `wdog` variable and handled as an exception at shutdown.

This is also a follow-up to 7b74c99, ensuring that we only kill/stop the
built-in watchdog, not any external.  External ones can register to be
the controlling watchdogd in the system -- Finit is not the arbiter for
singletons, this is up to the system engineer.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 11:05:07 +02:00
Joachim Wiberg d82d119729 plugins: handle corner case when PID file doesn't exist
If we get a notification and the service dies immediately, and also
removes its pid file, we need to take corrective action.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-19 09:45:57 +02:00
Joachim Wiberg 7f76202865 Simplify, drop --enable-fallback-shell from configure script
Recommend using `notty` option in tty stanza instead.  See the updated
docs for details.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 23:13:19 +02:00
Joachim Wiberg aee92751ac Minor, add env: and sysv examples to first example .conf
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 16:24:19 +02:00
Joachim Wiberg 2ea7236d45 Add feature list immediately after screenshot
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 14:52:50 +02:00
Joachim Wiberg cedc04e1e3 Revert "Travis-CI: disable clang for coverity scan run"
This reverts commit 0168b765c1.
2021-04-18 12:37:21 +02:00
Joachim Wiberg edc6eb1747 initctl: fix too small destination buffer (unlikely)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 12:24:49 +02:00
Joachim Wiberg be5ec94fdf Fix GCC warnings for unhandled return value
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 12:24:32 +02:00
Joachim Wiberg 23a13fe1b6 initctl: add hidden command line option -d,--debug
For developer use only.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 12:23:58 +02:00
Joachim Wiberg 0168b765c1 Travis-CI: disable clang for coverity scan run
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 11:55:25 +02:00
Joachim Wiberg 01358a5a45 doc: update service with pre:script and post:script actions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 11:37:01 +02:00
Joachim Wiberg 106516d12d doc: update tty config, detail <COND> and @console vs console
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 11:34:57 +02:00
Joachim Wiberg ba858743e5 Fix #129: add pre:script and post:script action support
This patch updates the service state machine with two new states: SETUP
and CLEANUP.  If an executable pre:/path/to/script is defined for a
service, it is called every time the task goes to READY state.  If an
executable post:/path/to/script is defined for a service, it is called
when the task goes to HALTED state.

Each of these two scripts default to a three (3) second execution time
before they are SIGKILLed.  This can be adjusted with the `kill:SEC`
option for the service.  There are no execution guarantees, nor are
there any way of detecting if the script was killed before completion or
not -- except for running Finit in debug mode and inspecting the result
printed by system_monitor().

Note: the post:script MUST be idempotent since transitions between READY
      and HALTED can take place any number of times before a task goes
      to its RUNNING state.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 11:33:38 +02:00
Joachim Wiberg 9fd860ef3c initctl: cgroup and status commands should show mem.min numeric
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 10:37:38 +02:00
Joachim Wiberg 46ccdc3820 Fix ordering issue, pid is unset for kill(-pid, SIGKILL) op
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 09:52:48 +02:00
Joachim Wiberg 242fe54afd initctl: standardize on code=signal for signaled/killed cause
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 09:51:53 +02:00
Joachim Wiberg df5d296cd9 initctl: fix too small buffer for extended status
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 09:51:33 +02:00
Joachim Wiberg dc4630f214 contrib: consistent naming across distro examples
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 06:21:25 +02:00
Joachim Wiberg ac07d3bac7 contrib: run klogd in same cgroup as syslogd (same .conf file)
These two BusyBox daemon's run in concert so it makes sense they also
share the same cgroup.  In Finit that means sharing the same .conf file.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 06:17:40 +02:00
Joachim Wiberg f641eef8f7 Adjust command length for built-in getty
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 06:08:14 +02:00
Joachim Wiberg f17b5b3cd3 init: move bug report+homepage from -h to -v
Also, detect progname to improve usage text slightly.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 05:52:36 +02:00
Joachim Wiberg d945f4960b initctl: move bug report+homepage from help to version
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 05:51:45 +02:00
Joachim Wiberg 6a5a6ac62f Fix tty command line recomposition for initctl -v
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 05:50:49 +02:00
Joachim Wiberg a9ba4300ec contrib: add ttyS0 to list of ttys to start in Alpine Linux
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 05:03:23 +02:00
Joachim Wiberg 7bb649f11a tty: don't block SIGHUP, needed to exit getty gracefully
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 04:57:37 +02:00
Joachim Wiberg 85ada0ac99 initctl: minor, add linefeed at end of top session
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 04:47:22 +02:00
Joachim Wiberg be343a3b34 plugins: call bootmisc:bootclean() in HOOK_MOUNT_POST
Before this patch bootclean() ran first in setup() which caused to to
remove the entire /var/run/finit directory, and other files as well,
created earlier.  Only possible fix is to split clean and setup in
two and make sure to call clean as soon as we've mounted everything.

Note: this introduces a new behavior, and anyone hooking into the
      same point to do good-stuff(tm) may be affected by this.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 04:34:48 +02:00
Joachim Wiberg 0ac0e5c7d3 plugins: create /var/run/finit/cond/pid directory
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 04:34:29 +02:00
Joachim Wiberg 7f272768e4 Log error if reconf cannot be written
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-18 04:31:56 +02:00
Joachim Wiberg 36f1a39b31 Revert "Travis-CI: disable clang for coverity scan run"
This reverts commit 8d3917e9fa.
2021-04-15 10:30:05 +02:00
Joachim Wiberg 6d380082eb ttinit: check retun value from tcgetattr(), only restore if OK
Found by Coverity Scan.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-15 10:11:06 +02:00
Joachim Wiberg 8d3917e9fa Travis-CI: disable clang for coverity scan run
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-15 09:35:42 +02:00
Joachim Wiberg c3cd1a5bfa Merge pull request #166 from troglobit/tty-refactor
Tty refactor
2021-04-15 09:28:41 +02:00
Joachim Wiberg eaeddc36c2 Restore tty plugin after tty refactor
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-15 09:02:28 +02:00
Joachim Wiberg 4f40b65f0c svc_find_by_tty(): fix finder fn, check svc->dev, not name
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-15 08:46:21 +02:00
Joachim Wiberg f958aa504e cond_set_path(): minor, improve debug, 'new' -> 'next'
- Avoid using reserved C++ keyword 'new'
 - Rename new -> next
 - Rename old -> prev
 - Add debug for value being set to cond path

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-15 08:44:03 +02:00
Joachim Wiberg 3d1b95aa7a tty: export tty_exists() to rest of finit (for plugins)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-15 08:43:32 +02:00
Joachim Wiberg 4bb67bc06f Restore @console handling and support for external getty
- Drop vhangup(), how did things ever work *with* this in?!
 - setsid() + TIOCSCTTY are best buds, see notty code
 - Allow storing any non-NULL string as tty->dev, expand in service_register()
 - Reorder parse_cmdline_args(), we need to expand @console to current dev
 - Fix tty arg parser, swapparoo for external getty
 - Refactor tty_atcon(), iterated over by service_register()
 - New arg format, need to translate for old run_getty2()

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-14 23:41:22 +02:00
Joachim Wiberg 0929c93caf Misc. cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-14 23:41:02 +02:00
Joachim Wiberg c0368d2b16 Refactor fallback shell handling, run as regular service
This patch re-enables the fallback shell handling after the big TTY
refactor.  We do this by allowing the fallback shell to run as a
regular service.

Note: this also adds the "hidden" support for 'notty' option for
      tty configurations stanzas.  This is just to pick up from
      where the kernel left us, reusing stdin + stdout.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-14 16:29:19 +02:00
Joachim Wiberg 85a212ef93 service_monitor(): cancel any pending SIGKILL timers
As soon as we collect a PID we should cancel any outstanding timer
actions.   Because we may very soon svc_del() it ...

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-14 16:29:19 +02:00
Joachim Wiberg 12c3cb3dc0 service_stop(): improve debug, show rc of kill(), and it's args.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-14 16:29:19 +02:00
Joachim Wiberg 16710e7ab5 Fix possible NULL pointer deref.
Some C-lib, like GLIBC, convert NULL to <nil> when printing %p,
which we shouldn't rely on since others just bite the dust.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-14 16:29:19 +02:00
Joachim Wiberg b652aaf0cb Rename nologin shell: finit-sh -> finitsh, as fallback shell
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-14 16:29:19 +02:00
Joachim Wiberg 30020263ba Refactor tty handling to use service backend enabling conditions etc.
Initial refactor of the tty implementation to use the service/run/task
general backend.  This enables all the features of services also for
ttys, except logging because it makes no sense.

Work in progress:

 - plugins/tty.c does not work anymore, could possibly be removed in
   favor of usinga (a new) condition instead (if-tty-exists)
 - fallback tty does not work anymore, should we remove it, or can we
   handle it as an optional built-in with (a new) condition?
 - @console does not work anymore, needs to generate N cloned services

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-14 16:29:19 +02:00
Joachim Wiberg 3cf5d36972 doc: example of timed shutdown
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 16:45:33 +02:00
Joachim Wiberg c9ae96bcf7 doc: status of processes now shown in initctl status foo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 16:31:25 +02:00
Joachim Wiberg 5955110e67 Revert "Travis-CI: disable gcc for coverity scan run"
This reverts commit 4cfc8fec0e.
2021-04-10 16:26:56 +02:00
Joachim Wiberg 4191e15c77 Travis-CI: adjust install dir, plain /tmp gets crowded
Calling `tree /tmp` causes too long execution time and Travis timing out
the job.  So let's install to a sane directory.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 16:25:39 +02:00
Joachim Wiberg d60baa2b80 initctl: logically dead code, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 15:59:13 +02:00
Joachim Wiberg a50bc331db Fix possible string truncation, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 15:56:44 +02:00
Joachim Wiberg eff4453de9 initctl: add missing comma in signames[], found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 15:54:11 +02:00
Joachim Wiberg 4cfc8fec0e Travis-CI: disable gcc for coverity scan run
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 12:06:46 +02:00
Joachim Wiberg c9e1c2f80f initctl: show exit status/signaled like systemctl
- Show if exited/signaled
 - Show status code and the std /NAME
 - Show signal value and the std /NAME

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 11:51:29 +02:00
Joachim Wiberg 93039e40cc initctl: usability improvements to ls/edit family of commands
- List /etc/finit.conf
 - Allow edit of /etc/finit.conf, using finit/finit.conf or NULL
 - Add helpful question to edit /etc/finit.conf if no edit arg.
 - Show available files if delete has no arg, like disable

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-10 08:56:26 +02:00
Joachim Wiberg 015a52a20d sample.conf: update with cgroup help and examples
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 19:52:12 +02:00
Joachim Wiberg d53cc8bfe7 doc: Fix run/task/service cgroup config syntax
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 19:51:47 +02:00
Joachim Wiberg 3c4eca60b7 initctl: fix restart of run/tasks, stuck in DONE state
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 19:51:03 +02:00
Joachim Wiberg c85e28b971 Yield execution in forked children back to PID 1
- Speeds up start-up a bit
 - Ensures the child is moved to its cgroup as soon as possible

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:59:33 +02:00
Joachim Wiberg d373068619 exec: only log when starting getty, not before
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:58:53 +02:00
Joachim Wiberg 997f3d7862 cgroup: fix possible NULL pointer deref.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:58:32 +02:00
Joachim Wiberg f12f53692e cgroup: allow adding self (PID 0) to a leaf group
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:58:11 +02:00
Joachim Wiberg b921b8cf0f cgroup: run all ttys, except rescue sh, in getty cgroup until login
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:32:31 +02:00
Joachim Wiberg 61781c72fe cgroup: Call ifupdown in system cgroup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:21:04 +02:00
Joachim Wiberg 3b5cfc5ecf test: drop checksef.sh from EXTRA_DIST, generated now
Also, silence generation of checkself.sh

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 18:05:02 +02:00
Joachim Wiberg a42a789d29 Refactor, clean up removed top-level cgroups
The main purpose of this patch is to remove top-level cgroups when they
are remvoed from finit.conf.  However, this is tricky, becasue there may
still be supervised services (and children of them) running.  We must
postpone removal until a cgroup.events change.  To make matters worse,
events may arrive out-of-order, i.e. the last-child event for the parent
cgroup before the sub-group.

A spin-off from this patch is that we can now support arbitrarily long
group names and group config.  (Only applies to top-level cgroups, not
run/task/services.)

Limitations:
 - Processes in "removed" cgroups are not migrated/orphaned, the reasons
   are several: overhead and complexity and the fact that memory cannot
   be migrated
 - A lingering child of a moved service may prevent an old top-level
   cgroup from being removed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-09 17:49:55 +02:00
Joachim Wiberg d77c014723 Add example of initctl status foo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 17:11:35 +02:00
Joachim Wiberg 23fca9c067 Update initctl usage text, three new commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 17:04:13 +02:00
Joachim Wiberg 37eb1901f9 initctl: handle ~ECHONL properly in top command
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 14:36:15 +02:00
Joachim Wiberg 98c4e7764f initctl: fix boolean logic bug in -p top command option
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 14:27:36 +02:00
Joachim Wiberg d3e4463612 initctl: add missing signal.h include, required for musl libc
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 14:20:48 +02:00
Joachim Wiberg b812045d82 doc: add cgroup documentation
First draft of the new cgroup documentation.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 14:16:25 +02:00
Joachim Wiberg b1bcdc88e0 initctl: fix ordering issue for root task in ps/top/cgroup commands
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 13:17:40 +02:00
Joachim Wiberg 62c5a9d06d cgroup: add support for reserved cgroup 'root', for RT tasks
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-08 13:17:10 +02:00
Joachim Wiberg dcdc842336 Revert "Travis-CI: disable gcc for coverity scan run"
This reverts commit 73629944c0.
2021-04-08 12:15:08 +02:00
Joachim Wiberg 12eaa3073a fnwrite(): call fclose() separately, found by Coverity Scan
If any of the fputs() calls fails we will not call fclose() and thus
cause resource loss.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 14:32:12 +02:00
Joachim Wiberg 34875f57a5 Fix uninitialized stack variable, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 14:00:08 +02:00
Joachim Wiberg f0bf1343b0 initctl: skip return value for uev_*_init(), optional
We have these neat extras for added value, if they should fail, for
whatever reason, we still want to present 'top' to the user, which may
have to use 'reset' if exited improperly and lost cooked/cursor.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 13:57:43 +02:00
Joachim Wiberg 4e6b9514d5 cgroup: check return value from fnwrite(), found by Coverity Scan
We check it everywhere else, and a log message for failing to move PID 1
to the init cgroup is useful as well.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 13:55:07 +02:00
Joachim Wiberg 3b495d7518 cgroup: fix too small buffer for strlcpy(), found by Coverity Scan
Off by one, of course.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 13:54:34 +02:00
Joachim Wiberg badf8701bf cgroup: fix use before NULL check, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 13:53:56 +02:00
Joachim Wiberg 85fa0d4926 cgroup: fix resource leak, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 13:53:25 +02:00
Joachim Wiberg 3de9643893 fnwrite(): fix resource leak, found by Coverity Scan
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 13:26:56 +02:00
Joachim Wiberg 73629944c0 Travis-CI: disable gcc for coverity scan run
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 12:06:07 +02:00
Joachim Wiberg c97c83bfb6 cgroup: basic instrumentation of critical functions
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 11:58:48 +02:00
Joachim Wiberg 19b18afac9 cgroup: Skip mkdir() and subtree control if group already exists
- No point in doing it twice
 - Don't anger the gods (possible kernel bugs)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 11:58:48 +02:00
Joachim Wiberg e3c424e129 Minor, rename internal variable
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-04-07 11:58:48 +02:00