Skip to content

Fix LaunchOnlyOnce contradiction in key rotation LaunchAgent - #18

Merged
shawntz merged 3 commits into
feat/add-headless-launchagentfrom
copilot/sub-pr-7-another-one
Jan 11, 2026
Merged

Fix LaunchOnlyOnce contradiction in key rotation LaunchAgent#18
shawntz merged 3 commits into
feat/add-headless-launchagentfrom
copilot/sub-pr-7-another-one

Conversation

Copilot AI commented Dec 13, 2025

Copy link
Copy Markdown
Contributor

Description

The com.shawnschwartz.cassh.rotate.plist LaunchAgent had LaunchOnlyOnce=false with a comment stating "Don't run if already running" — contradictory behavior. Setting LaunchOnlyOnce=false allows launchd to spawn concurrent instances when StartInterval fires.

Changed:

  • Removed LaunchOnlyOnce key (defaults to preventing concurrent runs for StartInterval jobs)
  • Removed misleading comment

The default behavior now correctly prevents overlapping key rotation executions without requiring lock file implementation.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Part of #7 feedback

How Has This Been Tested?

  • Manual testing

Test environment:

  • OS: macOS
  • Go version: N/A (plist configuration change only)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Security Considerations

  • This PR does not introduce any security concerns
  • I have considered the security implications and addressed them

Screenshots (if applicable)

N/A


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: shawntz <5200266+shawntz@users.noreply.github.com>
Copilot AI changed the title [WIP] Update background key rotation implementation based on feedback Fix LaunchOnlyOnce contradiction in key rotation LaunchAgent Dec 13, 2025
Copilot AI requested a review from shawntz December 13, 2025 08:23
@shawntz
shawntz marked this pull request as ready for review December 19, 2025 09:53
Copilot AI review requested due to automatic review settings December 19, 2025 09:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a contradictory configuration in the com.shawnschwartz.cassh.rotate.plist LaunchAgent that controls hourly SSH key rotation. The plist had LaunchOnlyOnce=false with a comment claiming "Don't run if already running," but setting this key to false actually allows concurrent instances when the StartInterval timer fires.

Key changes:

  • Removed the LaunchOnlyOnce key entirely to rely on launchd's default behavior
  • Removed the misleading comment that contradicted the configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shawntz

shawntz commented Jan 1, 2026

Copy link
Copy Markdown
Owner

fizzy

@shawntz
shawntz merged commit 5db9d0f into feat/add-headless-launchagent Jan 11, 2026
@shawntz
shawntz deleted the copilot/sub-pr-7-another-one branch January 11, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants