首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用"service varnish restart“重新启动varnish

无法使用"service varnish restart“重新启动varnish
EN

Stack Overflow用户
提问于 2013-09-04 17:11:52
回答 1查看 33K关注 0票数 4

我在"/etc/default/ varnish“和vcl文件"/etc/varnish/default.vcl”中进行了更改,因此希望重新启动varnish。

但是我不知道哪里出了问题。已经花了一个多小时调查了,但没什么进展。以下是详细信息:

代码语言:javascript
复制
nish@styx:~$ sudo service varnish restart
[sudo] password for nish: 
 * Stopping HTTP accelerator varnishd                                    [fail] 
 * Starting HTTP accelerator varnishd                                    [fail] 
Too many arguments (\...)
usage: varnishd [options]
-a address:port              # HTTP listen address and port
-b address:port              # backend address and port
                             #    -b <hostname_or_IP>
                             #    -b '<hostname_or_IP>:<port_or_service>'
-C                           # print VCL code compiled to C language
-d                           # debug
-f file                      # VCL script
-F                           # Run in foreground
-h kind[,hashoptions]        # Hash specification
                             #   -h critbit [default]
                             #   -h simple_list
                             #   -h classic
                             #   -h classic,<buckets>
-i identity                  # Identity of varnish instance
-l shl,free,fill             # Size of shared memory file
                             #   shl: space for SHL records [80m]
                             #   free: space for other allocations [1m]
                             #   fill: prefill new file [+]
-M address:port              # Reverse CLI destination.
-n dir                       # varnishd working directory
-P file                      # PID file
-p param=value               # set parameter
-s kind[,storageoptions]     # Backend storage specification
                             #   -s malloc
                             #   -s file  [default: use /tmp]
                             #   -s file,<dir_or_file>
                             #   -s file,<dir_or_file>,<size>
                             #   -s persist{experimenta}
                             #   -s file,<dir_or_file>,<size>,<granularity>
-t                           # Default TTL
-S secret-file               # Secret file for CLI authentication
-T address:port              # Telnet listen address and port
-V                           # version
-w int[,int[,int]]           # Number of worker threads
                             #   -w <fixed_count>
                             #   -w min,max
                             #   -w min,max,timeout [default: -w2,500,300]
-u user                      # Priviledge separation user id
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-09-04 17:19:56

已通过从"/etc/default/varnish“文件中删除换行符修复此问题。

代码语言:javascript
复制
DAEMON_OPTS="-a :80 \
             -T localhost:1234 \
             -f /etc/varnish/default.vcl \ 
             -s malloc,256m"

代码语言:javascript
复制
DAEMON_OPTS="-a :80 -T localhost:1234 -f /etc/varnish/default.vcl -s malloc,256m"
票数 11
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18609749

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档