# ddclient using interface

## ufayzull

i'm posting this to see if other people have the same issue with ddclient and if the solution i used is good. i could not get /etc/init.d/ddclient to work properly. it worked when i ran it as root, but never from the init.d, it just silently didn't update my ip. so to find out what is going on i changed ddclient line in passwd to be able to su into it and run the command manually with my config options i chose:

```

# su ddclient

$ /usr/sbin/ddclient -daemon=0  -use=if -if=ppp0 -verbose

sh: line 1:  6422 Segmentation fault      ifconfig ppp0 2> /dev/null

WARNING:  unable to determine IP address

```

so it seems like something wrong at the ifconfig line. still as ddclient user:

```

$ /sbin/ifconfig

Warning: cannot open /proc/net/dev (No such file or directory). Limited output.

$ ls -l /proc/net/*

ls: cannot access /proc/net/*: No such file or directory

```

now, as root:

```

 # ls -l /proc/net/dev

-r--r--r-- 1 root wheel 0 Oct  1 19:15 /proc/net/dev

```

so it seems like group 'wheel' has access to it. i added ddclient to wheel (is it a good thing to do?). after that it seems to work fine using ddclient:

```

$ /usr/sbin/ddclient -daemon=0 -use=if -if=ppp0 -verbose

INFO:     setting IP address to .............

```

no segmentation faults. is this a bug, and if it is, is it an ebuild bug or ddclient bug?

----------

## geki

well, as soon as ddclient has access to the resources it needs, it runs.

so, ddclient should be added to some group via ebuild, to have access.

=> ebuild bug

----------

## PaulBredbury

 *ufayzull wrote:*   

> $ ls -l /proc/net/*
> 
> ls: cannot access /proc/net/*: No such file or directory

 

Your /proc/net setup sounds bad. Does "ifconfig ppp0" work as a normal user? Because it should.

If you're seeing "Segmentation fault", it's not clear what's segfaulting. ddclient is perl code, so if your perl is segfaulting, that's another issue with your config.

ddclient should certainly *not* be in the wheel group.

----------

## ufayzull

PaulBredbury,

seems like ifconfig is segfaulting. if i run ifconfig ppp0 with non root/wheel account it doesn't work:

```

 $ /sbin/ifconfig ppp0

Warning: cannot open /proc/net/dev (No such file or directory). Limited output.

Segmentation fault

```

and adding the user to wheel fixes it, because /proc/net/dev is owned by root/wheel:

```

-r--r--r-- 1 root wheel 0 Oct  1 19:15 /proc/net/dev

```

if you think my /proc/net is not setup correctly and if you have suggestions please let me know.

thanks!

----------

## PaulBredbury

 *ufayzull wrote:*   

> and adding the user to wheel fixes it, because /proc/net/dev is owned by root/wheel:
> 
> ```
> 
> -r--r--r-- 1 root wheel 0 Oct  1 19:15 /proc/net/dev
> ...

 

That doesn't make any sense. Whether root, wheel or *other*, the permissions are still just "r" = read-only.

So your system is messed up elsewhere. Dunno where.

----------

## ufayzull

PaulBredbury,

i see your point. seems like something is messed up with my system. /proc filesystem is a web of symlinks and when i get to /proc/self/net if the user in wheel or root i can list the directory:

```

/proc/self/net $ ls

arp                  mcfilter             protocols  softnet_stat

...

```

if the user is not in wheel nor root, /proc/self/net either points to something else or some permissions get messed up, it can't list anything:

```

/proc/self/net $ ls

ls: reading directory .: Invalid argument

```

i'm not sure what i should do from this point as i'm not a /proc expert. it is a fresh install i'll see if "emerge -DNu world" fixes anything   :Very Happy: 

thanks!

----------

## ufayzull

btw, it's a 'hardened' profile. i wonder if 'hardened' puts extra security on /proc....

----------

