Lines Matching refs:state
38 FSM_VAR="$RUNDIR/streamboost_fsm.state"
121 # streamboost qdisc/flow state.
134 # try hard to get a lock for access to the state machine
142 local state=$(cat "$FSM_VAR" 2>/dev/null || echo $FSM_STATE_STOPPED)
143 [ $state -gt $FSM_STATE_MAXSTABLE -a $FSM_state_checked -eq 0 ] && {
146 $LOGGER Detected stale transitory state
173 # functions to look up the new state, based on the action and current state
176 local state=$1
184 eval echo '$'$state
187 local state=$1
195 eval echo '$'$state
198 local state=$1
206 eval echo '$'$state
209 local state=$1
217 eval echo '$'$state
220 local state=$1
228 eval echo '$'$state
260 # params: action to apply to the state machine
262 # all other actions will be approved with no effect on the state machine
280 local state=$(cat "$FSM_VAR" 2>/dev/null || echo $FSM_STATE_STOPPED)
284 new_state=$(FSM_transition_$action $state)
286 state=$FSM_STATE_RUNNING
294 [ $new_state -ne $state ] && {
301 elif [ $new_state -eq $FSM_STATE_STOPPING -a $state -ne $FSM_STATE_STOPPING_PENDING_START ]; then
303 elif [ $new_state -eq $FSM_STATE_STOPPING_PENDING_START -a $state -ne $FSM_STATE_STOPPING ]; then
425 echo "FSM state is $(FSM_state_name $FSM_state), please try again later"
506 # this will return 0 for stable state, 1 if stop needed, >=2 if (re)start needed