1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

- add rc.d script

- add the patch that fixes posix_fadvise64 linuxism: swift tries to call
  posix_fadvise64, which does not exists on FreeBSD and does not needed
  because off_t is 8 bytes on both 32 and 64-bit platforms, so posix_fadvise
  should be called instead. This has been reported upstream (#1179268) but
  there is no reaction so far.
- bump PORTREVISION

PR:		178738
Submitted by:	trociny
Approved by:	maintainer timeout (3 weeks)
This commit is contained in:
Ruslan Makhmatkhanov 2013-06-11 18:28:30 +00:00
parent 350839d292
commit c04a63505f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=320622
3 changed files with 135 additions and 0 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= swift
PORTVERSION= 1.8.0
PORTREVISION= 1
CATEGORIES= databases python
MASTER_SITES= http://launchpadlibrarian.net/136145662/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -24,6 +25,7 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}eventlet>=0.9.8:${PORTSDIR}/net/py-eventlet
USE_PYTHON= -2.7
USE_PYDISTUTILS= easy_install
USE_RC_SUBR= swift
MAN1= swift-account-auditor.1 \
swift-account-reaper.1 \

View File

@ -0,0 +1,17 @@
--- swift/common/utils.py.orig 2013-05-18 14:10:21.000000000 +0300
+++ swift/common/utils.py 2013-05-18 14:09:06.000000000 +0300
@@ -274,12 +274,12 @@ def drop_buffer_cache(fd, offset, length
"""
global _posix_fadvise
if _posix_fadvise is None:
- _posix_fadvise = load_libc_function('posix_fadvise64')
+ _posix_fadvise = load_libc_function('posix_fadvise')
# 4 means "POSIX_FADV_DONTNEED"
ret = _posix_fadvise(fd, ctypes.c_uint64(offset),
ctypes.c_uint64(length), 4)
if ret != 0:
- logging.warn("posix_fadvise64(%s, %s, %s, 4) -> %s"
+ logging.warn("posix_fadvise(%s, %s, %s, 4) -> %s"
% (fd, offset, length, ret))

View File

@ -0,0 +1,116 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: swift
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable swift:
#
# swift_enable (bool): Set it to "YES" to enable swift.
# Default is "NO".
# swift_servers (list): Specify servers to run as a space separated
# list of possible values:
# account, account-reaper, account-replicator,
# container, container-auditor, container-replicator,
# container-sync, container-updater,
# object, object-auditor, object-expirer,
# object-replicator, object-updater,
# proxy.
# The following aliases may be used:
# "ACCOUNT" -- all account servers;
# "EXPIRER" -- object-expirer;
# "CONTAINER" -- all container server;
# "OBJECT" -- all object servers;
# "PROXY" -- all proxy servers;
# "STORAGE" -- all storage node servers
# (alias for "ACCOUNT CONTAINER OBJECT");
# "ALL" -- all servers
# (alias for "ACCOUNT CONTAINER EXPIRER OBJECT PROXY").
# Default is "ALL".
. /etc/rc.subr
name="swift"
rcvar=swift_enable
extra_commands="reload shutdown status"
reload_cmd="swift_init reload"
shutdown_cmd="swift_init shutdown"
start_cmd="swift_init start"
status_cmd="swift_init status"
stop_cmd="swift_init stop"
required_files=%%PREFIX%%/etc/swift/swift.conf
PATH=%%PREFIX%%/bin:$PATH
load_rc_config $name
: ${swift_enable:="NO"}
: ${swift_servers:="ALL"}
swift_expand_servers()
{
local x
for x; do
case "${x}" in
ALL)
swift_expand_servers PROXY
swift_expand_servers EXPIRER
;&
STORAGE)
swift_expand_servers ACCOUNT
swift_expand_servers CONTAINER
swift_expand_servers OBJECT
;;
ACCOUNT)
echo account
echo account-reaper
echo account-replicator
;;
EXPIRER)
echo object-expirer
;;
CONTAINER)
echo container
echo container-auditor
echo container-replicator
echo container-sync
echo container-updater
;;
OBJECT)
echo object
echo object-auditor
echo object-replicator
echo object-updater
;;
PROXY)
echo proxy
;;
account|account-reaper|account-replicator|\
container|container-auditor|container-replicator|\
container-sync|container-updater|\
object|object-auditor|object-expirer|object-replicator|\
object-updater|\
proxy)
echo "${x}"
;;
*)
warn "unknown service: ${x}"
exit 1
;;
esac
done | sort -u
}
swift_init()
{
local cmd=$1
swift-init `swift_expand_servers ${swift_servers}` ${cmd}
}
run_rc_command "$1"