From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: network@lists.ipfire.org Subject: [PATCH] Print better info mesages when we change a service Date: Sat, 10 Feb 2018 12:14:54 +0000 Message-ID: <1518264894-8343-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2533677325112439889==" List-Id: --===============2533677325112439889== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Signed-off-by: Jonatan Schlag --- src/functions/functions.service | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/functions/functions.service b/src/functions/functions.service index 7a12ffd..07bd2cd 100644 --- a/src/functions/functions.service +++ b/src/functions/functions.service @@ -45,6 +45,11 @@ service_stop() { assert isset name =20 systemctl stop "${name}" + local ret=3D$? + + log INFO "Stopped service '${name}', code=3D${ret}" + + return ${ret} } =20 service_restart() { @@ -52,6 +57,11 @@ service_restart() { assert isset name =20 systemctl restart "${name}" + local ret=3D$? + + log INFO "Restarted service '${name}', code=3D${ret}" + + return ${ret} } =20 service_reload() { @@ -60,7 +70,12 @@ service_reload() { =20 if service_status "${name}"; then systemctl reload "${name}" - return $? + local ret=3D$? + + log INFO "Reloaded service '${name}', code=3D${ret}" + + return ${ret} + else log WARNING "Cannot reload service '${name}' which is currently not runnin= g." fi --=20 2.6.3 --===============2533677325112439889==--