Skip to content

Commit

Permalink
fix: path checkaccess failed when clickhouse user not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
YenchangChan committed Sep 29, 2022
1 parent da36826 commit 3e4d1cf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions controller/deploy.go
Expand Up @@ -298,10 +298,8 @@ func checkAccess(localPath string, conf *model.CKManClickHouseConfig) error {
}
if conf.NeedSudo {
// create clickhouse group and user
var cmds []string
cmds = append(cmds, "groupadd -r clickhouse")
cmds = append(cmds, "useradd -r --shell /bin/false --home-dir /nonexistent --user-group clickhouse")
_, _ = common.RemoteExecute(sshOpts, strings.Join(cmds, ";"))
cmd := "useradd -r --shell /bin/false --home-dir /nonexistent --user-group clickhouse"
_, _ = common.RemoteExecute(sshOpts, cmd)
}
output, err := common.RemoteExecute(sshOpts, cmd)
if err != nil {
Expand Down

0 comments on commit 3e4d1cf

Please sign in to comment.