How would I make this program start up automatically?
Preferably using an installation shell script, or some easily automate-able feature, what would be the best way to make this program start up automatically on Linux?
I help run a private proxy server, and it would be useful to use this program instead of just relying on our private DNS server. BIND allows blocking of all subdomains though (DNS wildcard), but not hosts.
4 Replies
init scriptinstall it
Now with some distributions moving to systemd, this may not be the right way to do things for those distros (supposedly systemd will interpret an LSB init script, but in practice… seems tricky). You may be better off writing a service file
I don't have first-hand experience so can't provide guidance on the easiest way to approach things. My impression is this will be an ugly task no matter which path you take and all you can do is minimize the pain. But then I'm a pessimist.
update-rc.d myscript.sh defaults
Will it run as root? The program I am making blocks malicious domains in the hosts file. Is there a way to make it not run as root, in case I make a program that does not need to be root?