firewalld를 실행하기 위해 systemctl start firewalld 명령어를 쳤더니, 다음과 같은 에러 메세지가 떴다.
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
근본적인 발생 원인은 wsl에서 Systemd를 사용하지 않기 때문이라고 한다.
이럴 땐 스크립트 파일을 이용하여 실행하면 된다.
해당 파일은 다음 명령어로 확인 가능하다.
$ ls /etc/init.d/
확인해보면 아래처럼 존재하는 스크립트 파일 목록이 뜨는데, 실행하고 싶은 스크립트 파일명을 확인할 수 있다.
나는 firewalld를 실행하고 싶었기에 아래와 같이 쳤다.
그랬더니 친절하게 사용법까지 알려준다.
$ /etc/init.d/firewalld
Usage: /etc/init.d/firewalld {start|stop|restart|force-reload|reload|status}
결론적으로는 다음 명령어로 실행할 수 있었다.
$ /etc/init.d/firewalld start
참고 링크
System has not been booted with systemd as init system (PID 1). Can't operate
위의 방법이 아닌 다른 방법도 나와 있으니 참고하면 좋다.