Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2795

How to start a specific service when Ubuntu is started on WSL2

$
0
0

I need to run sudo service postgresql start every time when I start Ubuntu on WSL2.

How can I make the service start automatically when I start Ubuntu?

WSL doesn't use systemd, so sudo systemctl enable postgresql doesn't work.

$ sudo systemctl status postgresqlSystem has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

Is there a standard way to start a service at startup?

Edit

I want to start the service on Ubuntu startup, not on Windows startup.


Viewing all articles
Browse latest Browse all 2795

Trending Articles