Skip to content

DietPi: no console autologin, write the pre-login banner - #18954

Open
mews-se wants to merge 1 commit into
community-scripts:mainfrom
mews-se:fix/dietpi-no-autologin
Open

mews-se wants to merge 1 commit into
community-scripts:mainfrom
mews-se:fix/dietpi-no-autologin

Conversation

@mews-se

@mews-se mews-se commented Nov 23, 2026

Copy link
Copy Markdown

✍️ Description

DietPi runs its first run setup from the first interactive login. With the engine's autologin on tty1 that login happens by itself as soon as the container boots, so the setup starts unattended on the web console, takes its lock, and whoever comes in over pct console, SSH or the second console only gets "first run setup is currently running on another screen". The tty1-only workaround from community-scripts/DevScripts#2490 kept it to one console, but the setup still started with nobody there.

Since DietPi v10.9 the login prompt shows the default credentials (root / dietpi, or the custom dietpi.txt entry) until the first run setup has finished, via /etc/issue.d/dietpi-banner.issue (MichaIng/DietPi#8507). The autologin is no longer needed to find the way in, and MichaIng suggested dropping it for the container (MichaIng/DietPi#8233) so it behaves like the other DietPi images: a login prompt, and the first run setup starts on the console the user actually logs in on.

Changes in install/dietpi-install.sh:

  • After customize, remove both getty overrides it writes in the no-password case (container-getty@ and console-getty) instead of moving one of them to container-getty@1. Everything else from customize stays (the update entrypoint, the SSH key, .hushlogin). With a root password chosen in the advanced settings nothing changes, customize never wrote the overrides then.
  • Write the pre-login banner with dietpi-banner issue. DietPi's installer skips that step on its master branch (a temporary guard from 17 Nov 2026, MichaIng/DietPi@3f2f83a0, still in place after the v10.9 release), so a container built from master would otherwise show a bare login prompt until the first run setup has finished. The call is idempotent and stays harmless once the guard is lifted.

ct/dietpi.sh is untouched, its closing line still holds. #18949 changes the restart lines of that file, no overlap.

Tested on a fresh build from this branch: no getty drop-ins left, container-getty@1, @2 and console-getty on the stock agetty line, no session after boot, the banner with the credentials above login: on tty1, root/dietpi accepted, the first run setup starts once on the console that logs in, and a login on tty2 meanwhile gets DietPi's "running on another screen" message.

🔗 Related Issue

MichaIng/DietPi#8233 (MichaIng's suggestion after the merge), MichaIng/DietPi#8507 (the pre-login banner). Follow-up to community-scripts/DevScripts#2490.

✅ Prerequisites (x in brackets)

  • Self-review completed – Code follows project standards.
  • Tested thoroughly – Changes work as expected.
  • No security risks – No hardcoded secrets, unnecessary privilege escalations, or permission issues.

Tested on: PVE 9.2.28 / Debian 13 template / fresh install from this branch (two builds), console login on tty1 and tty2


🛠️ Type of Change (X in brackets)

  • 🐞 Bug fix – Resolves an issue without breaking functionality.
  • ✨ New feature – Adds new, non-breaking functionality.
  • 💥 Breaking change – Alters existing functionality in a way that may require updates.
  • 🆕 New script – A fully functional and tested script or script set.
  • 🌍 Website update – Changes to script metadata (PocketBase/website data).
  • 🔧 Refactoring / Code Cleanup – Improves readability or maintainability without changing functionality.
  • 📝 Documentation update – Changes to README, AppName.md, CONTRIBUTING.md, or other docs.

💥 Breaking Change Advisory (only if you checked "Breaking change")


🤖 AI Assistance (X in brackets)

If you used an AI tool (GitHub Copilot, Claude, ChatGPT, etc.) to write or generate any scripts in this PR, you must confirm compliance below.
Select exactly one option.

  • No AI used – Scripts were written without AI assistance.
  • AI was used – I confirm the scripts were built using AGENTS.md and .github/agents/pve-script-creator.agent.md as guidance, and the output has been reviewed and corrected to match those guidelines. Claude Fable 5.1 (Anthropic), used to trace the autologin and the banner guard and write the change. Tested on a real Proxmox host and reviewed by me.

DietPi runs its first run setup from the first interactive login. With
the engine's autologin on tty1 it started by itself on the web console,
and anyone coming in over pct console, SSH or the second console only
saw "first run setup is currently running on another screen". Since
DietPi v10.9 the login prompt shows the default credentials, so remove
both getty overrides that customize writes instead of moving one of them
to container-getty@1.

DietPi's installer skips the banner on its master branch (temporary
guard since 17 Nov 2026), so write it here with dietpi-banner issue.
@mews-se
mews-se requested a review from a team as a code owner November 23, 2026 03:44
@github-actions

Copy link
Copy Markdown
Contributor

Try this branch

The engine and the scripts resolve independently, so this runs the changed
ct/ and install/ scripts against the production engine:

export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/mews-se/ProxmoxVE/fix/dietpi-no-autologin
bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/dietpi.sh")"

Both lines are needed. Without COMMUNITY_SCRIPTS_URL the engine falls back to
main, so curling the branch URL on its own gives you the ct/ script from
this PR and the install/ script from main. Frequently the one you meant to test.

The same command works on an Incus host: the engine detects the platform and
loads the matching backend, while the scripts still come from this branch.

Useful while testing

dev_mode=net logs every fetch with status and URL, which is the quickest way
to confirm the branch is really being used. dev_mode=keep stops a failed
build from deleting the container along with the evidence.

export COMMUNITY_SCRIPTS_URL=https://raw.githubusercontent.com/mews-se/ProxmoxVE/fix/dietpi-no-autologin
dev_mode=net,keep bash -c "$(curl -fsSL "$COMMUNITY_SCRIPTS_URL/ct/dietpi.sh")"
Against a core branch as well

Add COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/OWNER/core/BRANCH
to test an engine change at the same time. The two resolve independently.

@github-actions github-actions Bot added bugfix update script A change that updates a script labels Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Proxmox script test

@mews-se ✅ 2/2 passed at e2605e0

Script Platform Install Update Duration Detail
ct/dietpi.sh pve ✅ ➖ 6m51s no URL to check; update: nothing to update
ct/dietpi.sh incus ✅ ➖ 4m21s no URL to check; update: nothing to update
ct/dietpi.sh arm64 ✅ ➖ 3m46s no URL to check; update: nothing to update

ARM64 (information only, not counted): 1/1 passed.

📊 Resources
Script Platform Usage
ct/dietpi.sh pve disk 0.3 of 4 GB · RAM at rest 6 of 512 MB · OOM kills 0
ct/dietpi.sh incus disk 0.2 of 4 GB · RAM at rest 6 of 512 MB · OOM kills 0
ct/dietpi.sh arm64 disk 0.3 of 4 GB · RAM at rest 5 of 512 MB · OOM kills 0
📄 ct/dietpi.sh (pve) — install log (13 lines)
[2026-11-23 03:49:09] [OK] Converted Debian to DietPi
[2026-11-23 03:49:09] [INFO] Configuring DietPi
/boot/dietpi/func/dietpi-banner: line 96: ((: != 20 : syntax error: operand expected (error token is "!= 20 ")
[2026-11-23 03:49:09] [OK] Configured DietPi
[2026-11-23 03:49:09] [INFO] Customizing Container
[2026-11-23 03:49:11] [OK] Customized Container
[2026-11-23 03:49:11] [INFO] Cleaning up
Reading package lists...
Building dependency tree...
Reading state information...
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
[2026-11-23 03:49:11] [OK] Cleaned
🔄 ct/dietpi.sh (pve) — update log (14 lines)
    ____  _      __  ____  _ 
   / __ \(_)__  / /_/ __ \(_)
  / / / / / _ \/ __/ /_/ / / 
 / /_/ / /  __/ /_/ ____/ /  
/_____/_/\___/\__/_/   /_/   
    ____  _      __  ____  _ 
   / __ \(_)__  / /_/ __ \(_)
  / / / / / _ \/ __/ /_/ / / 
 / /_/ / /  __/ /_/ ____/ /  
/_____/_/\___/\__/_/   /_/   
  ⏳   Updating DietPi LXC
  ✔️  Updated DietPi LXC
  ⏳   Cleaning up
  ✔️  Cleaned
📄 ct/dietpi.sh (incus) — install log (14 lines)
[2026-11-23 03:47:32] [OK] Converted Debian to DietPi
[2026-11-23 03:47:32] [INFO] Configuring DietPi
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
/boot/dietpi/func/dietpi-banner: line 96: ((: != 20 : syntax error: operand expected (error token is "!= 20 ")
[2026-11-23 03:47:32] [OK] Configured DietPi
[2026-11-23 03:47:32] [INFO] Customizing Container
[2026-11-23 03:47:34] [OK] Customized Container
[2026-11-23 03:47:34] [INFO] Cleaning up
Reading package lists...
Building dependency tree...
Reading state information...
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
[2026-11-23 03:47:34] [OK] Cleaned
🔄 ct/dietpi.sh (incus) — update log (2 lines)
Update helper unavailable - falling back to direct update.
curl: (7) Failed to connect to 10.98.0.1 port 18080 after 0 ms: Could not connect to server
📄 ct/dietpi.sh (arm64) — install log (14 lines)
[2026-11-23 03:48:32] [OK] Converted Debian to DietPi
[2026-11-23 03:48:32] [INFO] Configuring DietPi
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
/boot/dietpi/func/dietpi-banner: line 96: ((: != 20 : syntax error: operand expected (error token is "!= 20 ")
[2026-11-23 03:48:32] [OK] Configured DietPi
[2026-11-23 03:48:33] [INFO] Customizing Container
[2026-11-23 03:48:33] [OK] Customized Container
[2026-11-23 03:48:33] [INFO] Cleaning up
Reading package lists...
Building dependency tree...
Reading state information...
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
[2026-11-23 03:48:33] [OK] Cleaned
🔄 ct/dietpi.sh (arm64) — update log (2 lines)
Update helper unavailable - falling back to direct update.
curl: (7) Failed to connect to 10.98.0.1 port 18080 after 0 ms: Could not connect to server

Full logs: workflow run (artifacts result-*). Comment /test to build again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix update script A change that updates a script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant