DEV Community

Discussion on: WSL Tips: Starting Linux Background Services on Windows Login

Collapse
 
longlivechief profile image
Brian Vanderbusch

So, I started with your suggestion, but quickly realized most services are already scripts in /etc/init.d, and you usually manage these things with users. For example, for docker, I created a /etc/sudoers.d/docker.sudoers file, with the following:

%docker ALL=(root) NOPASSWD: /etc/init.d/docker start stop restart status
Enter fullscreen mode Exit fullscreen mode

I think I'm also going to see if I can get a feature request endoresed for a [autostart] config section for the /etc/wsl.conf file where you could just list services to autostart like so:

[autostart]
docker = true
postgresqsl = true
Enter fullscreen mode Exit fullscreen mode