3 ms·
> Can you imagine how cool it would be to manipulate Windows services from the WSL session? This was a little confusing, in some ways, because it came right af
by mdip 6y ago
> Can you imagine how cool it would be to manipulate Windows services from the WSL session?
This was a little confusing, in some ways, because it came right after "being able to list out processes to kill". A Windows Service is a lot like a `systemd` service.
In the scenario he envisions where you could see windows processes within WSL[0], it'd be possible to write a script that could invoke the windows-equivalent command to stop/start services and print `systemd`[1]/Windows services side-by-side, but you couldn't make Windows services "work" with `systemd` tools. Somewhat obvious, probably, but it caused me to raise an eyebrow for a second so I thought I'd mention it.
[0] Was it this way in WSL1? I don't remember, it's been too long.
[1] Last time I used WSL2, I ran openSuSE Leap; not sure what the default ships with.
- shawnz 6y agoIn WSL1, you can't see windows processes in 'ps' or '/proc/[pid]' as if they were linux processes, but you could just execute the Windows tasklist.exe/taskkill.exe binary instead and parse the stdout. Actually, you could do the same with WSL2 also.