<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>68039</bug_id>
          
          <creation_ts>2004-10-18 11:14 0000</creation_ts>
          <short_desc>kadmind is not started correctly in heimdal-0.6.3-r1</short_desc>
          <delta_ts>2005-06-06 12:54:58 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jgonzalez.openinput@gmail.com</reporter>
          <assigned_to>kerberos@gentoo.org</assigned_to>
          <cc>anthony@ectrolinux.com</cc>
    
    <cc>Mark@JumpingBean.co.za</cc>

      

      
          <long_desc isprivate="0">
            <who>jgonzalez.openinput@gmail.com</who>
            <bug_when>2004-10-18 11:14:09 0000</bug_when>
            <thetext>kadmind is not started correctly from the init script in /etc/init.d/heimdal-kadmind. The init script reports the service has started correctly, but it seems kadmind just quits silently.

Reproducible: Always
Steps to Reproduce:
1. emerge heimdal
2. configure heimdal (this is the tricky part :o) )
3. /etc/init.d/heimdal-kadmind start
4. kadmin
5. list * (in kadmin prompt)

Actual Results:  
I got an error saying that the connection was refused:

commserver root # kadmin
tgetent: warning: termcap entry too long
kadmin&gt; list *
kadmin: connect(kerberos.example.com): Connection refused
kadmin: failed to contact kerberos.example.com
kadmin: kadm5_get_principals: Operation failed for unspecified reason
kadmin&gt;



Expected Results:  
The command should have connected to the kadmind daemon and retrieved the list
of Kerberos principals.

Versions and use flags:

commserver root # emerge -vp heimdal
These are the packages that I would merge, in order:
Calculating dependencies ...done!
[ebuild   R   ] app-crypt/heimdal-0.6.3-r1  +berkdb -ipv6 -krb4 +ldap +ssl  0 kB


Emerge info:

commserver root # emerge info
Portage 2.0.50-r11 (default-x86-2004.0, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.7)
=================================================================
System uname: 2.6.7 i686 Pentium III (Katmai)
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CFLAGS=&quot;-march=pentium3 -O3 -pipe -fomit-frame-pointer&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
COMPILER=&quot;&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O2 -mcpu=i686 -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoaddcvs ccache sandbox&quot;
GENTOO_MIRRORS=&quot;ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/
http://ftp.caliu.info/pub/gentoo/ http://gentoo.mirror.sdv.fr&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;apache2 apm avi berkdb bitmap-fonts cjk crypt cups doc encode f77
foomaticdb gdbm gif gpm imap imlib java jpeg kerberos ldap libg++ libwww mad
maildir mbox mikmod motif mpeg mysql ncurses nls oggvorbis opengl pam pdflib
perl png postgres python quicktime readline samba sasl sdl slang snmp spell ssl
svga tcpd tiff truetype x86 xml2 xmms xprint xv zlib&quot;

-------------------------------------------------------------------------------

I have done some tests, and the problem seems to be related to the --background
switch in start-stop-daemon. If you run /usr/sbin/kadmind standalone, or using
start-stop-daemon without the --background option, the daemon works as expected,
but the process doen&apos;t go to the background.
If you use the --background option, kadmind seems to exit without further notice
(I have searched the logs without success)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jgonzalez.openinput@gmail.com</who>
            <bug_when>2004-10-18 11:33:55 0000</bug_when>
            <thetext>start-stop-daemon --start --quiet --exec /usr/sbin/kadmind &amp;  seems to do the job... what&apos;s the difference between this and using --background?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Mark@JumpingBean.co.za</who>
            <bug_when>2004-12-19 07:06:20 0000</bug_when>
            <thetext>I have also found this problem. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>grundman@ifrance.com</who>
            <bug_when>2005-04-07 07:01:15 0000</bug_when>
            <thetext>I have two bugs in kadmind : 

1/
&quot;kadmind&quot; does not start

&quot;kadmind -d&quot; gives &quot;kadmind: socket af = 10: Address family not supported by protocol&quot;

The problem may be solved by changing a file lib/roken/mini_inetd.c.

The line 137 : 

hints.ai_family   = PF_UNSPEC;

may be replaced by :

#ifdef INET6
    hints.ai_family   = PF_UNSPEC;
#else
    hints.ai_family   = PF_INET;
#endif

2/ 

kadmind seems to work only when started from xinetd or with &quot;-d&quot; parameter.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>spookyghost@blueyonder.co.uk</who>
            <bug_when>2005-04-12 04:54:38 0000</bug_when>
            <thetext>I have worked around this problem by running kadmind from xinetd using this service definition.  The man page for start-stop says that using --background is a bad idea as any exit codes from the program it is starting cannot be caught and reported.

service kerberos-adm
{
        port            = 749
        socket_type     = stream
        wait            = no
        only_from       = localhost .dingwall.me.uk
        user            = root
        server          = /usr/sbin/kadmind
        log_on_failure += USERID
        disable         = no
}</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-06-06 12:50:30 0000</bug_when>
            <thetext>fixed in 0.6.4-r1 coming into portage in a few minutes.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-06-06 12:54:58 0000</bug_when>
            <thetext>*** Bug 85192 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
      
    </bug>

</bugzilla>