Best practise to run rust based application run on dietpi

As in past I have installed vaultwarden on my dietpi raspberry pi. so this process install rust & cargo type of software on my machine. now i start exploring rust based applications. today i just install rumqttd rust application alternate to mqtt broker. so now i want to know what is the best practice to run rustbase application on my dietpi machine. if i am ssh to my machine with root user, i want to run rumqttd --config rumqttd.toml command in “/mnt/dietpi_userdata/rumqttd/” folder. if i give command root@rpi:/mnt/dietpi_userdata/rumqttd# which rumqttd /root/.cargo/bin/rumqttd so i guess my command must be like /root/.cargo/bin/rumqttd --config /mnt/dietpi_userdata/rumqttd/rumqttd.toml . also as i want to run this command like demon so that this command will start automatically whenever raspberry reboot. is it possible i can make something like arrangement to make this as service & control like systemctl unmask rumqqtd.service systemctl restart rumqttd.service systemctl status rumqttd.service

If I’m not mistaken, rust is needed to compile application only. It is not necessarily need to run the compiled binary at the end. And yes, you would need to use /root/.cargo/bin/rumqttd if the executable is located there. Probably can be copied to another place.

You will need to create a systemd service if you like to use systemctl start/stop/status.