Lines Matching refs:state
38 FSM_VAR="$RUNDIR/streamboost_fsm.state"
122 # streamboost qdisc/flow state.
135 # try hard to get a lock for access to the state machine
143 local state=$(cat "$FSM_VAR" 2>/dev/null || echo $FSM_STATE_STOPPED)
144 [ $state -gt $FSM_STATE_MAXSTABLE -a $FSM_state_checked -eq 0 ] && {
147 $LOGGER Detected stale transitory state
174 # functions to look up the new state, based on the action and current state
177 local state=$1
185 eval echo '$'$state
188 local state=$1
196 eval echo '$'$state
199 local state=$1
207 eval echo '$'$state
210 local state=$1
218 eval echo '$'$state
221 local state=$1
229 eval echo '$'$state
261 # params: action to apply to the state machine
263 # all other actions will be approved with no effect on the state machine
281 local state=$(cat "$FSM_VAR" 2>/dev/null || echo $FSM_STATE_STOPPED)
285 new_state=$(FSM_transition_$action $state)
287 state=$FSM_STATE_RUNNING
295 [ $new_state -ne $state ] && {
302 elif [ $new_state -eq $FSM_STATE_STOPPING -a $state -ne $FSM_STATE_STOPPING_PENDING_START ]; then
304 elif [ $new_state -eq $FSM_STATE_STOPPING_PENDING_START -a $state -ne $FSM_STATE_STOPPING ]; then
426 echo "FSM state is $(FSM_state_name $FSM_state), please try again later"
521 # this will return 0 for stable state, 1 if stop needed, >=2 if (re)start needed