#!/bin/bash
# pid - process ID file support
set -e
sys_pid_config_init() {
lib_setting_vars -ro rundir
rundir="/home/zwelch/src/mcf/mcsh/install/run/mcsh"
}
######
# Process ID file support
pid_exists() { has_args 1 "$@"; [ -f "$rundir/$1" ]; }
pid_read() { has_args 2 "$@"; $pretend || read $1 <"$rundir/$2"; }
pid_save() { has_args 2 "$@"; $pretend || echo "$1" >"$rundir/$2"; }
pid_remove() { has_args 1 "$@"; run rm -f "$rundir/$1"; }
pid_kill() {
min_args 2 "$@"
local sig=$1
local file=$2
local hold=${3:-false}
local pid
pid_read pid "$file"
run kill -$sig $pid
! $hold || wait $pid
pid_remove "$file"
}
Generated on Tue Apr 25 21:21:18 PDT 2017 by mcsh i7 v0.18.0.