From bcf0b56911448bf1f8142076a2d174ce2f6a3d18 Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Mon, 23 Jun 2025 10:09:14 +0100 Subject: [PATCH] Implement sytemctl actions --- ordo/action/systemcl.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ordo/action/systemcl.scm diff --git a/ordo/action/systemcl.scm b/ordo/action/systemcl.scm new file mode 100644 index 0000000..14da223 --- /dev/null +++ b/ordo/action/systemcl.scm @@ -0,0 +1,40 @@ +#| +This file is part of Ordo. + +Copyright (C) 2025 Ray Miller + +This program is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation, version 3. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . +|# + +(define-module (ordo action systemctl) + #:use-module (ordo connection) + #:export (daemon-reload stop start restart reload)) + +(define (daemon-reload conn #:key user?) + (remote-cmd conn "systemctl" (when user? "--user") "daemon-reload" #:check? #t) + #t) + +(define (stop conn #:key unit user?) + (remote-cmd conn "systemctl" (when user? "--user") "stop" unit #:check? #t) + #t) + +(define (start conn #:key unit user?) + (remote-cmd conn "systemctl" (when user? "--user") "start" unit #:check? #t) + #t) + +(define (reload conn #:key unit user?) + (remote-cmd conn "systemctl" (when user? "--user") "reload" unit #:check? #t) + #t) + +(define (restart conn #:key unit user?) + (remote-cmd conn "systemctl" (when user? "--user") "restart" unit #:check? #t) + #t)