From ebb32f0d9c34b1a6af28bb4d7277863451d5cf83 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sat, 13 Apr 2019 17:42:47 +0200 Subject: [PATCH] Use ynh_systemd_action --- data/helpers.d/backend | 4 ++-- data/helpers.d/psql | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/helpers.d/backend b/data/helpers.d/backend index 710e6299b..715ad2353 100644 --- a/data/helpers.d/backend +++ b/data/helpers.d/backend @@ -442,7 +442,7 @@ EOF ynh_store_file_checksum "$finalfail2banjailconf" ynh_store_file_checksum "$finalfail2banfilterconf" - systemctl try-reload-or-restart fail2ban + ynh_systemd_action --service_name=fail2ban --action=reload local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")" if [[ -n "$fail2ban_error" ]]; then @@ -459,5 +459,5 @@ EOF ynh_remove_fail2ban_config () { ynh_secure_remove "/etc/fail2ban/jail.d/$app.conf" ynh_secure_remove "/etc/fail2ban/filter.d/$app.conf" - systemctl try-reload-or-restart fail2ban + ynh_systemd_action --service_name=fail2ban --action=reload } diff --git a/data/helpers.d/psql b/data/helpers.d/psql index 2212d692a..f36ef8128 100644 --- a/data/helpers.d/psql +++ b/data/helpers.d/psql @@ -276,7 +276,8 @@ ynh_psql_test_if_first_run() { ynh_die "postgresql shoud be 9.4 or 9.6" fi - systemctl start postgresql + ynh_systemd_action --service_name=postgresql --action=start + sudo --login --user=postgres psql -c"ALTER user postgres WITH PASSWORD '$pgsql'" postgres # force all user to connect to local database using passwords @@ -289,6 +290,6 @@ ynh_psql_test_if_first_run() { yunohost service add postgresql --log "$logfile" systemctl enable postgresql - systemctl reload postgresql + ynh_systemd_action --service_name=postgresql --action=reload fi }