From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: network@lists.ipfire.org Subject: Re: [PATCH] Print better info mesages when we change a service Date: Sat, 10 Feb 2018 14:41:16 +0000 Message-ID: <1518273676.2541.133.camel@ipfire.org> In-Reply-To: <1518264894-8343-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5977910224749452905==" List-Id: --===============5977910224749452905== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Why do we need this? Best, -Michael On Sat, 2018-02-10 at 12:14 +0000, Jonatan Schlag wrote: > Signed-off-by: Jonatan Schlag > --- > src/functions/functions.service | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) >=20 > diff --git a/src/functions/functions.service b/src/functions/functions.serv= ice > 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 running." > fi --===============5977910224749452905== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUFCQ2dBZEZpRUU1L3JXNWwzR0dl Mnlwa3R4Z0hudy8yK1FDUWNGQWxwL0JJd0FDZ2tRZ0hudy8yK1EK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