# ntpd issues

## dashnu

I did an update today as part of my daily grind.. and after an update I regenworld, --depclean, and revdep-rebuild...

Today in my depclean it wanted to remove swig & libcap. So I tested this on my systems box then did a revdep-rebuild and it wanted to build ntp again. This went through fine. Now however ntpd wont run.. 

So I tried to re-emerge libcap and swig then ntp and it still wont start.

Not sure why this is. I have the same exact setup on 5 other boxes. All want to remove swig & libcap (ya i know depclean is not stable, but I never ran into a problem with it until now) 

equery depends libcap displays ntp & pax-utils need it. 

I am not sure what I could have messed up that the steps I have already taken do not fix. Any ideas?

my log when i try to start..

```
May 30 11:32:59 frogger ntpd[8616]: ntpd 4.2.0a@1.1190-r Tue May 30 10:07:21 EDT 2006 (1)

May 30 11:32:59 frogger ntpd[8616]: precision = 1.000 usec

May 30 11:32:59 frogger ntpd[8616]: Listening on interface wildcard, 0.0.0.0#123

May 30 11:32:59 frogger ntpd[8616]: Listening on interface eth0, 192.168.1.221#123

May 30 11:32:59 frogger ntpd[8616]: Listening on interface lo, 127.0.0.1#123

May 30 11:32:59 frogger ntpd[8616]: kernel time sync status 0040
```

Looks ok however the daemon dies.

It will start as root so I found a few post on here about libcap & kernel 2.6 so I also tried those options in my kernel.. 

```
CONFIG_SECURITY=y

# CONFIG_SECURITY_NETWORK is not set

CONFIG_SECURITY_CAPABILITIES=m

# CONFIG_SECURITY_ROOTPLUG is not set

# CONFIG_SECURITY_SECLVL is not set

```

module is loaded...

```
lsmod

Module                  Size  Used by

capability              5768  0 

commoncap               7808  1 capability

```

Also I run a 2.6 on all my other machines and do not have this set and ntpd works fine. but again they all want to unmerge libcap and swig.

TIA

----------

## GetCool

I'm having pretty much the same problem, which seemed to occur after I recently updated to GCC 4.1.1 and recompiled my whole system.

I never removed libcap and swig (even though emerge --depclean wants to remove them), but nonetheless, ntpd won't start.  I've tried recompiling all of these packages, but ntpd always fails to start.

This definitely started happening after I did an "emerge -e world", so somethings going on.

By the way, I can't figure out any way to get ntpd to spit out verbose logging.  If you try to run it with the -d or -D options, it will tell you that ntp is not compiled with debug support.  There's also no option you can put into /etc/ntp.conf that will increase the amount of logging written to the log file (by default, all logging is enabled).

----------

## dashnu

hmmm this is the only machine I run gcc 3.4.6 on. I wonder if this could have happened when I did my emerge -e and I just failed to notice the issue until now. The rest of my servers are still running gcc 3.3.6.

I also fail to get any decent logging.

----------

## GetCool

It seems that others have had this problem when linuxcaps wasn't correctly configured.

Even though I've always run on a kernel with CONFIG_SECURITY=y and CONFIG_SECURITY_CAPABILITIES=y, I'm wondering if it has something to do with this.

I can't test anything until I have access to my machine later in the day.  If you want to try something, see if you can run ntpd as root (you may need to remerge it with the "nodroproot" USE flag).  You could also try unsetting CONFIG_SECURITY and CONFIG_SECURITY_CAPABILITIES, since leaving them unset is supposed to enable linuxcaps anyway.

----------

## dashnu

Yes I am able to run it as root as I said in my first post.

I just tried to set linuxcaps as a module and ntpd still failed.

I also tried to compile it into the kernel and it still fails.

Even tried to re-merge libcap and ntp each time..

I have no idea what is going on :p

**edit I also tried both unset..

----------

## GetCool

 *dashnu wrote:*   

> Yes I am able to run it as root as I said in my first post.

 

Sorry, I must have missed that.

 *Quote:*   

> I have no idea what is going on :p

 

I don't either; you've tried everything that I was going to.

I think we can safely say, though, that it has something to do with linuxcaps and dropping root privileges.  When I have a chance to test mine, I may unmerge everything related to ntp, delete the ntp user account, compile a fresh kernel and start over.  Of course, I don't really expect this to make a difference, but it's worth a shot

----------

## GetCool

An update:

I recompiled pax-utils and ntp with the USE flag "caps" enabled, and now ntpd starts successfully.

I never had to use this USE flag before, so I don't know what changed.  Also, I still don't understand why swig and libcap don't register as dependencies of anything, even with the caps USE flag turned on, since:

```
caps     Use linux capabilities library to control privileges.
```

You may want to try this and see if it works for you; I'd be curious to hear.

EDIT:  Here's why:

 *net-misc/ntp changelog wrote:*   

> 25 May 2006; Emanuele Giaquinta <exg@gentoo.org> ntp-4.2.0-r2.ebuild,
> 
> ntp-4.2.0.20040617-r3.ebuild, ntp-4.2.0.20050303-r1.ebuild,
> 
> ntp-4.2.0.20060224.ebuild:
> ...

 

----------

## dashnu

Same here, never use 'caps' flag

This fixed up my deps also.

I guess I should start reading the changelogs more  :Wink: 

Thanks working well now.

----------

## PennyroyalFrog

I was having the same problem with ntpd after emerge -e wolrd.  Using the "caps" use flag does fix the problem, however when i rebuilt my new kernel i, i built CONFIG_SECURITY_CAPABILITIES as a module and forgot i had to 

```
modprobe capability
```

.

Although i remembered to do this now, I had already built the option straight into the kernel and not as a module.  but both "y" and "m" work (as long as you modprobe capability)

----------

