2025-02-26 13:26:37 +01:00
|
|
|
# typed: strict
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2025-03-13 14:50:03 +00:00
|
|
|
module Services
|
2025-02-26 13:26:37 +01:00
|
|
|
module Commands
|
|
|
|
module Cleanup
|
|
|
|
TRIGGERS = %w[cleanup clean cl rm].freeze
|
|
|
|
|
|
|
|
sig { void }
|
|
|
|
def self.run
|
|
|
|
cleaned = []
|
|
|
|
|
2025-03-13 14:50:03 +00:00
|
|
|
cleaned += Services::Cli.kill_orphaned_services
|
|
|
|
cleaned += Services::Cli.remove_unused_service_files
|
2025-02-26 13:26:37 +01:00
|
|
|
|
|
|
|
puts "All #{System.root? ? "root" : "user-space"} services OK, nothing cleaned..." if cleaned.empty?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|