Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[swss.sh/syncd.sh] Trap only on EXIT #11590

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function lock_service_state_change()

exec {LOCKFD}>${LOCKFILE}
/usr/bin/flock -x ${LOCKFD}
trap "/usr/bin/flock -u ${LOCKFD}" 0 2 3 15
trap "/usr/bin/flock -u ${LOCKFD}" EXIT

debug "Locked ${LOCKFILE} (${LOCKFD}) from ${SERVICE}$DEV service"
}
Expand Down
6 changes: 3 additions & 3 deletions files/scripts/syncd_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#
# common functions used by "syncd" scipts (syncd.sh, gbsyncd.sh, etc..)
# scripts using this must provide implementations of the following functions:
#
#
# startplatform
# waitplatform
# stopplatform1 and stopplatform2
#
#
# For examples of these, see gbsyncd.sh and syncd.sh.
#

Expand All @@ -25,7 +25,7 @@ function lock_service_state_change()

exec {LOCKFD}>${LOCKFILE}
/usr/bin/flock -x ${LOCKFD}
trap "/usr/bin/flock -u ${LOCKFD}" 0 2 3 15
trap "/usr/bin/flock -u ${LOCKFD}" EXIT

debug "Locked ${LOCKFILE} (${LOCKFD}) from ${SERVICE}$DEV service"
}
Expand Down