Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Nov 12, 2014 4:43 pm 
Offline
Senior Member

Joined: Fri May 02, 2014 5:20 pm
Posts: 58
Website: http://www.sturmkrieg.ru
Location: Richmond
https://github.com/KrasnayaSecurity/DomainBlocker

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.


Top
   
PostPosted: Fri Nov 14, 2014 12:23 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Until recently, the approach would be to write an init script and install it as part of application installation. Of course not all distros are LSB compliant so custom futzing may be necessary.

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 for those.

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.


Top
   
PostPosted: Fri Nov 14, 2014 1:13 am 
Offline
Junior Member

Joined: Wed Nov 18, 2009 12:27 am
Posts: 28
I create a script like /etc/init.d/myscript.sh then run:

update-rc.d myscript.sh defaults


Top
   
PostPosted: Sat Nov 15, 2014 3:05 am 
Offline
Senior Member

Joined: Fri May 02, 2014 5:20 pm
Posts: 58
Website: http://www.sturmkrieg.ru
Location: Richmond
Thank you for your help.

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?


Top
   
PostPosted: Sat Nov 15, 2014 1:44 pm 
Offline
Junior Member

Joined: Wed Nov 18, 2009 12:27 am
Posts: 28
I typed this into Google "ubuntu 14.04 updaterc.d" and the second link seems to do what you want in the latter case:

http://mobiarch.wordpress.com/2014/05/1 ... ntu-14-04/


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group