Skip to content

Replace autologin shrc approach with rc.d service#9

Merged
ericbsd merged 2 commits into
masterfrom
rc-setup
May 14, 2026
Merged

Replace autologin shrc approach with rc.d service#9
ericbsd merged 2 commits into
masterfrom
rc-setup

Conversation

@ericbsd
Copy link
Copy Markdown
Contributor

@ericbsd ericbsd commented May 14, 2026

Instead of using autologin with shrc to run the setup, implement a cleaner
rc.d service that handles the setup-to-lightdm transition. The setup app now
exits cleanly via Gtk.main_quit() and lets the rc.d service continue boot.

  • Bump version from 0.1 to 0.3
  • Add ghostbsd_setup rc.d script installation
  • Replace direct lightdm startup with Gtk.main_quit()
  • Remove start_lightdm import and call

Summary by Sourcery

Replace the autologin-based setup completion with an rc.d service–driven transition to lightdm and update the package version accordingly.

New Features:

  • Install an initial_setup rc.d script to manage the transition from the setup application to lightdm during boot.

Enhancements:

  • Change the setup application to exit via Gtk.main_quit instead of directly starting lightdm and terminating the process.
  • Bump the application version from 0.1 to 0.3 to reflect the new startup mechanism.

ericbsd and others added 2 commits December 19, 2025 17:57
Instead of using autologin with shrc to run the setup, implement a cleaner
rc.d service that handles the setup-to-lightdm transition. The setup app now
exits cleanly via Gtk.main_quit() and lets the rc.d service continue boot.

  - Bump version from 0.1 to 0.3
  - Add ghostbsd_setup rc.d script installation
  - Replace direct lightdm startup with Gtk.main_quit()
  - Remove start_lightdm import and call
@ericbsd ericbsd requested review from a team as code owners May 14, 2026 02:20
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 14, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces the previous autologin-based setup completion flow with an rc.d service–driven transition to lightdm, cleaning up the GTK exit path and installing the new service script, while bumping the application version.

Sequence diagram for rc.d-driven setup completion and GTK exit

sequenceDiagram
    participant RcD_initial_setup
    participant SetupStationApp
    participant GtkMainLoop

    RcD_initial_setup->>SetupStationApp: setup_system
    SetupStationApp->>SetupStationApp: enable_lightdm
    SetupStationApp->>GtkMainLoop: Gtk.main_quit
Loading

File-Level Changes

Change Details Files
Refactor setup completion flow to stop using direct lightdm startup and exit GTK cleanly so rc.d can continue boot.
  • Stop importing and using start_lightdm from system_calls so setup no longer starts lightdm directly.
  • Update the final setup completion sequence to only update the UI, delay briefly, and then quit the GTK main loop via Gtk.main_quit().
  • Adjust comments to describe exiting GTK instead of starting lightdm directly, clarifying that rc.d will continue the boot to lightdm.
setup_station/setup_system.py
Update packaging to install new rc.d setup script and bump version.
  • Bump VERSION from 0.1 to 0.3 to reflect the new boot/setup behavior.
  • Extend data_files to install a new rc.d script (initial_setup) into prefix/etc/rc.d.
  • Introduce the initial_setup script file that will implement the rc.d service responsible for the setup-to-lightdm transition.
setup.py
src/initial_setup

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="setup.py" line_range="145-146" />
<code_context>
     (f'{prefix}/lib/setup-station', ['src/ghostbsd-style.css']),
     (f'{prefix}/lib/setup-station/image', lib_setup_station_image),
-    (f'{prefix}/share/applications', ['src/setup-station.desktop'])
+    (f'{prefix}/share/applications', ['src/setup-station.desktop']),
+    (f'{prefix}/etc/rc.d', ['src/initial_setup'])
 ]

</code_context>
<issue_to_address>
**suggestion (bug_risk):** Installing the rc.d script under `prefix/etc/rc.d` may not match system expectations for startup scripts.

Using `f'{prefix}/etc/rc.d'` ties the script location to the Python install prefix (e.g., virtualenv) instead of the system-wide `/etc/rc.d`, so the service may not be discovered or managed by the OS. It would be better to use the canonical rc.d path for the target platform (e.g. `/etc/rc.d` or `${LOCALBASE}/etc/rc.d`), or make this path configurable to align with packaging conventions.

Suggested implementation:

```python
    (os.environ.get('RC_D_DIR', '/etc/rc.d'), ['src/initial_setup'])

```

1. Ensure `os` is imported at the top of `setup.py` if it is not already:
   - Add `import os` alongside the existing imports (e.g. near `import sys`).
2. If your target platform prefers a different default (e.g. `${LOCALBASE}/etc/rc.d`), adjust the default accordingly, for example:
   - `os.environ.get('RC_D_DIR', '/usr/local/etc/rc.d')`
3. If you have packaging tooling (e.g. ports, pkg, or distro-specific spec files), set `RC_D_DIR` appropriately in those packaging scripts so the install path matches system policy.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread setup.py
@ericbsd ericbsd merged commit 3431f83 into master May 14, 2026
2 checks passed
@ericbsd ericbsd deleted the rc-setup branch May 14, 2026 10:16
@github-project-automation github-project-automation Bot moved this from In Review to Done in Development Tracker May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants