Author Topic: ddclient autostart? [SOLVED]  (Read 908 times)

Offline shimonl

  • Full Member
  • ***
  • Posts: 155
ddclient autostart? [SOLVED]
« on: September 12, 2012, 09:16:11 AM »
Hi,
I have successfully set up a ddclient.conf file, and when I ran
# ddclient
it started the daemon, and updated my free dns name.

How can I get this command to run automatically (as root) every time I start up my system?

Thanks,
Shimon
« Last Edit: September 20, 2012, 10:18:40 AM by shimonl »

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4001
Re: ddclient autostart?
« Reply #1 on: September 12, 2012, 02:12:13 PM »
Open PCC -> System -> Services and tick the Start on Boot box.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline shimonl

  • Full Member
  • ***
  • Posts: 155
Re: ddclient autostart?
« Reply #2 on: September 13, 2012, 09:56:57 AM »
First, thank you for calling my attention to the Control Center. I didn't realize that the ddclient would be listed there.

However, when I use the services app to start the ddclient service, it does not have the desired effect.
I checked like this:
a) I went to the web interface to my dynamic dns service, and set a fictitious IP address for my domain name
b) in system>services I started the daemon (with a 30 second wait time between checks)
c) I waited an hour or two
d) I checked the value of my domain name - it was still the fictitious value.
e) I did: ps aux | grep ddclient
    and saw that the daemon is active, and waiting X seconds for each loop

Any idea what is wrong?

Thanks,
Shimon

Offline yodelu

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 317
Re: ddclient autostart?
« Reply #3 on: September 14, 2012, 03:05:08 PM »
...when I use the services app to start the ddclient service, it does not have the desired effect.
..... and waiting X seconds for each loop


try to (auto)start ddclient not as a service - maybe the runlevel for ddclient service is ON before the network
so you could try one of these:
- put your command (ddclient) at the end of /etc/rc.d/rc.local file  
- systemsettings >System Administration > Startup and Shutdown>Add  Program


hope it helps..
« Last Edit: September 14, 2012, 03:14:06 PM by yodelu »

Offline nixer

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 589
Re: ddclient autostart?
« Reply #4 on: September 15, 2012, 08:09:42 AM »
I may be totally wrong here, but in the interest of helping, I will give this a try.  You wrote:

Quote
I went to the web interface to my dynamic dns service, and set a fictitious IP address for my domain name
.....
Any idea what is wrong?



I don't think that this is the way that ddclient is setup to work in a default configuration after installed from synaptic.  It is my understanding that ddclient will read the previous ip address information from a file located here - /var/cache/ddclient/

When it runs, it will first determine what the ip address is and then it will compare it with what is in the file located above.  If it has changed, then it will connect to the DDNS provider and notify them of the change.  Therefore, when it runs it does not contact the DDNS provider unless there is a change.  Now, it may do a lookup on the DDNS providers ip lookup page (example), but determining the ip address is a separate function of updating the dns.  Therefore, if you expected it to notice an ip change by entering a fictitious info on the DDNS web interface, I don't think that will work.  It might be better to change the ip address information in the cache file and give it a try that way.

I recently installed ddclient and have it running.  I tried to start it from a root prompt with "service ddclient restart" and it showed as started.  However, it did not do an initial update.  It didn't really start updating until I had manually started the service and running "ddclient" from a terminal prompt.  Once I ran, from a terminal, "ddclient", it did a successful initial update and it has been running fine since, although it has only done one ip update since then.  What is important here is that the one ipdate that was done, was successfully done after a change in internet service provider.  The machine was not rebooted, but once plugged in, it just updated successfully. 

I think that if ddclient has successfully updated and is currently running, then it will work fine.  Mine starts automatically at boot.

I hope this helps.
Desktop:  AMD 3.6ghz X4, Gigabyte MB, 8GB ram, Multiple PCLOS's, 2.6.38.8-pclos3.pae.bfs
Server: Intel 3.4ghz X2, 4GB RAM, SATA, gnome2, *.pae.bfs, Headless, Servers: LAMP, FTP, Samba, Print, PXE, BT
HTPC: Phenom II X4 2.8ghz, 4GB Ram, 1TB SATA, PCLinuxOS-KDE, NVIDIA N220GT HDMI, *.pae.bfs

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4001
Re: ddclient autostart?
« Reply #5 on: September 15, 2012, 12:14:46 PM »
Be very careful when testing ddclient or any dynamic DNS client. Some providers will ban you if you attempt to change an address unnecessarily, and fooling the program into sending an update to test it will be treated as abuse.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline shimonl

  • Full Member
  • ***
  • Posts: 155
Re: ddclient autostart? [SOLVED]
« Reply #6 on: September 20, 2012, 10:17:52 AM »
Hi again,
I have been away for a few days, because of the Jewish New Year,
but I appreciate the comments that were added.

I had not known about that cache file, apparently it keeps all versions
of its config in the cache too. So I stopped ddclient, removed the old cache file,
and just restarted the system service.

Voila! It worked just fine, and updated the dns name as it should.
So, thank you everyone, the problem seems to be solved.