Hacker News new | ask | show | jobs
by oflebbe 858 days ago
Next: systemd for windows?
2 comments

Already there. Windows has had services for a long time managed pretty similarly to systemd/launchd.
Well, compare how to start syncthing automatically on Windows: https://docs.syncthing.net/users/autostart.html

On Debian I could just type:

systemctl --user enable --now syncthing.service

Native systemd on Windows would be awesome. Microsoft should hire the creator of systemd...

Looking at that page, it looks like syncthing chooses to not provide a Windows service. That is where 100% of the complexity is coming from. If they did provide a Windows service, then it would be as simple as opening the service manager, and setting the startup type from "manual" to "automatic".

It's not fair to blame Windows for the developers of an app not using its features. Similarly, if syncthing didn't bother to create a unit file on Linux, your example would no longer be a simple one liner. That wouldn't be systemd's fault though.

There's sc[1] on Windows for this, though many services can do it themselves, eg

    myservice.exe /install
Of course, the application must support the service interface[2] to do this, which is like providing the .service file for systemd.

The key difference is that it's built into the application[3] in Windows, not external like with systemd, which has pros and cons.

[1]: https://learn.microsoft.com/en-us/windows-server/administrat...

[2]: https://learn.microsoft.com/en-us/windows/win32/services/ser...

[3]: https://learn.microsoft.com/en-us/windows/win32/services/ser...

The manual GUI steps could be replaced with single command line on windows too.

https://learn.microsoft.com/en-us/windows-server/administrat...

Powershell exists.
Coincidentally, Lennart works at MS. I don't know what he works on there though.