Skip to content

Commit

Permalink
MXS-5160: Silence installation output
Browse files Browse the repository at this point in the history
The systemctl enable and disable commands printed output to the standard
error which caused messages to appear during package installation and
removal.

Also added missing redirections into a few commands and made sure that
there are spaces between all of the the > operators.
  • Loading branch information
markus456 committed Jun 27, 2024
1 parent e15888f commit fc044fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions etc/postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ else
fi

# Only copy the service files if the systemd folder and systemctl executable are found
if [ -f @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service ] && command -v systemctl >/dev/null
if [ -f @CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/maxscale.service ] && command -v systemctl > /dev/null
then
if [ -d "/lib/systemd/system" ]
then
Expand All @@ -64,7 +64,7 @@ then
fi

mkdir -p /etc/systemd/system/maxscale.service.d
systemctl enable maxscale.service > /dev/null
systemctl enable maxscale.service >& /dev/null

systemctl is-active maxscale.service --quiet > /dev/null && systemctl restart maxscale.service > /dev/null
else
Expand Down
14 changes: 7 additions & 7 deletions etc/prerm.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ "$1" = "0" ] || [ "$1" = "remove" ]
then
if [ -f /etc/init.d/maxscale ]
then
/etc/init.d/maxscale stop
/etc/init.d/maxscale stop > /dev/null
rm /etc/init.d/maxscale
fi

Expand All @@ -18,16 +18,16 @@ then

if [ -f /usr/lib/systemd/system/maxscale.service ]
then
systemctl stop maxscale.service
systemctl disable maxscale.service > /dev/null
systemctl stop maxscale.service > /dev/null
systemctl disable maxscale.service >& /dev/null
rm /usr/lib/systemd/system/maxscale.service
systemctl daemon-reload
systemctl daemon-reload > /dev/null
elif [ -f /lib/systemd/system/maxscale.service ]
then
systemctl stop maxscale.service
systemctl disable maxscale.service > /dev/null
systemctl stop maxscale.service > /dev/null
systemctl disable maxscale.service >& /dev/null
rm /lib/systemd/system/maxscale.service
systemctl daemon-reload
systemctl daemon-reload > /dev/null
fi

if [ -f /etc/logrotate.d/maxscale_logrotate ]
Expand Down

0 comments on commit fc044fd

Please sign in to comment.