fix: land .hushlogin on work disk so vm run is quiet
The work disk mounts at /root, so the .hushlogin written to the rootfs overlay was shadowed and never reached the guest — pam_motd kept printing the Debian banner on `banger vm run`. Move the write to the work disk root inode (= /root in the guest) and run it from PrepareHost so existing VMs pick it up on next start. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
696593b365
commit
71e073ac49
3 changed files with 17 additions and 8 deletions
|
|
@ -86,6 +86,15 @@ func provisionAuthorizedKey(ctx context.Context, runner system.CommandRunner, im
|
|||
return system.WriteExt4FileOwned(ctx, runner, imagePath, "/.ssh/authorized_keys", 0o600, 0, 0, merged)
|
||||
}
|
||||
|
||||
// ensureHushLoginOnWorkDisk lands /root/.hushlogin in the guest by
|
||||
// writing /.hushlogin at the root of the work disk (which mounts at
|
||||
// /root inside the guest). pam_motd checks $HOME/.hushlogin and stays
|
||||
// silent when it exists — combined with sshd's PrintMotd no / PrintLastLog no
|
||||
// that suppresses the Debian-style banner on `banger vm run`.
|
||||
func (s *WorkspaceService) ensureHushLoginOnWorkDisk(ctx context.Context, vm *model.VMRecord) error {
|
||||
return system.WriteExt4FileOwned(ctx, s.runner, vm.Runtime.WorkDiskPath, "/.hushlogin", 0o644, 0, 0, nil)
|
||||
}
|
||||
|
||||
func (s *WorkspaceService) ensureGitIdentityOnWorkDisk(ctx context.Context, vm *model.VMRecord) error {
|
||||
runner := s.runner
|
||||
if runner == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue