Skip to content

pdist: Add option --set-pdist-status #167

Merged
merged 1 commit into from
Mar 31, 2021
Merged

Conversation

donald
Copy link
Collaborator

@donald donald commented Mar 31, 2021

Add option --set-pdist-status. This option make the client write a status
file /.pdist_status when everything completed successfully. It is
supposed to be used only during full dists from the distmaster.

The idea is that health check scripts can look at the status file and
the embededed time tag to find out when a system was successfully
updated generate an alarm if this is to long in the past.

Copy link
Contributor

@pmenzel pmenzel left a comment

Choose a reason for hiding this comment

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

Some nits as always.

sucessfully → successfully

pdist/pdist Outdated

if ( !$fileop_noop && $force_status) {
my $t=time;
open L,'>','/.PDIST_STATUS' or die "/.PDIST_STATUS: $!\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we write it lowercase .pdist_status? At least for me, that’s easier to type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I mirrored what pmirror does ( ".PMIRROR_STATUS" ) but I don't really care.

pdist/pdist Outdated
@@ -1186,6 +1195,7 @@ usage: $0 cmd [options]
--fileop_debug # log all file operations
--[no]delete # do or do not clean up additional files on client.
# default is delete unless --files is used
--force_status # force creation of /.PDIST_STATUS on target
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Is there a pattern, when to use - and _? I’d prefer --force-status.
  2. Why force and not create for example, or --set-pdist-status.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right. Again, I've copy-pasted from pmirror. I change that into --set-pdist-status

@donald donald force-pushed the pdist-add-status-file branch 2 times, most recently from fdae58b to 2720ef3 Compare March 31, 2021 07:33
Add option --set-pdist-status. This option make the client write a
status file /.pdist_status when everything completed successfully. It is
supposed to be used only during full dists from the distmaster.

The idea is that health check scripts can look at the status file  and
the embededed time tag to find out when a system was successfully updated
and generate an alarm if this is to long in the past.
@donald donald changed the title pdist: Add option --force_status pdist: Add option --set-pdist-status Mar 31, 2021
@donald donald merged commit 6bdc8b0 into master Mar 31, 2021
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants