diff options
author | nork <nork@FreeBSD.org> | 2010-05-30 23:05:18 +0800 |
---|---|---|
committer | nork <nork@FreeBSD.org> | 2010-05-30 23:05:18 +0800 |
commit | 156b0094ccbb49fbbe862e53147d5550c7ab12fc (patch) | |
tree | 242361d1b4c83ef42bfc9f1afc4655c707227288 /databases | |
parent | 88f473bd508f1cbc870ff61f290ad267763ffdbf (diff) | |
download | freebsd-ports-gnome-156b0094ccbb49fbbe862e53147d5550c7ab12fc.tar.gz freebsd-ports-gnome-156b0094ccbb49fbbe862e53147d5550c7ab12fc.tar.zst freebsd-ports-gnome-156b0094ccbb49fbbe862e53147d5550c7ab12fc.zip |
o Fix my HAVE_KQUEUE support bugs.
o Add support `service flare[id] reload'.
o Sleep until flarei daemon starting.
To disable flarei_sleepwait="0" to /etc/rc.conf.
Diffstat (limited to 'databases')
-rw-r--r-- | databases/flare/Makefile | 5 | ||||
-rw-r--r-- | databases/flare/files/flared.sh.in | 2 | ||||
-rw-r--r-- | databases/flare/files/flarei.sh.in | 8 | ||||
-rw-r--r-- | databases/flare/files/patch-kqueue-server.cc | 30 |
4 files changed, 32 insertions, 13 deletions
diff --git a/databases/flare/Makefile b/databases/flare/Makefile index 4ae33e74c84a..05b7e00bde77 100644 --- a/databases/flare/Makefile +++ b/databases/flare/Makefile @@ -7,7 +7,7 @@ PORTNAME= flare PORTVERSION= 1.0.9 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= databases MASTER_SITES= http://labs.gree.jp/data/source/ EXTRACT_SUFX= .tgz @@ -22,8 +22,7 @@ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING GNU_CONFIGURE= yes -# There is a stability and performance issue, so temporary disabled HAVE_KQUEUE. -CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS=-L${LOCALBASE}/lib +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -DHAVE_KQUEUE" LDFLAGS=-L${LOCALBASE}/lib USE_RC_SUBR= flared.sh flarei.sh SUB_FILES= pkg-message diff --git a/databases/flare/files/flared.sh.in b/databases/flare/files/flared.sh.in index f22f0c74e6b3..a037afcb625f 100644 --- a/databases/flare/files/flared.sh.in +++ b/databases/flare/files/flared.sh.in @@ -16,6 +16,8 @@ name=flared rcvar=`set_rcvar` command=%%PREFIX%%/bin/${name} +extra_commands="reload" + load_rc_config ${name} case "${flared_flags}" in diff --git a/databases/flare/files/flarei.sh.in b/databases/flare/files/flarei.sh.in index a89961e0f48d..9ca2a39f6a2f 100644 --- a/databases/flare/files/flarei.sh.in +++ b/databases/flare/files/flarei.sh.in @@ -10,6 +10,7 @@ flarei_enable=${flarei_enable-"NO"} flarei_config=${flarei_conffile-"%%PREFIX%%/etc/flarei.conf"} flarei_pidfile=${flarei_pidfile-"/var/run/flarei.pid"} flarei_flags="--daemonize" +flarei_sleepwait="2" . /etc/rc.subr @@ -17,6 +18,13 @@ name=flarei rcvar=`set_rcvar` command=%%PREFIX%%/bin/${name} +extra_commands="reload" +start_postcmd="flarei_poststart" + +flarei_poststart () { + sleep "${flarei_sleepwait}" +} + load_rc_config ${name} case "${flarei_flags}" in diff --git a/databases/flare/files/patch-kqueue-server.cc b/databases/flare/files/patch-kqueue-server.cc index 699e3fb6e57e..313520a98d93 100644 --- a/databases/flare/files/patch-kqueue-server.cc +++ b/databases/flare/files/patch-kqueue-server.cc @@ -1,5 +1,5 @@ --- src/lib/server.cc.orig 2009-10-09 19:08:47.000000000 +0900 -+++ src/lib/server.cc 2010-05-30 06:10:23.363742550 +0900 ++++ src/lib/server.cc 2010-05-30 23:58:14.924160278 +0900 @@ -21,6 +21,9 @@ #ifdef HAVE_EPOLL _epoll_socket(0), @@ -51,27 +51,37 @@ return 0; } -@@ -208,6 +231,10 @@ +@@ -204,10 +227,14 @@ + vector<shared_connection> server::wait() { + vector<shared_connection> connection_list; + +-#ifdef HAVE_EPOLL ++#if defined(HAVE_EPOLL) const char* poll_type = "epoll_wait"; // just for logging struct epoll_event ev_list[this->max_listen_socket]; int n = epoll_wait(this->_epoll_socket, ev_list, this->max_listen_socket, -1); -+#elifdef HAVE_KQUEUE ++#elif defined(HAVE_KQUEUE) + const char* poll_type = "kqueue_wait"; // just for logging -+ struct kevent kev; -+ int n = kevent(this->_kqueue_socket, &kev, 1, NULL, 0, NULL); ++ struct kevent kev[this->max_listen_socket]; ++ int n = kevent(this->_kqueue_socket, NULL, 0, kev, this->max_listen_socket, NULL); #else const char* poll_type = "select"; // just for logging fd_set fds; -@@ -230,6 +257,8 @@ - #ifdef HAVE_EPOLL +@@ -227,9 +254,12 @@ + } + + // accpet anyway +-#ifdef HAVE_EPOLL ++#if defined(HAVE_EPOLL) for (int i = 0; i < n; i++) { int listen_socket = ev_list[i].data.fd; -+#elifdef HAVE_KQUEUE -+ int listen_socket = kev.ident; ++#elif defined(HAVE_KQUEUE) ++ for (int i = 0; i < n; i++) { ++ int listen_socket = kev[i].ident; #else for (int i = 0; i < this->_listen_socket_index; i++) { if (!FD_ISSET(this->_listen_socket[i], &fds)) { -@@ -369,6 +398,32 @@ +@@ -369,6 +399,32 @@ return 0; } #endif |