Skip to content

Fix crontab append when no existing crontab#70

Merged
jonathonbyrdziak merged 1 commit intomasterfrom
fix/crontab-append-empty
Mar 21, 2026
Merged

Fix crontab append when no existing crontab#70
jonathonbyrdziak merged 1 commit intomasterfrom
fix/crontab-append-empty

Conversation

@jonathonbyrdziak
Copy link
Copy Markdown
Contributor

Summary

  • Shell::run() appends 2>&1 to all commands, overriding 2>/dev/null in crontab -l
  • This caused "no crontab for ec2-user" to be prepended to the crontab file, making it invalid and silently rejected
  • Now checks return code instead of relying on stderr suppression

Test plan

  • protocol cron:add -v on a server with no existing crontab — entry is written
  • crontab -l shows the protocol restart entry

🤖 Generated with Claude Code

Shell::run() appends 2>&1 to all commands, overriding the 2>/dev/null
in 'crontab -l'. This caused the error message 'no crontab for ec2-user'
to be treated as existing crontab content, producing an invalid crontab
file that was silently rejected. Now checks return code instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jonathonbyrdziak jonathonbyrdziak merged commit 881dda9 into master Mar 21, 2026
6 of 8 checks passed
@jonathonbyrdziak jonathonbyrdziak deleted the fix/crontab-append-empty branch March 21, 2026 05:14
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.

1 participant