问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
