diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 5748781..3ccb6b6 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -220,7 +220,14 @@ func New(sudo bool) *Manager { return &Manager{sudo: sudo, smartctl: ok, cache: map[string]Smart{}} } -func (m *Manager) HasSmartctl() bool { return m.smartctl } +// HasSmartctl re-probes when it was missing at startup, so an install from the Disks +// tab takes effect without a daemon restart. +func (m *Manager) HasSmartctl() bool { + if !m.smartctl { + _, m.smartctl = lookPath("smartctl") + } + return m.smartctl +} func (m *Manager) run(ctx context.Context, args ...string) ([]byte, int, error) { if p, ok := lookPath(args[0]); ok { @@ -273,7 +280,7 @@ func (m *Manager) Smart(ctx context.Context, dev string, force bool) Smart { s.Error = "unknown device" return s } - if !m.smartctl { + if !m.HasSmartctl() { return s } m.mu.Lock()