![](/img/trans.png)
[英]How to add additional resources to cloud foundry instance with java_buildpack?
[英]How to add additional process to [Cloud Foundry] buildpacks?
我想將varnishlog日志添加到此buildpack: https : //github.com/chregu/cf-varnish-buildpack
當buildpack開始將Varnish錯誤記錄到磁盤/ stderr時,如何添加第二個要啟動的進程?
buildpack可以生成后台進程。 對於您所指向的buildpack, bin/release
文件表明它將在啟動時啟動boot.sh
因此,您可以修改boot.sh
,以使用在命令行中添加&
的常規shell語法在后台啟動所需的任何內容。 例如:
export APP_ROOT=$HOME
export LD_LIBRARY_PATH=$APP_ROOT/varnish/lib:$LD_LIBRARY_PATH
if [ -z "$VARNISH_MEMORY_LIMIT" ]; then
VARNISH_MEMORY_LIMIT=$MEMORY_LIMIT
fi
# Start some logging process in the background
start_my_logging.sh &
# check varnish config
$APP_ROOT/varnish/sbin/varnishd -C -f $APP_ROOT/varnish/etc/varnish/default.vcl 2>&1
# TODO, Make MEMORY_LIMIT adjustable, this now comes from CF itself
exec $APP_ROOT/varnish/sbin/varnishd -n /home/vcap/tmp/varnish -F -f $APP_ROOT/varnish/etc/varnish/default.vcl -a 0.0.0.0:$VCAP_APP_PORT -t 120 -w 50,1000,120 -s malloc,$VARNISH_MEMORY_LIMIT -T 127.0.0.1:6082 -p http_resp_hdr_len=32768 2>&1
# ------------------------------------------------------------------------------------------------
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.