Commit 4084d18f authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

KVM daemon datatype, user and group



* add user and group to 'configure.ac', 'Makefile.am' and
  'AutoConf.hs.in'
* extend 'Daemon' datatype with 'GanetiKvmd' and implement all related
  functions, such as, 'daemonName', etc.
* export KVM daemon name as constant
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 9131274c
......@@ -1842,6 +1842,8 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
-DRAPI_GROUP="$(RAPI_GROUP)" \
-DCONFD_USER="$(CONFD_USER)" \
-DCONFD_GROUP="$(CONFD_GROUP)" \
-DKVMD_USER="$(KVMD_USER)" \
-DKVMD_GROUP="$(KVMD_GROUP)" \
-DLUXID_USER="$(LUXID_USER)" \
-DLUXID_GROUP="$(LUXID_GROUP)" \
-DNODED_USER="$(NODED_USER)" \
......
......@@ -223,18 +223,21 @@ AC_ARG_WITH([user-prefix],
[user_masterd="${withval}masterd";
user_rapi="${withval}rapi";
user_confd="${withval}confd";
user_kvmd="$user_default";
user_luxid="${withval}luxid";
user_noded="$user_default";
user_mond="$user_default"],
[user_masterd="$user_default";
user_rapi="$user_default";
user_confd="$user_default";
user_kvmd="$user_default";
user_luxid="$user_default";
user_noded="$user_default";
user_mond="$user_default"])
AC_SUBST(MASTERD_USER, $user_masterd)
AC_SUBST(RAPI_USER, $user_rapi)
AC_SUBST(CONFD_USER, $user_confd)
AC_SUBST(KVMD_USER, $user_kvmd)
AC_SUBST(LUXID_USER, $user_luxid)
AC_SUBST(NODED_USER, $user_noded)
AC_SUBST(MOND_USER, $user_mond)
......@@ -249,6 +252,7 @@ AC_ARG_WITH([group-prefix],
[group_rapi="${withval}rapi";
group_admin="${withval}admin";
group_confd="${withval}confd";
group_kvmd="$group_default";
group_luxid="${withval}luxid";
group_masterd="${withval}masterd";
group_noded="$group_default";
......@@ -257,6 +261,7 @@ AC_ARG_WITH([group-prefix],
[group_rapi="$group_default";
group_admin="$group_default";
group_confd="$group_default";
group_kvmd="$group_default";
group_luxid="$group_default";
group_masterd="$group_default";
group_noded="$group_default";
......@@ -265,6 +270,7 @@ AC_ARG_WITH([group-prefix],
AC_SUBST(RAPI_GROUP, $group_rapi)
AC_SUBST(ADMIN_GROUP, $group_admin)
AC_SUBST(CONFD_GROUP, $group_confd)
AC_SUBST(KVMD_GROUP, $group_kvmd)
AC_SUBST(LUXID_GROUP, $group_luxid)
AC_SUBST(MASTERD_GROUP, $group_masterd)
AC_SUBST(NODED_GROUP, $group_noded)
......
......@@ -169,6 +169,12 @@ confdUser = "CONFD_USER"
confdGroup :: String
confdGroup = "CONFD_GROUP"
kvmdUser :: String
kvmdUser = "KVMD_USER"
kvmdGroup :: String
kvmdGroup = "KVMD_GROUP"
luxidUser :: String
luxidUser = "LUXID_USER"
......
......@@ -212,6 +212,12 @@ confdUser = Runtime.daemonUser GanetiConfd
confdGroup :: String
confdGroup = Runtime.daemonGroup (DaemonGroup GanetiConfd)
kvmdUser :: String
kvmdUser = Runtime.daemonUser GanetiKvmd
kvmdGroup :: String
kvmdGroup = Runtime.daemonGroup (DaemonGroup GanetiKvmd)
luxidUser :: String
luxidUser = Runtime.daemonUser GanetiLuxid
......@@ -341,6 +347,9 @@ luxid = Runtime.daemonName GanetiLuxid
rapi :: String
rapi = Runtime.daemonName GanetiRapi
kvmd :: String
kvmd = Runtime.daemonName GanetiKvmd
daemons :: FrozenSet String
daemons =
ConstantUtils.mkSet [confd,
......
......@@ -63,6 +63,7 @@ data GanetiDaemon = GanetiMasterd
| GanetiNoded
| GanetiRapi
| GanetiConfd
| GanetiKvmd
| GanetiLuxid
| GanetiMond
deriving (Show, Enum, Bounded, Eq, Ord)
......@@ -83,6 +84,7 @@ daemonName GanetiMasterd = "ganeti-masterd"
daemonName GanetiNoded = "ganeti-noded"
daemonName GanetiRapi = "ganeti-rapi"
daemonName GanetiConfd = "ganeti-confd"
daemonName GanetiKvmd = "ganeti-kvmd"
daemonName GanetiLuxid = "ganeti-luxid"
daemonName GanetiMond = "ganeti-mond"
......@@ -92,6 +94,7 @@ daemonOnlyOnMaster GanetiMasterd = True
daemonOnlyOnMaster GanetiNoded = False
daemonOnlyOnMaster GanetiRapi = False
daemonOnlyOnMaster GanetiConfd = False
daemonOnlyOnMaster GanetiKvmd = False
daemonOnlyOnMaster GanetiLuxid = True
daemonOnlyOnMaster GanetiMond = False
......@@ -101,6 +104,7 @@ daemonLogBase GanetiMasterd = "master-daemon"
daemonLogBase GanetiNoded = "node-daemon"
daemonLogBase GanetiRapi = "rapi-daemon"
daemonLogBase GanetiConfd = "conf-daemon"
daemonLogBase GanetiKvmd = "kvm-daemon"
daemonLogBase GanetiLuxid = "luxi-daemon"
daemonLogBase GanetiMond = "monitoring-daemon"
......@@ -110,6 +114,7 @@ daemonUser GanetiMasterd = AutoConf.masterdUser
daemonUser GanetiNoded = AutoConf.nodedUser
daemonUser GanetiRapi = AutoConf.rapiUser
daemonUser GanetiConfd = AutoConf.confdUser
daemonUser GanetiKvmd = AutoConf.kvmdUser
daemonUser GanetiLuxid = AutoConf.luxidUser
daemonUser GanetiMond = AutoConf.mondUser
......@@ -120,6 +125,7 @@ daemonGroup (DaemonGroup GanetiNoded) = AutoConf.nodedGroup
daemonGroup (DaemonGroup GanetiRapi) = AutoConf.rapiGroup
daemonGroup (DaemonGroup GanetiConfd) = AutoConf.confdGroup
daemonGroup (DaemonGroup GanetiLuxid) = AutoConf.luxidGroup
daemonGroup (DaemonGroup GanetiKvmd) = AutoConf.kvmdGroup
daemonGroup (DaemonGroup GanetiMond) = AutoConf.mondGroup
daemonGroup (ExtraGroup DaemonsGroup) = AutoConf.daemonsGroup
daemonGroup (ExtraGroup AdminGroup) = AutoConf.adminGroup
......
......@@ -83,6 +83,7 @@ case_UsersGroups = do
\ constants.NODED_USER,\n\
\ constants.RAPI_USER,\n\
\ constants.CONFD_USER,\n\
\ constants.KVMD_USER,\n\
\ constants.LUXID_USER,\n\
\ constants.MOND_USER,\n\
\ ]\n\
......@@ -90,6 +91,7 @@ case_UsersGroups = do
\ constants.NODED_GROUP,\n\
\ constants.RAPI_GROUP,\n\
\ constants.CONFD_GROUP,\n\
\ constants.KVMD_GROUP,\n\
\ constants.LUXID_GROUP,\n\
\ constants.MOND_GROUP,\n\
\ constants.DAEMONS_GROUP,\n\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment