Skip to content

Fix systemctl unit#472

Merged
zmanian merged 1 commit intonearai:stagingfrom
jwiklund:systemctl
Mar 12, 2026
Merged

Fix systemctl unit#472
zmanian merged 1 commit intonearai:stagingfrom
jwiklund:systemctl

Conversation

@jwiklund
Copy link
Copy Markdown
Contributor

@jwiklund jwiklund commented Mar 2, 2026

Without CLI_ENABLED=false the daemon keeps restarting since the stdin is closed.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an instability issue with the daemon when it's run as a systemd service. By explicitly setting an environment variable within the service configuration, the daemon is prevented from restarting unexpectedly, ensuring its reliable operation in a production environment.

Highlights

  • Systemd Service Fix: The pull request addresses a critical issue where the daemon would continuously restart when deployed as a systemd service due to stdin being closed.
  • CLI Environment Variable: The fix involves adding Environment="CLI_ENABLED=false" to the systemd service unit definition in src/service.rs.
Changelog
  • src/service.rs
    • Added Environment="CLI_ENABLED=false" to the systemd service unit configuration to prevent daemon restarts.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added size: XS < 10 changed lines (excluding docs) risk: low Changes to docs, tests, or low-risk modules contributor: new First-time contributor labels Mar 2, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes an issue where the ironclaw daemon would continuously restart when run as a systemd service on Linux. The fix involves setting the CLI_ENABLED=false environment variable in the systemd unit file to prevent the application from trying to use stdin. My review suggests extending this fix to the macOS launchd service as well, which likely suffers from the same problem.

Comment thread src/service.rs
\n\
[Service]\n\
Type=simple\n\
Environment=\"CLI_ENABLED=false\"\n\
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

While this disables the CLI for the systemd service, the same issue of a closed stdin likely affects the macOS launchd service. To ensure consistent behavior and prevent restart loops on macOS, you should also set CLI_ENABLED=false in the install_macos function. This can be done by adding an EnvironmentVariables dictionary to the generated plist file.

For example, you could add this to the plist's main dictionary:

<key>EnvironmentVariables</key>
<dict>
  <key>CLI_ENABLED</key>
  <string>false</string>
</dict>

@henrypark133 henrypark133 changed the base branch from main to staging March 10, 2026 02:31
Copy link
Copy Markdown
Collaborator

@zmanian zmanian left a comment

Choose a reason for hiding this comment

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

Review: Fix systemctl unit

Verdict: APPROVE

Without CLI_ENABLED=false in the systemd unit, the daemon tries to read from stdin (which is closed when running as a service), causing a restart loop. One-line fix, obvious correctness.

As Gemini noted, the macOS launchd plist may have the same issue -- but that's a separate concern and shouldn't block this fix.

@zmanian zmanian merged commit acea114 into nearai:staging Mar 12, 2026
2 checks passed
@ironclaw-ci ironclaw-ci Bot mentioned this pull request Mar 12, 2026
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
Co-authored-by: Jonas Wiklund <Jonas Wiklund>
drchirag1991 pushed a commit to drchirag1991/ironclaw that referenced this pull request Apr 8, 2026
Co-authored-by: Jonas Wiklund <Jonas Wiklund>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: new First-time contributor risk: low Changes to docs, tests, or low-risk modules size: XS < 10 changed lines (excluding docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants