Skip to content

Commit 61141f5

Browse files
tcm: add tt tcm stop command
@TarantoolBot document Title: add the tt tcm stop command. Add command tt tcm stop to gracefully terminate TCM: - Works in both modes(watchdog and interactive) - Stops all subprocesses Closes #TNTP-1993
1 parent 7143587 commit 61141f5

File tree

7 files changed

+113
-294
lines changed

7 files changed

+113
-294
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1616
- `tt tcm start` OR `tt tcm start --path /path/to/tcm`: added the capability to run TCM in interactive mode.
1717
- `tt tcm start --watchdog`: implemented Watchdog mode for automatic restarting of TCM upon unexpected termination.
1818
- `tt tcm status`: added command to check TCM runtime status (modes: `watchdog` or `interactive`).
19+
- `tt tcm stop`: add command for graceful termination of TCM processes (modes: `watchdog` or `interactive`).
1920

2021
### Changed
2122

cli/cmd/tcm.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ func internalTcmStop(cmdCtx *cmdcontext.CmdCtx, args []string) error {
178178
if err != nil {
179179
return err
180180
}
181-
log.Println("Watchdog and TCM stoped")
181+
log.Println("Watchdog and TCM stopped")
182182
} else {
183183
_, err := process_utils.StopProcess(tcmPidFile)
184184
if err != nil {
185185
return err
186186
}
187-
log.Println("TCM stoped")
187+
log.Println("TCM stopped")
188188
}
189189

190190
return nil

cli/process_utils/process_utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ func ExistsAndRecord(pidFileName string) (bool, error) {
118118
return true, nil
119119
}
120120
} else if !os.IsNotExist(err) {
121-
return false, fmt.Errorf(`something went wrong while trying to read the PID file. Error: "%v"`,
122-
err)
121+
return false, fmt.Errorf(`something went wrong while trying to read the`+
122+
`PID file. Error: "%v"`, err)
123123
}
124124

125125
return false, nil

cli/tcm/watchdog.go

-158
This file was deleted.

cli/tcm/watchdog_test.go

-69
This file was deleted.

0 commit comments

Comments
 (0)