大网数据广告活动
服务器运维问答

Finding how a Linux system was booted

· 52CE 我爱测

I have a remote server, running Linux 5.19.0-41-generic x86_64, I am trying to find out how it was booted. Apparently, it does not use systemd : PID 1 process is bash. ps -p 1 -o comm= bash Apparently, there is no GRUB, at least …

问题原文

原帖链接 · 0x11111 · CC BY-SA 4.0

I have a remote server, running Linux 5.19.0-41-generic x86_64, I am trying to find out how it was booted.

Apparently, it does not use systemd :

PID 1 process is bash.

ps -p 1 -o comm=
bash

Apparently, there is no GRUB, at least there is none in /usr/sbin , and

grub-install --version
-bash: grub-install: command not found

I guess, GRUB was not used at startup.

It does not seem to be a virtual machine. I checked some files. It seems to be running on bare metal. But the configuration is minimal: top shows just a handful of processes and on ssh I am prompted to "unminimize", if I need fuller functionality.

I was inclined to think that SysV was used:

ls /etc/init.d
apport          bluetooth  hwclock.sh  network-manager  procps                       rsync  udev
avahi-daemon    dbus       iwpmd       nfs-common       pulseaudio-enable-autospawn  saned  unattended-upgrades
binfmt-support  gdm3       kmod        pppd-dns         rpcbind                      ssh    x11-common

But:

runlevel
unknown

and /etc/inittab does not exist.

Q1: how to diagnose with what the thing was booted.

Q2: how to reboot it? Ideally, using systemd.

sudo reboot
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Failed to talk to init daemon.
sudo init 6
Couldn't find an alternative telinit implementation to spawn.
sudo shutdown -r now
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Failed to talk to init daemon.

Thanks.

社区高分解答

原帖链接 · symcbean · CC BY-SA 4.0

PID 1 process is bash....there is no GRUB

Most likely a container.

It does not seem to be a virtual machine. I checked some files

But you're not going to tell us which ones. I do love a guessing game.

on ssh I am prompted to "unminimize", if I need fuller functionality

It's difficult to upgrade bare metal from software.

I was inclined to think that SysV was used

pid 1 on SysV is init.

You can check if you are running in a container by looking for 'lxc' or 'docker' in /proc/self/mountinfo

how to reboot it?

If shutdown -r is not working, speak to the people who built the host.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2023-08-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。