Skip to content

Fix archlinux-java execution and order#102

Closed
Ven0m0 wants to merge 3 commits into
mainfrom
fix-archlinux-java-command-3997987096099316359
Closed

Fix archlinux-java execution and order#102
Ven0m0 wants to merge 3 commits into
mainfrom
fix-archlinux-java-command-3997987096099316359

Conversation

@Ven0m0

@Ven0m0 Ven0m0 commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Improved the archlinux-java fix implementation in tools/server-start.sh. The fix command is now executed before JDK detection, ensuring that detect_java works with the corrected system state. Additionally, the code now uses the run_as_root utility instead of a hardcoded sudo call, adhering to the project's coding standards.


PR created automatically by Jules for task 3997987096099316359 started by @Ven0m0

- Moved the archlinux-java fix command before detect_java to ensure
  detection uses the fixed state.
- Replaced direct sudo call with run_as_root to follow codebase
  conventions.
- Added redirection to /dev/null and allowed failure with || : to
  prevent script interruption.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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

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.

Code Review

This pull request reorders the JDK detection block in tools/server-start.sh to execute after the Arch Linux Java fix, and replaces the use of sudo with run_as_root for the archlinux-java fix command. Feedback suggests checking if the script is already running as root before attempting the fix, to prevent unexpected password prompts for non-root users.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tools/server-start.sh
Comment on lines 197 to 199
if has archlinux-java; then
sudo archlinux-java fix &>/dev/null || :
run_as_root archlinux-java fix &>/dev/null || :
fi

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

Using run_as_root here can cause the script to block and prompt the user for a sudo password in interactive shells, which is unexpected and disruptive for a Minecraft server startup script. Since fixing system-wide Java configurations (archlinux-java fix) requires root privileges and is a system administration task, it should only be attempted if the script is already running as root (e.g., $EUID -eq 0). This avoids prompting non-root users for passwords.

Suggested change
if has archlinux-java; then
sudo archlinux-java fix &>/dev/null || :
run_as_root archlinux-java fix &>/dev/null || :
fi
if [[ $EUID -eq 0 ]] && has archlinux-java; then
archlinux-java fix &>/dev/null || :
fi

@kilo-code-bot

kilo-code-bot Bot commented Jun 28, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No New Issues Found | Recommendation: Merge

The incremental diff from commit 62a7205 to HEAD contains only shfmt formatting fixes across 11 files (function declaration spacing, redirection alignment). No functional changes were made.

The previous WARNING on tools/server-start.sh line 199 (run_as_root may prompt for sudo password...) was NOT modified in this incremental diff - the archlinux-java fix logic remains unchanged from the previous commit.

Files Reviewed (10 files)
  • minecraft/config/versions.sh - 6 spacing changes (trailing comment alignment)
  • tools/backup.sh - Function declaration spacing
  • tools/common.sh - Function declaration spacing
  • tools/logrotate.sh - Redirection operator spacing
  • tools/mc-client.sh - Function declaration spacing
  • tools/mod-updates.sh - Function declaration and redirection spacing
  • tools/monitor.sh - Function declaration spacing
  • tools/prepare.sh - Function declaration spacing
  • tools/systemd-service.sh - Indentation fix
  • tools/watchdog.sh - Function declaration spacing
  • tools/world-optimize.sh - Function declaration and redirection spacing
Previous Review Summaries (2 snapshots, latest commit 62a7205)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 62a7205)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
tools/server-start.sh 199 run_as_root may prompt for sudo password when the server is started by a non-root user without passwordless sudo, causing the startup script to block. Consider guarding the fix with $EUID -eq 0 or using a non-interactive sudo strategy.
Files Reviewed (5 files)
  • minecraft/config/versions.sh - Pure formatting changes (trailing space removal, function declaration spacing)
  • tools/server-start.sh - Reordered archlinux-java fix before JDK detection and replaced sudo with run_as_root; previous issue on line 199 persists
  • tools/systemd-service.sh - Pure formatting changes and indentation fix
  • tools/watchdog.sh - Pure formatting changes
  • tools/world-optimize.sh - Pure formatting changes (function declarations, pipeline alignment, case statement expansion)

Fix these issues in Kilo Cloud

Previous review (commit 03684f7)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
tools/server-start.sh 199 run_as_root may prompt for sudo password when the server is started by a non-root user without passwordless sudo, causing the startup script to block. Consider guarding the fix with $EUID -eq 0 or using a non-interactive sudo strategy.
Files Reviewed (1 file)
  • tools/server-start.sh - Reordered archlinux-java fix before JDK detection and replaced sudo with run_as_root

Fix these issues in Kilo Cloud


Reviewed by laguna-m.1-20260312:free · Input: 2M · Output: 20.2K · Cached: 859.4K

Ven0m0 and others added 2 commits June 28, 2026 19:06
- Moved the archlinux-java fix command before detect_java in
  tools/server-start.sh.
- Replaced direct sudo call with run_as_root.
- Fixed shell formatting in multiple scripts to satisfy CI lint checks.
- Removed accidental junk files.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Moved the archlinux-java fix command before detect_java in
  tools/server-start.sh.
- Replaced direct sudo call with run_as_root.
- Fixed shell formatting (shfmt) across all tools/ scripts and
  minecraft/config/versions.sh to satisfy CI lint checks.
- Specific fixes include adding space in function definitions and
  removing spaces after redirection operators.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 3, 2026 04:28

Copilot AI left a comment

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.

Pull request overview

This PR improves Java startup reliability on Arch Linux by running archlinux-java fix before JDK detection and standardizing privileged execution via run_as_root. It also applies consistent Bash function formatting across multiple tooling scripts.

Changes:

  • Run archlinux-java fix before detect_java in tools/server-start.sh, using run_as_root.
  • Normalize function declarations and some redirection spacing across tools/*.sh and minecraft/config/versions.sh.
  • Minor consistency improvement opportunity in tools/mod-updates.sh by switching hardcoded sudo to run_as_root (flagged in review comments).

Reviewed changes

Copilot reviewed 1 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/world-optimize.sh Function formatting/spacing normalization.
tools/watchdog.sh Function formatting normalization.
tools/systemd-service.sh Function formatting normalization.
tools/server-start.sh Run archlinux-java fix (via run_as_root) before Java detection.
tools/prepare.sh Function formatting normalization.
tools/monitor.sh Function formatting normalization.
tools/mod-updates.sh Function formatting normalization; still contains hardcoded sudo calls (commented).
tools/mc-client.sh Function formatting normalization.
tools/logrotate.sh Function formatting/spacing normalization.
tools/common.sh Function formatting normalization; review flags rg dependency usage (commented).
tools/backup.sh Function formatting normalization.
minecraft/config/versions.sh Function formatting normalization.

Comment thread tools/common.sh
send_command(){
send_command() {
local cmd="$1" session_name="minecraft"
if command -v screen &>/dev/null && screen -list | rg -q "$session_name" &>/dev/null; then
Comment thread tools/mod-updates.sh
Comment on lines 101 to 102
[[ -d world ]] && sudo chown -R "$(id -un):$(id -gn)" world &>/dev/null || :
sudo chmod -R 755 ./*.sh &>/dev/null || :
Comment thread tools/common.sh
Comment on lines +148 to 151
check_server_port() {
local port="${1:-25565}"
if has nc; then
nc -z localhost "$port" &>/dev/null
@Ven0m0 Ven0m0 closed this Jul 4, 2026
@Ven0m0 Ven0m0 deleted the fix-archlinux-java-command-3997987096099316359 branch July 4, 2026 10:06
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.

2 participants