0 Pluspunkte 0 Minuspunkte

Woher weiß ich welchen Init Prozess mein System nutzt? Mit dem Befehl ps aux komme ich nicht wirklich weiter.

$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2324  1504 ?        Sl   12:27   0:00 /init
root         4  0.0  0.0   2324     4 ?        Sl   12:27   0:00 plan9 --control-socket 5 --log-level 4 --server-fd 6 --
root         7  0.0  0.0   2324   108 ?        Ss   12:27   0:00 /init
root         8  0.0  0.0   2340   108 ?        S    12:27   0:00 /init
manuel       9  0.0  0.0   7132  3748 pts/0    Ss   12:27   0:00 -bash
manuel     442  0.0  0.1  11004  4232 pts/0    R+   16:38   0:00 ps aux

Da steht zwar init aber welches System das genau ist weiß ich nicht.

$ ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 12:27 ?        00:00:00 /init
root         4     1  0 12:27 ?        00:00:00 plan9 --control-socket 5 --log-level 4 --server-fd 6 --pipe-fd 8 --log-truncate
root         7     1  0 12:27 ?        00:00:00 /init
root         8     7  0 12:27 ?        00:00:00 /init
manuel       9     8  0 12:27 pts/0    00:00:00 -bash
manuel     461     9  0 16:47 pts/0    00:00:00 ps -ef

$ ps -p 1
PID TTY TIME CMD
1 ? 00:00:00 init(kali-linux

$ ps -C init
PID TTY TIME CMD
4 ? 00:00:00 init 

$ systemctl list-unit-files | grep init
initrd-cleanup.service                 static   -
initrd-parse-etc.service               static   -
initrd-switch-root.service             static   -
initrd-udevadm-cleanup-db.service      static   -
systemd-initctl.service                static   -
systemd-pcrphase-initrd.service        static   -
systemd-pcrphase-sysinit.service       static   -
systemd-initctl.socket                 static   -
initrd-fs.target                       static   -
initrd-root-device.target              static   -
initrd-root-fs.target                  static   -
initrd-switch-root.target              static   -
initrd-usr-fs.target                   static   -
initrd.target                          static   -
sysinit.target                         static   -

$ ps ef
  PID TTY      STAT   TIME COMMAND
    9 pts/0    Ss     0:00 -bash HOSTTYPE=x86_64 LANG=en_US.UTF-8 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib
  474 pts/0    R+     0:00  \_ ps ef SHELL=/bin/bash WSL2_GUI_APPS_ENABLED=1 WSL_DISTRO_NAME=kali-linux LESS_TERMCAP_se=?[0m LESS_TERMCAP_so=?[01;33m NAME=DESKTOP-TQAA3IR PWD=/

von  
Kannst du vielleicht noch den Output von folgenden Befehlen zeigen?

ps ef
ps -p 1
ps -C init

Und die Befehle

systemctl list-unit-files | grep init
ps ef

1 Antwort

0 Pluspunkte 0 Minuspunkte
WSL hat keinen traditionellen Init-Prozess wie SysVinit oder systemd. Wenn du WSL startest, wird im Hintergrund ein Windows-Prozess namens "init" oder "init.exe" gestartet. Das ist der Elternprozess für alle Linux-Prozesse innerhalb von WSL.
von (716 Punkte)