Re: [Ddclient-support] 'Run as' ddclient and Multiple Interfaces
Brought to you by:
supersandro2000,
wimpunk
From: <ca...@qu...> - 2016-11-24 17:11:28
|
Thanks. On 11/23/2016 11:02 PM, wimpunk wrote: > Hi, > > On 24/11/16 06:03, ca...@qu... wrote: >> Maybe I'm wrong but I thought I'd read somewhere that after the ddclient >> daemon starts, it's supposed to change from user root to ddclient. But >> it's not. And I'm not finding the code in the script to do that. Am I >> imagining things? > No, it doesn't change the owner. If you want ddclient to be started as > a different user, you have to start it manually as a different user. In > most cases this is done by using `su` in the init-script. Ok I've set it up in systemd like this and it works fine: /usr/local/lib/systemd/system/dynamic-dns.service [Unit] Description = spdyn.de dynamic DNS update service After = nss-lookup.target network.target dhcpcd.service [Service] Type = simple User = ddclient ExecStart = /usr/sbin/ddclient -foreground Restart = on-failure # Security PrivateTmp=yes InaccessibleDirectories=/boot /home/backups /home/sleeper /media /mnt /opt /root /srv /sys ReadOnlyDirectories=/bin /etc /lib /lib64 /sbin /usr/bin /usr/sbin CapabilityBoundingSet=~CAP_SYS_PTRACE NoNewPrivileges=yes [Install] WantedBy=multi-user.target >> Also I have ddclient set to get the IP off the interface, but depending >> on the phase of the moon, the humidity, and how much noise is in the >> room, the interface can come up variously as eth0, eth1, or eth2. >> (CentOS) Is there any way to specify multiple interfaces in the config >> file? > Unfortunately there is no possibility to let ddclient choose the > interface. You could for example try to find out the correct interface > and add it as a parameter on startup. This is my router in a Xen virtual machine, so it has to be automatic. How about if I make two stanzas like this? Will it error out, or fail gracefully, on the missing interface? use=if, if=eth0 protocol=dyndns2 server=update.spdyn.de login=dro...@pr... password=iTsasecret darkheart.spdns.org use=if, if=eth1 protocol=dyndns2 server=update.spdyn.de login=dro...@pr... password=iTsasecret darkheart.spdns.org I find that in RHEL renaming interfacen thus is not reliable. It does not react predictably. Did in Debian, but not RHEL, and this is coming to Debian. |