Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Conversation

@busykai
Copy link
Contributor

@busykai busykai commented Feb 14, 2018

In case the store being generated is the system store, ignore HUP, INT and TERM
while it's being generated and serialize store write section of the code.

Fixes #9.

@icarus-sparry, could you please take a look?

clrtrust Outdated

lock() {
# lock should be on the same block device so that we could ln to it
local lock_path=$(mktemp -p "$(dirname $CLR_TRUST_LOCK_FILE)")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be slightly simpler I think to say

    local lock_path=$(mktemp "${CLR_TRUST_LOCK_FILE}.xxxxxx")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed!


trap sig_ignore INT HUP TERM
if is_system_store && ! lock; then
trap - INT HUP TERM

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an error message, e.g.

  1>&2 echo "Error failed to lock $CLR_TRUST_LOCK_FILE"

so the user knows what is happening?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added on the next line.

In case the store being generated is the system store, ignore HUP, INT and TERM
while it's being generated and serialize store write section of the code.
@busykai busykai force-pushed the kai/serialize-store-generation branch from 4c19184 to d320b01 Compare February 14, 2018 23:44
@busykai
Copy link
Contributor Author

busykai commented Feb 14, 2018

Thank you, @icarus-sparry! Especially, for the hint on locking!

@busykai busykai merged commit 6941fd6 into master Feb 14, 2018
@busykai busykai deleted the kai/serialize-store-generation branch February 14, 2018 23:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants