Skip to content

Commit 517cf37

Browse files
liulinCTimSmithCtx
authored andcommitted
CA-405851: stop_all_gc failed to stop SMGC services
systemd has changed its output for command as folllows /usr/bin/systemctl list-units SMGC@* ============> SMGC@1.service SMGC@2.service ============ SMGC@1.service SMGC@2.service <============ Note: the extra space before the valid service name This means `cut -d' ' -f1` can no longer parse the service name. `awk` is used rather that `cut` to fix the issue Signed-off-by: Lin Liu <Lin.Liu01@cloud.com>
1 parent 332dacb commit 517cf37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/stop_all_gc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/bash
22

3-
/usr/bin/systemctl list-units SMGC@* --all --no-legend | /usr/bin/cut -d ' ' -f1 | sed 's/\\/\\\\/g' | while read service;
3+
/usr/bin/systemctl list-units SMGC@* --all --no-legend | /usr/bin/awk '{print $1}' | sed 's/\\/\\\\/g' | while read service;
44
do
55
echo "Stopping $service"
66
/usr/bin/systemctl stop "$service"

0 commit comments

Comments
 (0)