From d0630b00e1fce2df2d4e6f405ddc82f92d112af2 Mon Sep 17 00:00:00 2001 From: Zach Wasserman Date: Wed, 23 Mar 2022 15:27:52 -0700 Subject: [PATCH] Allow Orbit shell to run while daemon is running (#4772) Use a different data path so that the new osquery instance doesn't try to use the same pidfile, db file, extension socket, etc. #4769 --- orbit/changes/fix-shell | 1 + orbit/cmd/orbit/shell.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 orbit/changes/fix-shell diff --git a/orbit/changes/fix-shell b/orbit/changes/fix-shell new file mode 100644 index 0000000000..b0a301fd6f --- /dev/null +++ b/orbit/changes/fix-shell @@ -0,0 +1 @@ +* Fix `orbit shell` command to successfully run when Orbit is already running as daemon. diff --git a/orbit/cmd/orbit/shell.go b/orbit/cmd/orbit/shell.go index a5dadd7dda..5b3b868ffc 100644 --- a/orbit/cmd/orbit/shell.go +++ b/orbit/cmd/orbit/shell.go @@ -80,7 +80,7 @@ var shellCommand = &cli.Command{ r, _ := osquery.NewRunner( osquerydPath, osquery.WithShell(), - osquery.WithDataPath(c.String("root-dir")), + osquery.WithDataPath(filepath.Join(c.String("root-dir"), "shell")), // Handle additional args after -- osquery.WithFlags(c.Args().Slice()), )