]> git.corax.cc Git - toolbox/commit
include/inst: Add inst module for managing running instances of scripts
authorMatthias Kruk <m@m10k.eu>
Thu, 15 Apr 2021 13:37:00 +0000 (22:37 +0900)
committerMatthias Kruk <m@m10k.eu>
Thu, 15 Apr 2021 13:37:00 +0000 (22:37 +0900)
commitf0dfaf5c06d8171b7a67843aec986b0b7c14b2d0
tree2495cfb22f14f56cc633ba91e2070c2da4319938
parent31fb248fc6916f3988d99c10220ba42cf432611b
include/inst: Add inst module for managing running instances of scripts

This commit adds the inst module which provides functions for managing
instances of scripts:

 - The inst_start() function forks a function to the background
 - The inst_stop() function asks an instance to stop
 - The inst_list() function lists running instances
 - The inst_running() function tells an instance if it should stop

Internally, the module makes use of semaphores to list instances and
determine their state. Semaphores are kept in per-script directories
within $TOOLBOX_HOME/inst.
include/inst.sh [new file with mode: 0644]