How to start a program at boot with sudo/root

Normally, the command is executed from an /etc/rc.local file, if my memory serves. Such a file doesn’t exist. Can I create the file and put the command in it?

Think systemd is the way to go here. This Q&A will help

Thanks. I’m completely unfamiliar with this method, so I’ll be reading your link carefully.

For reference’s sake, I’m using TwonkyServer as a media server.

I finally got around to trying this. It works, but I have to look for a different solution. The media to be shared is on a drive attached to the router. The service starts before the network connection is made, so Twonky starts with an empty database. At least, that’s my guess as to what is happening. If I start Twonky manually, after everything else has happened, it simply verifies an already filled database.

You probably just need to add some network requirement to your .service file, e.g.


I agree that systemd is somewhat mystifying, but it seems to be here to stay.

Yeah, I saw that as I did further reading into this. I’ll try it again at another time; for the time being, it isn’t that much of an effort to start the service myself once I note that the network share mounted.