From 1d2d4697ec83ff7dfd2c294b3ec6314e9a454938 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 6 Jun 2026 16:13:21 -0500 Subject: [PATCH] feat: replace `systemctl` commands with `service` equivalents for sake of installing to devuan instead of debian, although the latter should still work okay iiuc.. --- rattail_fabric2/apache.py | 6 +++--- rattail_fabric2/collectd.py | 2 +- rattail_fabric2/mysql.py | 2 +- rattail_fabric2/postfix.py | 2 +- rattail_fabric2/postgresql.py | 4 ++-- rattail_fabric2/ssh.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rattail_fabric2/apache.py b/rattail_fabric2/apache.py index 5e1ee5b..455243c 100644 --- a/rattail_fabric2/apache.py +++ b/rattail_fabric2/apache.py @@ -146,18 +146,18 @@ def restart(c): """ Restart the Apache web service """ - c.sudo('systemctl restart apache2.service') + c.sudo("service apache2 restart") def stop(c): """ Stop the Apache web service """ - c.sudo('systemctl stop apache2.service') + c.sudo("service apache2 stop") def start(c): """ Start the Apache web service """ - c.sudo('systemctl start apache2.service') + c.sudo("service apache2 start") diff --git a/rattail_fabric2/collectd.py b/rattail_fabric2/collectd.py index 1528825..8521704 100644 --- a/rattail_fabric2/collectd.py +++ b/rattail_fabric2/collectd.py @@ -59,7 +59,7 @@ def restart(c): """ Restart the collectd service. """ - c.sudo('systemctl restart collectd') + c.sudo("service collectd restart") def deploy_mountpoint_check_script(c, dest, **kwargs): diff --git a/rattail_fabric2/mysql.py b/rattail_fabric2/mysql.py index f3b62aa..f3dc5df 100644 --- a/rattail_fabric2/mysql.py +++ b/rattail_fabric2/mysql.py @@ -66,7 +66,7 @@ def restart(c): """ Restart the MySQL database service """ - c.sudo('systemctl restart mysql.service') + c.sudo("service mysql restart") def user_exists(c, name, host='localhost'): diff --git a/rattail_fabric2/postfix.py b/rattail_fabric2/postfix.py index ed17d04..1923c01 100644 --- a/rattail_fabric2/postfix.py +++ b/rattail_fabric2/postfix.py @@ -62,7 +62,7 @@ def restart(c): """ Restart the Postfix mail service """ - c.sudo('systemctl restart postfix.service') + c.sudo("service postfix restart") def set_config(c, setting, value): diff --git a/rattail_fabric2/postgresql.py b/rattail_fabric2/postgresql.py index d524d78..bc5f5ae 100644 --- a/rattail_fabric2/postgresql.py +++ b/rattail_fabric2/postgresql.py @@ -93,14 +93,14 @@ def restart(c): """ Restart the PostgreSQL database service """ - c.sudo('systemctl restart postgresql.service') + c.sudo("service postgresql restart") def reload_(c): """ Reload config for the PostgreSQL database service """ - c.sudo('systemctl reload postgresql.service') + c.sudo("service postgresql reload") # TODO: deprecate / remove this reload = reload_ diff --git a/rattail_fabric2/ssh.py b/rattail_fabric2/ssh.py index 6a88f48..f42a6cd 100644 --- a/rattail_fabric2/ssh.py +++ b/rattail_fabric2/ssh.py @@ -65,7 +65,7 @@ def restart(c): """ Restart the OpenSSH service """ - c.sudo('systemctl restart ssh.service') + c.sudo("service ssh restart") def configure(c, allow_root=False):