Skip to content

Commit 160973e

Browse files
committed
fix(deisctl): error when journaling a global unit
1 parent a0bcbc8 commit 160973e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

deisctl/backend/fleet/journal.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ func (c *FleetClient) Journal(target string) (err error) {
1818

1919
// runJournal tails the systemd journal for a given unit
2020
func (c *FleetClient) runJournal(name string) (exit int) {
21+
u, err := c.Fleet.Unit(name)
22+
if suToGlobal(*u) {
23+
fmt.Fprintf(c.errWriter, "Unable to get journal for global unit %s. Check on a host directly using journalctl.\n", name)
24+
return 1
25+
}
26+
2127
machineID, err := c.findUnit(name)
2228

2329
if err != nil {

0 commit comments

Comments
 (0)