I have a really noob question. Does anybody know a Rust library that allows you to create a service and launch it with systemd?
I'm tempted to create a script that creates a
.service file, puts it in
/etc/systemd/system and launches it with
std::process using the command
systemctl. This might work but I'm looking for a more scalable and robust solution.
Thanks for your help
https://lib.rs/cargo-deb supports packaging systemd services:
Thanks for your answer @kornel , but I'm not looking to package a Rust program. I'd rather like my Rust code to build and enable a services for other programs or dockers.
Making a service is just a question of writing a short configuration file that describes how to call your executable.