|
|
# | # |
# Setup our vars based on the start-stop-daemon command | # Setup our vars based on the start-stop-daemon command |
rc_setup_daemon_vars() { | rc_setup_daemon_vars() { |
local name i |
local -a sargs=( "${args%% \'--\' *}" ) eargs=() |
local -a sargs=( "${args%% \'--\' *}" ) |
local x="${args// \'--\' /}" i= |
local -a eargs |
|
local x="${args// \'--\' /}" |
|
[[ ${x} != "${args}" ]] && eargs=( "${args##* \'--\' }" ) | [[ ${x} != "${args}" ]] && eargs=( "${args##* \'--\' }" ) |
| |
eval rc_shift_args "${sargs[@]}" | eval rc_shift_args "${sargs[@]}" |
| |
[[ -z ${cmd} ]] && cmd="${name}" |
[[ -n ${name} ]] && cmd="${name}" |
| |
# We may want to launch the daemon with a custom command | # We may want to launch the daemon with a custom command |
# This is mainly useful for debugging with apps like valgrind, strace | # This is mainly useful for debugging with apps like valgrind, strace |
|
|
# how we are called | # how we are called |
start-stop-daemon() { | start-stop-daemon() { |
local args="$( requote "$@" )" result i | local args="$( requote "$@" )" result i |
local cmd pidfile pid stopping signal nothing=false |
local cmd name pidfile pid stopping signal nothing=false |
local daemonfile= | local daemonfile= |
local -a RC_DAEMONS=() RC_PIDFILES=() | local -a RC_DAEMONS=() RC_PIDFILES=() |
| |