Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 151375 - net-firewall/ipsec-tools-0.6.5 racoon init script restart sometimes fails
Summary: net-firewall/ipsec-tools-0.6.5 racoon init script restart sometimes fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Peter Johanson (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-14 11:51 UTC by Milan Dadok
Modified: 2007-04-21 11:38 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
init script patch (racoon.patch,549 bytes, patch)
2007-04-18 15:38 UTC, Hopeless
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Dadok 2006-10-14 11:51:39 UTC
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'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
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-10-14 11:57:24 UTC
So, does the init script in Bug 136970 work for you? If it does, just mark this one as duplicate.
Comment 2 Milan Dadok 2006-10-14 12:25:46 UTC
No, it's using killall insted of kill (for stopping racoon in chroted envirovment), so new racoon proces can be started before previous stops too.
Comment 3 Caleb Cushing 2007-02-01 05:10:55 UTC
I have this problem with 0.6.3 of the tools. at least I think it's this problem, same symptoms, but I haven't checked the init script.
Comment 4 Hopeless 2007-04-15 17:06:06 UTC
I have the exact same problem on two very different gentoo systems, 
including the same racoon error output.

"/etc/init.d/racoon stop; /etc/init.d/racoon start" has the same problem, but 
"/etc/init.d/racoon stop; sleep 1; /etc/init.d/racoon start" works fine.
Comment 5 Hopeless 2007-04-18 15:38:12 UTC
Created attachment 116639 [details, diff]
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.
Comment 6 Daniel Black (RETIRED) gentoo-dev 2007-04-21 11:38:27 UTC
this has been included in the latest version. Thanks Hopeless.