Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support Boost V2 #235

Merged
merged 13 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add stop boostd-data process
  • Loading branch information
sonic committed Nov 10, 2023
commit cd7dfbfe0bc7e20a828cc9c3897b304113ecf507
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func main() {
case sig := <-sigCh:
logs.GetLogger().Warn("received shutdown signal: ", sig)
service.StopProcessById("boostd", service.BoostPid)
service.StopProcessById("boostd-data", service.BoostDataPid)

}
default:
printUsage()
Expand Down
7 changes: 5 additions & 2 deletions service/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var aria2Service *Aria2Service
var lotusService *LotusService

var BoostPid int
var BoostDataPid int

func AdminOfflineDeal() {
swanService = GetSwanService()
Expand Down Expand Up @@ -224,10 +225,12 @@ func checkLotusConfig() {
}

// start boostd-data
if _, err = startBoostData(market.Repo, market.BoostDataLog); err != nil {
boostDataPid, err := startBoostData(market.Repo, market.BoostDataLog)
if err != nil {
logs.GetLogger().Errorf("start boostd-data service failed, error: %+v", err)
os.Exit(0)
}
BoostDataPid = boostDataPid

// start boostd
boostPid, err := startBoost(market.Repo, market.BoostLog, market.FullNodeApi)
Expand Down Expand Up @@ -503,7 +506,7 @@ func startBoostData(repo, logFile string) (int, error) {
logs.GetLogger().Error(err)
return 0, errors.Wrap(err, "open log file failed")
}
boostProcess, err := os.StartProcess("/usr/local/bin/boostd", args, &os.ProcAttr{
boostProcess, err := os.StartProcess("/usr/local/bin/boostd-data", args, &os.ProcAttr{
Sys: &syscall.SysProcAttr{
Setsid: true,
},
Expand Down