SYSTEMD: Remove set -e to allow failure
'set -e' flag doesn't allow to fall back to 'return 0' when a command fails. As installation/removal should not fail in most cases - 'set -e' flag has been removed. Below page recommends to be careful with 'set -e' usage: https://www.debian.org/doc/debian-policy/ch-opersys.html#writing-the-scripts Change-Id: If4439aaff66747bceabd3beb7e00ae12ce950e43 Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# This will return 0 if an id is created and non-zero if
|
||||
# it already exists
|
||||
# https://www.debian.org/doc/debian-policy/ch-opersys.html#users-and-groups
|
||||
|
||||
+3
-4
@@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
stop_rdc() {
|
||||
if [ -d /run/systemd/system ]; then
|
||||
#stop RDC if running
|
||||
@@ -11,8 +9,9 @@ stop_rdc() {
|
||||
}
|
||||
|
||||
rm_rdc_service() {
|
||||
if [ -e /run/systemd/system ]; then
|
||||
unlink /lib/systemd/system/rdc.service
|
||||
local LINK=/lib/systemd/system/rdc.service
|
||||
if [ -L $LINK ]; then
|
||||
unlink $LINK
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
+3
-2
@@ -9,8 +9,9 @@ stop_rdc() {
|
||||
}
|
||||
|
||||
rm_rdc_service() {
|
||||
if [ -e /run/systemd/system ]; then
|
||||
unlink @DISTRO_ROOT@/rdc.service
|
||||
local LINK=@DISTRO_ROOT@/rdc.service
|
||||
if [ -L $LINK ]; then
|
||||
unlink $LINK
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user