Revision cbccd9ca

b/daemons/daemon-util.in
50 50
  echo "@PREFIX@/sbin/$1"
51 51
}
52 52

  
53
_daemon_usergroup() {
54
  case "$1" in
55
    masterd)
56
      echo "@GNTMASTERUSER@:@GNTMASTERDGROUP@"
57
      ;;
58
    confd)
59
      echo "@GNTCONFDUSER@:@GNTCONFDGROUP@"
60
      ;;
61
    rapi)
62
      echo "@GNTRAPIUSER@:@GNTRAPIGROUP@"
63
      ;;
64
    noded)
65
      echo "@GNTNODEDUSER@:@GNTDAEMONSGROUP@"
66
      ;;
67
    *)
68
      echo "root:@GNTDAEMONSGROUP@"
69
      ;;
70
  esac
71
}
72

  
53 73
# Checks whether the local machine is part of a cluster
54 74
check_config() {
55 75
  local server_pem=@LOCALSTATEDIR@/lib/ganeti/server.pem
......
144 164
  local name="$1"; shift
145 165

  
146 166
  # Convert daemon name to uppercase after removing "ganeti-" prefix
147
  local ucname=$(echo ${name#ganeti-} | tr a-z A-Z)
167
  local plain_name=${name#ganeti-}
168
  local ucname=$(tr a-z A-Z <<<$plain_name)
148 169

  
149 170
  # Read $<daemon>_ARGS and $EXTRA_<daemon>_ARGS
150 171
  eval local args="\"\$${ucname}_ARGS \$EXTRA_${ucname}_ARGS\""
......
154 175
  start-stop-daemon --start --quiet --oknodo \
155 176
    --pidfile $(_daemon_pidfile $name) \
156 177
    --startas $(_daemon_executable $name) \
178
    --chuid $(_daemon_usergroup $plain_name) \
157 179
    -- $args "$@"
158 180
}
159 181

  

Also available in: Unified diff