Skip to content

Commit

Permalink
remove system wide residues with remove
Browse files Browse the repository at this point in the history
  • Loading branch information
cryi committed Jul 15, 2024
1 parent a720b03 commit d4716a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/__tezpay/services.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ local function _remove_all_services()

local _ok, _systemctl = am.plugin.safe_get("systemctl")
ami_assert(_ok, "Failed to load systemctl plugin")

local _user = am.app.get("user", "root")
_systemctl = _systemctl.with_options({ container = _user })
local _systemctlUser = _systemctl.with_options({ container = _user })

for _, service in ipairs(_all) do
if type(service) ~= "string" then goto CONTINUE end
local _ok, _error = _systemctl.safe_remove_service(service)

local _ok, _error = _systemctl.safe_remove_service(service) -- remove system wide
if not _ok then
ami_error("Failed to remove " .. service .. ".service " .. (_error or ""))
end

local _ok, _error = _systemctlUser.safe_remove_service(service)
if not _ok then
ami_error("Failed to remove " .. service .. ".service " .. (_error or ""))
end
Expand Down
2 changes: 1 addition & 1 deletion src/specs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.3.0+0.16.6-beta",
"version": "0.3.1+0.16.6-beta",
"id": "tzc.tezpay",
"dependencies": [
{
Expand Down

0 comments on commit d4716a8

Please sign in to comment.