# ddclient not starting as a service [SOLVED]

## don quixada

I'm trying to start ddclient as a service, but it doesn't want to work. Here is the output:

```
# /etc/init.d/ddclient start

 * Caching service dependencies ...                                       [ ok ]

 * Starting ddclient ...

WARNING:  file /etc/ddclient/ddclient.conf: Cannot open file '/etc/ddclient/ddclient.conf'. (Permission denied)

stat() on closed filehandle FD at /usr/sbin/ddclient line 879.

Use of uninitialized value in bitwise and (&) at /usr/sbin/ddclient line 880.

readline() on closed filehandle FD at /usr/sbin/ddclient line 886.

WARNING:  file /etc/ddclient/ddclient.conf: Cannot open file '/etc/ddclient/ddclient.conf'. (Permission denied)

stat() on closed filehandle FD at /usr/sbin/ddclient line 879.

Use of uninitialized value in bitwise and (&) at /usr/sbin/ddclient line 880.

readline() on closed filehandle FD at /usr/sbin/ddclient line 886.

WARNING:  file /var/cache/ddclient/ddclient.cache: Cannot open file '/var/cache/ddclient/ddclient.cache'. (Permission denied)

stat() on closed filehandle FD at /usr/sbin/ddclient line 879.

Use of uninitialized value in bitwise and (&) at /usr/sbin/ddclient line 880.

readline() on closed filehandle FD at /usr/sbin/ddclient line 886.

WARNING:  unable to determine IP address                                  [ !! ]

```

The trouble is, it works fine when I run 'ddclient' from the command line.

I found a thread here, but after changing the permissions etc. it didn't help.

I'm not sure what is causing the problem, anybody else with this problem? Thanks.

dqLast edited by don quixada on Tue Dec 18, 2007 3:21 am; edited 1 time in total

----------

## PaulBredbury

 *don quixada wrote:*   

> (Permission denied)

 

Well, that's a blatant clue that your permissions are screwed up.

root is not the same user as the ddclient user. Which is why it works when run as the root user.

The easiest thing to suggest is to delete the ddclient-specific dirs, and let the ebuild recreate them with the correct permissions.

```
rm -r /etc/ddclient /var/cache/ddclient
```

----------

## don quixada

Weird, I followed the instructions diligently while changing the permissions the first time 'round. Maybe I spelled 'ddclient' wrong ;)

Anyway, it works now. thanks.

----------

## tuam

I'd like to add that it screwed itself   :Wink: 

```
Subject: [portage] ebuild log for net-dns/ddclient-3.7.3-r1 on <snip>

Date: Mon, 10 Dec 2007 21:56:58 +0100

INFO: setup

Adding group 'ddclient' to your system ...

 - Groupid: next available

Adding user 'ddclient' to your system ...

 - Userid: 104

 - Shell: /sbin/nologin

 - Home: /dev/null

 - Groups: ddclient

...
```

FF,

Daniel

----------

## PaulBredbury

Eh? How? It's supposed to have its own group. It's called "security".

Although, I wouldn't be surprised if Portage or a dev screwed it up since I last used Gentoo </trolling>

----------

## tuam

From the ebuilds, the user was introduced with 3.6.6. However, this seems to be the first time an unmasked version hits us:

```
# equery l -p ddclient

[ Searching for package 'ddclient' in all categories among: ]

 * installed packages

[I--] [  ] net-dns/ddclient-3.7.3-r1 (0)

 * Portage tree (/usr/portage)

[-P-] [  ] net-dns/ddclient-3.6.3 (0)

[-P-] [M~] net-dns/ddclient-3.6.6 (0)

[-P-] [M~] net-dns/ddclient-3.7.0 (0)

[-P-] [M~] net-dns/ddclient-3.7.2 (0)

[-P-] [M~] net-dns/ddclient-3.7.2-r1 (0)

[-P-] [M~] net-dns/ddclient-3.7.3 (0)

# genlop ddclient

 * net-dns/ddclient

     Sat Mar  3 11:07:34 2007 >>> net-dns/ddclient-3.6.3

     Mon Dec 10 21:56:59 2007 >>> net-dns/ddclient-3.7.3-r1
```

FF,

Daniel

----------

## PaulBredbury

I can see from the ebuild:

```
chown ${PN}:${PN} /var/{cache,run}/${PN}
```

That chown should include /etc/ddclient, /etc/ddclient/ddclient.conf and /var/cache/ddclient/ddclient.cache - file a bug report.

Edit: Probably also /var/run/ddclient/ddclient.whateverthefilenameis

----------

