<?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>151375</bug_id>
          
          <creation_ts>2006-10-14 11:51 0000</creation_ts>
          <short_desc>net-firewall/ipsec-tools-0.6.5 racoon init script restart sometimes fails</short_desc>
          <delta_ts>2007-04-21 11:38:27 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>2006.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>dadok@kvados.cz</reporter>
          <assigned_to>latexer@gentoo.org</assigned_to>
          <cc>latexer@gentoo.org</cc>
    
    <cc>xenoterracide@gmail.com</cc>

      

      
          <long_desc isprivate="0">
            <who>dadok@kvados.cz</who>
            <bug_when>2006-10-14 11:51:39 0000</bug_when>
            <thetext>etc # /etc/init.d/racoon restart
 * Stopping racoon ...
 * Flushing policy entries ...
 * Loading ipsec policies from /etc/ipsec.conf.
 * Starting racoon ...
etc # /etc/init.d/racoon restart
 * Stopping racoon ...
/etc/init.d/racoon: line 50: kill: (9434) - No such process
 * Flushing policy entries ...
 * Loading ipsec policies from /etc/ipsec.conf.
 * Starting racoon ...

In first restart kill command is used for clean shutdown of racoon proces, but without waiting for it&apos;s end. Than in start section new racoon process is started and it complains about ports already used.

2006-10-14 20:40:33: ERROR: failed to bind to address x.x.x.x[500] (Address already in use).
2006-10-14 20:40:33: ERROR: no address could be bound.
2006-10-14 20:40:34: INFO: racoon shutdown

Probablly using start-stop-deamon may solve this.
PS. There is another bug #136970 with using kill in racoon init script</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2006-10-14 11:57:24 0000</bug_when>
            <thetext>So, does the init script in Bug 136970 work for you? If it does, just mark this one as duplicate.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dadok@kvados.cz</who>
            <bug_when>2006-10-14 12:25:46 0000</bug_when>
            <thetext>No, it&apos;s using killall insted of kill (for stopping racoon in chroted envirovment), so new racoon proces can be started before previous stops too.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>xenoterracide@gmail.com</who>
            <bug_when>2007-02-01 05:10:55 0000</bug_when>
            <thetext>I have this problem with 0.6.3 of the tools. at least I think it&apos;s this problem, same symptoms, but I haven&apos;t checked the init script.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hopeless@hamiltonshells.ca</who>
            <bug_when>2007-04-15 17:06:06 0000</bug_when>
            <thetext>I have the exact same problem on two very different gentoo systems, 
including the same racoon error output.

&quot;/etc/init.d/racoon stop; /etc/init.d/racoon start&quot; has the same problem, but 
&quot;/etc/init.d/racoon stop; sleep 1; /etc/init.d/racoon start&quot; works fine.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hopeless@hamiltonshells.ca</who>
            <bug_when>2007-04-18 15:38:12 0000</bug_when>
            <thetext>Created an attachment (id=116639)
init script patch

As the OP suggested, changing the init script to use start-stop-daemon fixes the issue.

Also, the same problem exists when using ipsec-tools 0.6.7 (released on 2007-04-06) with the ebuild in portage, but works fine with the patch above.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dragonheart@gentoo.org</who>
            <bug_when>2007-04-21 11:38:27 0000</bug_when>
            <thetext>this has been included in the latest version. Thanks Hopeless.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>116639</attachid>
            <date>2007-04-18 15:38 0000</date>
            <desc>init script patch</desc>
            <filename>racoon.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHJhY29vbi5vcmlnCTIwMDctMDQtMTggMTQ6MzQ6MTEuMDAwMDAwMDAwICswMDAwCisrKyBy
YWNvb24JMjAwNy0wNC0xOCAxNTozMTo1OC4wMDAwMDAwMDAgKzAwMDAKQEAgLTQxLDEzICs0MSwx
MyBAQAogCQllZXJyb3IgIkVycm9yIHdoaWxlIGxvYWRpbmcgaXBzZWMgcG9saWNpZXMiCiAJZmkK
IAllYmVnaW4gIlN0YXJ0aW5nIHJhY29vbiIKLQkvdXNyL3NiaW4vcmFjb29uIC1mICR7UkFDT09O
X0NPTkZ9ICR7UkFDT09OX09QVFN9CisJc3RhcnQtc3RvcC1kYWVtb24gLVMgLXggL3Vzci9zYmlu
L3JhY29vbiAtLSAtZiAke1JBQ09PTl9DT05GfSAke1JBQ09PTl9PUFRTfQogCWVlbmQgJD8KIH0K
IAogc3RvcCgpIHsKIAllYmVnaW4gIlN0b3BwaW5nIHJhY29vbiIKLQlraWxsIGBjYXQgL3Zhci9y
dW4vcmFjb29uLnBpZGAKKwlzdGFydC1zdG9wLWRhZW1vbiAtSyAtcCAvdmFyL3J1bi9yYWNvb24u
cGlkCiAJZWVuZCAkPwogCWlmIFsgLW4gIiR7UkFDT09OX1JFU0VUX1RBQkxFU30iIF07IHRoZW4K
IAkJZWJlZ2luICJGbHVzaGluZyBwb2xpY3kgZW50cmllcyIK
</data>        

          </attachment>
    </bug>

</bugzilla>