Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dnsmasq openrc config
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 261
Location: Milan, IT

PostPosted: Fri Jul 01, 2016 8:48 am    Post subject: [SOLVED] dnsmasq openrc config Reply with quote

Hi guys
I'm trying to configure dnsmasq as openrc service, but I'm unable to make it work properly

First of all, my needings: I have a work laptop I use on different lans and I want to deal with DNS configurations without having to manually change resolv.conf and /etc/hosts files

I figured out to use dnsmasq, applying a different configuration for each lan (using the --conf-file option)

I've symlinked the init script
Code:
/etc/init.d/dnsmasq.customer -> /etc/init.d/dnsmasq
and created a configuration file in conf.d
Code:
/etc/conf.d/dnsmasq.customer
which is a copy of /etc/conf.d/dnsmasq edited:
Code:
# /etc/conf.d/dnsmasq: config file for /etc/init.d/dnsmasq

# See the dnsmasq(8) man page for possible options to put here.
DNSMASQ_OPTS="--conf-file=/home/kikko/Documents/customerX/dnsmasq.conf"


But when starting dnsmasq.customer using rc-service, the daemon starts only with the default arguments from /etc/conf.d/dnsmasq
Code:
~# ps -C dnsmasq -f
UID        PID  PPID  C STIME TTY          TIME CMD
dnsmasq   7052     1  0 10:46 ?        00:00:00 /usr/sbin/dnsmasq -x /var/run/dnsmasq.pid --user=dnsmasq --group=dnsmasq

Any idea of what I'm doing wrong?

Thank you in advance
_________________
Regards

root is the root of all evil


Last edited by kikko on Mon Jul 04, 2016 4:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1369
Location: Montréal

PostPosted: Fri Jul 01, 2016 1:10 pm    Post subject: Reply with quote

I think rc-service only switch to dnsmasq script when you do
Code:
rc-service dnsmasq.customer start

I would try
Code:
cp /etc/init.d/dnsmasq /etc/init.d/dnsmasq.customer

Than I would edit /etc/init.d/dnsmasq.customer to be sure it source to /etc/conf.d/dnsmasq.customer and not /etc/conf.d/dnsmasq. After this, I would try
Code:
rc-service dnsmasq.customer start

_________________
Paul
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Fri Jul 01, 2016 1:40 pm    Post subject: Reply with quote

kikko ...

openrc will expect 'customer' to correspond to a runlevel, the syntax is {service}.{interface}.{runlevel} ... or {service}.{runlevel}. See here for an example.

best ... khay
Back to top
View user's profile Send private message
kikko
Apprentice
Apprentice


Joined: 29 Apr 2014
Posts: 261
Location: Milan, IT

PostPosted: Mon Jul 04, 2016 4:07 pm    Post subject: Reply with quote

Hi guys, thank you for your answers...

I've managed to make it to work, renaming the link (and the conf.d file) in dnsmasq_customer did the trick
_________________
Regards

root is the root of all evil
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum