Skip to content

Commit

Permalink
object/ceph: set default path for admin socket and log file (juicedat…
Browse files Browse the repository at this point in the history
  • Loading branch information
SandyXSD authored Mar 29, 2024
1 parent bcab121 commit 307870c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/object/ceph.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,22 @@ func newCeph(endpoint, cluster, user, token string) (ObjectStorage, error) {
if err != nil {
return nil, fmt.Errorf("Can't create connection to cluster %s for user %s: %s", cluster, user, err)
}
if opt := os.Getenv("CEPH_ADMIN_SOCKET"); opt != "none" {
if opt == "" {
opt = "$run_dir/jfs-$cluster-$name.asok"
}
if err = conn.SetConfigOption("admin_socket", opt); err != nil {
logger.Warnf("Failed to set admin_socket to %s: %s", opt, err)
}
}
if opt := os.Getenv("CEPH_LOG_FILE"); opt != "none" {
if opt == "" {
opt = "/var/log/ceph/jfs-$cluster-$name.log"
}
if err = conn.SetConfigOption("log_file", opt); err != nil {
logger.Warnf("Failed to set log_file to %s: %s", opt, err)
}
}
if os.Getenv("JFS_NO_CHECK_OBJECT_STORAGE") == "" {
if err := conn.ReadDefaultConfigFile(); err != nil {
return nil, fmt.Errorf("Can't read default config file: %s", err)
Expand Down

0 comments on commit 307870c

Please sign in to comment.