Estou no WSL2 (Windows Subsystem for Linux, v2) e obtive o CentOS 8 WSL em:
https://github.com/yuk7/CentWSL
E o Ubuntu 20 WSL baixado da Windows Store também não está systemd
ativado.
Consegui rodar normalmente, porém systemd
não está rodando, embora exista no sistema de arquivos:
$ cat /etc/*-release | grep NAME
NAME="CentOS Linux"
PRETTY_NAME="CentOS Linux 8 (Core)"
CPE_NAME="cpe:/o:centos:centos:8"
$ stat /lib/systemd/systemd
File: /lib/systemd/systemd
Size: 2523648 Blocks: 4936 IO Block: 4096 regular file
Device: 2h/2d Inode: 1407374884100769 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2020-05-31 13:17:53.497597100 +0700
Modify: 2020-04-10 04:52:32.000000000 +0700
Change: 2020-05-30 12:06:52.791586300 +0700
Birth: -
$ systemctl
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
/sbin/init
já é um link simbólico para systemd
:
$ stat /sbin/init
File: /sbin/init -> ../lib/systemd/systemd
Size: 22 Blocks: 0 IO Block: 4096 symbolic link
Device: 2h/2d Inode: 2251799814381086 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2020-04-10 04:52:20.000000000 +0700
Modify: 2020-04-10 04:52:20.000000000 +0700
Change: 2020-05-30 12:06:53.461589000 +0700
Birth: -
Encontrei 2 arquivos init:
/init
/sbin/init --> /lib/systemd/systemd
Possivelmente o kernel Linux WSL2 carrega /init
em vez de /sbin/init
?
Como habilitar systemd
nesta distro, para rodar daemons como sshd, nginx, etc.? Precisa tocar /sbin/init
ou esse tipo de arquivo?