LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-17-2007, 01:43 PM   #1
Ian_Hawdon
Member
 
Registered: Feb 2003
Location: Newcastle Upon Tyne
Distribution: Arch
Posts: 326

Rep: Reputation: 34
Unhappy ddclient hangs, can't kill


Hello, i use ddclient on my server to update a dynamic IP address. Sadly as my internet goes down often, ddclient is a vital part of my system.

ddclient can work for days updating my IP addresses with Dyndns.org and zoneedit.com

but sumtimes it just halts and wont update, even "killall ddclient" cant stop it

when i type "ps aux | grep ddclient" i get the following:

Code:
root   953  0.0  3.5  5652 4488 ?   S Apr16  0:17 ddclient - reading from members.dyndns.org port 80
The only way to get things working again is to log in via SSH and reboot.

Has anyone had this problem before, and if so, how can it be fixed?

I am using ddclient 3.7.1 and Slackware 10.2
 
Old 04-18-2007, 07:41 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Have you tried, logged in as root, kill -9 PID (which will kill anything, usually)?

I have ddclient running (Slackware 11.0), and have not experienced what you describe; my internet connection does go away every so often, but not too or for long. Just for drill, though, does your rc.ddclient look something like this:
Code:
#!/bin/sh
#
# /etc/rc.d/rc.ddclient
#
# Start/stop/restart the ddclient
#
# To make ddclient start automatically at boot, make this
# file executable:  chmod 755 /etc/rc.d/rc.ddclient
#

case "$1" in
   'start')
      /usr/sbin/ddclient ;;
   'stop')
      kill `cat /var/run/ddclient.pid` ;;
   'restart')
      kill `cat /var/run/ddclient.pid`
      /usr/sbin/ddclient ;;
   *)
      echo "usage $0 start|stop|restart" ;;
esac
Have you tried different configurations in ddclient.conf (who knows if that has anything to do with anything but...).
 
Old 04-18-2007, 12:42 PM   #3
Ian_Hawdon
Member
 
Registered: Feb 2003
Location: Newcastle Upon Tyne
Distribution: Arch
Posts: 326

Original Poster
Rep: Reputation: 34
ok:

Code:
root@server:/home/ian# kill -9 PID
bash: kill: PID: arguments must be process or job IDs
This is my custom made rc.ddclient file:


Code:
root@server:/etc/rc.d# vi rc.ddclient 
skipping 13 old session files
reading rc.ddclient

#!/bin/sh
#Start/stop/restart ddclient
#rc.ddclient by OP-EZY
#

ddclient_start() {
  if [ ! -r /etc/ddclient/ddclient.conf ]; then
    echo "/etc/ddclient.conf not found! Please, check configuration."
  fi
  if [ -r /etc/ddclient/ddclient.conf ]; then
    echo "Start ddclient..."
    /usr/sbin/ddclient
  fi
}

ddclient_stop() {
  killall ddclient
}

ddclient_restart() {
  ddclient_stop
  sleep 1
  ddclient_start
}

case "$1" in
'start')
  ddclient_start
  ;;
'stop')
  ddclient_stop
  ;;
'restart')
  ddclient_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
esac
~                                                                                     
~
Should i use the one posted above?
 
Old 04-18-2007, 01:06 PM   #4
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
instead 'killall ddclient' you could use this to be on the safe side.

kill -9 $(ps -A | grep ddclient | awk {'print $1'})
 
Old 04-18-2007, 02:11 PM   #5
Ian_Hawdon
Member
 
Registered: Feb 2003
Location: Newcastle Upon Tyne
Distribution: Arch
Posts: 326

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by almatic
instead 'killall ddclient' you could use this to be on the safe side.

kill -9 $(ps -A | grep ddclient | awk {'print $1'})
Don't know if this has anything to do with anything, but if i "killall ddclient" when things are working, then it kills no problem.


I had the same problem with ddclient 3.6.3 as well, should i post my ddclient.conf file here too (obv. without my passwords!)
 
Old 04-18-2007, 04:06 PM   #6
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Uh, "kill -9 PID" means the process identification number where
Code:
ps -A | grep ddclient | awk '{ print $1 }'
gives you that number (this is used in what's called a "sideways pipe" below).

All put together,
Code:
kill -9 $(ps -A | grep ddclient | awk '{ print $1 }')
executes the sideways pipe before executing the kill -9 part.

Thing is, kill -9 is a "sure kill" is is preferable to "killall" or some other form.

Note that ddclient stores the PID in a file (see the rc.ddclient provided above) so that the kill just reads the PID from the file in the sideways pipe (it's kill `cat /var/run/ddclient.pid` above).

The important thing is to have the PID available to kill the process; note that if you double start ddclient, you'll have more than one PID to kill...
 
Old 04-19-2007, 04:50 PM   #7
Ian_Hawdon
Member
 
Registered: Feb 2003
Location: Newcastle Upon Tyne
Distribution: Arch
Posts: 326

Original Poster
Rep: Reputation: 34
ok, the "kill -9 $(ps -A | grep ddclient | awk '{ print $1 }')" command worked a treat, but is there any way to stop it hanging there in the first place?

here is my ddclient.conf file (without passwords!)

Code:
######################################################################
##
## $Id: sample-etc_ddclient.conf 2 2006-05-22 19:37:19Z wimpunk $
##
## Define default global variables with lines like:
##      var=value [, var=value]*
## These values will be used for each following host unless overridden
## with a local variable definition.
##
## Define local variables for one or more hosts with:
##      var=value [, var=value]* host.and.domain[,host2.and.domain...]
##
## Lines can be continued on the following line by ending the line
## with a \
##
##
## Warning: not all supported routers or dynamic DNS services
##          are mentioned here.
##
######################################################################
daemon=300                              # check every 300 seconds
syslog=yes                              # log update msgs to syslog
mail=root                               # mail all msgs to root
mail-failure=root                       # mail failed update msgs to root
pid=/var/run/ddclient.pid               # record PID in file.
#ssl=yes                                        # use ssl-support.  Works with
                                        # ssl-library
#
#use=watchguard-soho,        fw=192.168.111.1:80        # via Watchguard's SOHO
FW
#use=netopia-r910,           fw=192.168.111.1:80        # via Netopia R910 FW
#use=smc-barricade,          fw=192.168.123.254:80      # via SMC's Barricade FW
#use=netgear-rt3xx,          fw=192.168.0.1:80          # via Netgear's internet
 FW
#use=linksys-wrt854g,         fw=192.168.1.1:80         # via Linksys's internet
 FW
#use=maxgate-ugate3x00,      fw=192.168.0.1:80          # via MaxGate's UGATE-3x
00  FW
#use=elsa-lancom-dsl10,      fw=10.0.0.254:80           # via ELSA LanCom DSL/10
 DSL Router
#use=elsa-lancom-dsl10-ch01, fw=10.0.0.254:80           # via ELSA LanCom DSL/10
 DSL Router
#use=elsa-lancom-dsl10-ch02, fw=10.0.0.254:80           # via ELSA LanCom DSL/10
 DSL Router
#use=alcatel-stp,            fw=10.0.0.138:80           # via Alcatel Speed Touc
h Pro
#use=xsense-aero,            fw=192.168.1.1:80          # via Xsense Aero Router
#use=allnet-1298,            fw=192.168.1.1:80          # via AllNet 1298 DSL Ro
uter
#use=3com-oc-remote812,      fw=192.168.0.254:80        # via 3com OfficeConnect
 Remote 812
#use=e-tech,                 fw=192.168.1.1:80          # via E-tech Router
#use=cayman-3220h,           fw=192.168.0.1:1080        # via Cayman 3220-H DSL
Router
#
fw-login=*****,             fw-password=********                # FW login and p
assword
#
## To obtain an IP address from FW status page (using fw-login, fw-password)
use=fw, fw=192.168.1.1/Status_Router.asp, fw-skip='IP Address:' # found after IP
 Address
#
## To obtain an IP address from Web status page (using the proxy if defined)
#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Addres
s
#
#use=ip,                     ip=127.0.0.1       # via static IP's
#use=if,                     if=eth0            # via interfaces
#use=web                                        # via web
#
#protocol=dyndns2                               # default protocol
#proxy=fasthttp.sympatico.ca:80                 # default proxy
#server=members.dyndns.org                      # default server
#server=members.dyndns.org:8245                 # default server (bypassing prox
ies)

login=*****                                     # default login
password=********                               # default password
#mx=mx.for.your.host                            # default MX
backupmx=no                             # host is primary MX?
wildcard=no                             # add wildcard CNAME?

##
## dyndns.org dynamic addresses
##
## (supports variables: wildcard,mx,backupmx)
##
server=members.dyndns.org,              \
protocol=dyndns2                        \
<-------MY DOMAINS------->

##
## dyndns.org static addresses
##
## (supports variables: wildcard,mx,backupmx)
##
# static=yes,                           \
# server=members.dyndns.org,            \
# protocol=dyndns2                      \
# your-static-host.dyndns.org

##
##
## dyndns.org custom addresses
##
## (supports variables: wildcard,mx,backupmx)
##
# custom=yes,                           \
# server=members.dyndns.org,            \
# protocol=dyndns2                      \
# your-domain.top-level,your-other-domain.top-level

##
## ZoneEdit (zoneedit.com)
##
server=www.zoneedit.com,                \
protocol=zoneedit1,                     \
login=*********,                          \
password=********                       \
<-------MY DOMAINS------->

##
## EasyDNS (easydns.com)
##
# server=members.easydns.com,           \
# protocol=easydns,                     \
# login=your-easydns-login,             \
# password=your-easydns-password        \
# your.any.domain,your-2nd.any.domain

##
## Hammernode (hn.org) dynamic addresses
##
# server=dup.hn.org,                    \
# protocol=hammernode1,                 \
# login=your-hn-login,                  \
# password=your-hn-password             \
# your-hn-host.hn.org,your-2nd-hn-host.hn.org

##
## dslreports.com dynamic-host monitoring
##
# server=members.dslreports.com         \
# protocol=dslreports1,                 \
# login=dslreports-login,               \
# password=dslreports-password          \
# dslreports-unique-id

##
## OrgDNS.org account-configuration
##
# use=web, web=members.orgdns.org/nic/ip
# server=www.orgdns.org                 \
# protocol=dyndns2                      \
# login=yourLoginName                   \
# password=yourPassword                 \
# yourSubdomain.orgdns.org

##
## dnspark.com
## (supports variables: mx, mxpri)
##
# use=web, web=ipdetect.dnspark.com, web-skip='Current Address:'
# protocol=dnspark,                     \
# server=www.dnspark.com,               \
# your-host.dnspark.com

##
## NameCheap (namecheap.com)
##
# protocol=namecheap,                           \
# server=dynamicdns.park-your-domain.com,       \
# login=my-namecheap.com-login,                 \
# password=my-namecheap.com-password            \
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ddclient hirts123 Slackware 1 08-31-2005 04:29 AM
ddclient socks Linux - Software 5 10-17-2004 02:36 AM
ddclient problem Samuelnice Linux - Networking 0 07-22-2004 11:50 AM
ddclient doralsoral Linux - Software 3 04-19-2004 09:14 AM
I need help with 'ddclient' hecresper *BSD 3 05-06-2003 05:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration