Revision 8e2ed2e8 doc/examples/ganeti.initd.in

b/doc/examples/ganeti.initd.in
75 75
    done
76 76
}
77 77

  
78
status_all() {
79
    local daemons="$1" status ret
80

  
81
    if [ -z "$daemons" ]; then
82
      daemons=$($DAEMON_UTIL list-start-daemons)
83
    fi
84

  
85
    status=0
86

  
87
    for i in $daemons; do
88
      if status_of_proc $($DAEMON_UTIL daemon-executable $i) $i; then
89
          ret=0
90
      else
91
          ret=$?
92
          # Use exit code from first failed call
93
          if [ "$status" -eq 0 ]; then
94
              status=$ret
95
          fi
96
      fi
97
    done
98

  
99
    exit $status
100
}
101

  
78 102
if [ -n "$2" ] && ! errmsg=$($DAEMON_UTIL is-daemon-name "$2" 2>&1); then
79 103
    log_failure_msg "$errmsg"
80 104
    exit 1
......
94 118
        stop_all "$2"
95 119
        start_all "$2"
96 120
        ;;
121
    status)
122
        status_all "$2"
123
        ;;
97 124
    *)
98 125
        log_success_msg "Usage: $SCRIPTNAME {start|stop|force-reload|restart}"
99 126
        exit 1

Also available in: Unified diff