BIND 10 #151: XfroutClient socket location and removal
BIND 10 Development
do-not-reply at isc.org
Wed Jun 2 06:23:16 UTC 2010
#151: XfroutClient socket location and removal
--------------------+-------------------------------------------------------
Reporter: jreed | Owner: shentingting
Type: defect | Status: assigned
Priority: major | Milestone: 04. 2nd Incremental Release: Early Adopters
Component: xfrout | Resolution:
Keywords: | Sensitive: 0
--------------------+-------------------------------------------------------
Comment(by shane):
Replying to [comment:12 zhanglikun]:
> One Question: How to make sure there is only one xfrout process running
on server? to check whether the socket file
/usr/local/var/auth_xfrout_conn used by xfrout exist or not when starting?
The problem is: when xfrout crashed last time, and /auth_xfrout_conn isn't
deleted properly, you have to let user to delete /auth_xfrout_conn
manually. Do this make sense?
Likun and I talked about this. If you try to `bind()` to an AF_UNIX
socket, it will fail if any file exists, even an unused AF_UNIX socket.
So, what we will do is try to `connect()` first. In this case one of 3
things happens:
1. If there is no file, you get a socket.error with ENOENT
1. If there is a file, but it is not a socket or nobody is listening,
you get socket.err with ECONNREFUSED
1. If there is a listener, then the `connect()` will succeed
So if another copy of xfrout is running, the `connect()` will succeed, and
we can exit with appropriate warning/error message at that time.
Otherwise, we get an error and we can safely start.
--
Ticket URL: <http://bind10.isc.org/ticket/151#comment:13>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list