1 {-| Path-related helper functions.
7 Copyright (C) 2012 Google Inc.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
37 import qualified Ganeti.Constants as C
38 import System.FilePath
41 -- | Directory for data
43 dataDir = C.autoconfLocalstatedir </> "lib" </> "ganeti"
45 -- | Directory for runtime files
47 runDir = C.autoconfLocalstatedir </> "run" </> "ganeti"
49 -- | Directory for log files
51 logDir = C.autoconfLocalstatedir </> "log" </> "ganeti"
53 -- | Directory for Unix sockets
55 socketDir = runDir </> "socket"
57 -- | The default LUXI socket path.
58 defaultLuxiSocket :: FilePath
59 defaultLuxiSocket = socketDir </> "ganeti-master"
61 -- | The default LUXI socket for queries.
62 defaultQuerySocket :: FilePath
63 defaultQuerySocket = socketDir </> "ganeti-query"
65 -- | Path to file containing confd's HMAC key
66 confdHmacKey :: FilePath
67 confdHmacKey = dataDir </> "hmac.key"
69 -- | Path to cluster configuration file
70 clusterConfFile :: FilePath
71 clusterConfFile = dataDir </> "config.data"
74 nodedCertFile :: FilePath
75 nodedCertFile = dataDir </> "server.pem"