Skip to content

Commit f91e4a4

Browse files
committed
.
1 parent 8728169 commit f91e4a4

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/scripts/smoke-test-lib.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,18 @@ check_unit_file() {
141141
}
142142

143143
check_single_execstart() {
144-
local count
145-
count=$(grep -h '^ExecStart=' "${UNIT_FILE_PATHS[@]}" 2>/dev/null | wc -l)
144+
local unit_file="" count
145+
for path in "${UNIT_FILE_PATHS[@]}"; do
146+
if [ -f "$path" ]; then
147+
unit_file="$path"
148+
break
149+
fi
150+
done
151+
if [ -z "$unit_file" ]; then
152+
return # check_unit_file already reported the absence
153+
fi
154+
# Match only non-empty ExecStart= lines; bare 'ExecStart=' is a reset directive.
155+
count=$(grep -c '^ExecStart=[^[:space:]]' "$unit_file" 2>/dev/null || echo 0)
146156
if [ "$count" -eq 1 ]; then
147157
pass "Service file has exactly one ExecStart directive"
148158
else

package/Linux/gateway/rpm/postrm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e
44

55
action="$1"
66

7+
if [ -d /run/systemd/system ]; then
8+
systemctl daemon-reload
9+
fi
10+
711
# Only do complete clean-up on purge.
812
if [ "$action" != "purge" ] ; then
913
exit 0

package/Linux/gateway/rpm/prerm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ fi
1616
if [ -d /run/systemd/system ]; then
1717
systemctl stop devolutions-gateway >/dev/null 2>&1
1818
systemctl disable devolutions-gateway >/dev/null 2>&1
19-
systemctl daemon-reload
2019
fi

0 commit comments

Comments
 (0)