방금 우분투 16.04를 새로 설치했는데 Ubuntu 14.04에서 할 수있는 것처럼 사용자 지정 구성 파일로 작업 할 수 없습니다.Ubuntu 16의 Varnish는 사용자 정의 default.vcl 파일을 읽을 수 없습니다.
I have read/etc/default/varnish
으로 변경되면 init.d 대신 systemd가 사용되므로 아무런 영향이 없습니다.
/lib/systemd/system/varnish.service
편집으로 변경되었습니다
[Unit]
Description=Varnish HTTP accelerator
Documentation=https://www.varnish-cache.org/docs/4.1/ man:varnishd
[Service]
Type=simple
LimitNOFILE=131072
LimitMEMLOCK=82000
ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
ExecReload=/usr/share/varnish/reload-vcl
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
[Install]
WantedBy=multi-user.target
가 지금은 사용자 정의 VCL과 default.vcl을 (이 내가 일하고 있어요 자식 저장소에) 교환하고자합니다. 그래서 -f /home/bozdoz/path/to/default.vcl
을 가지고 ExecStart에서 줄을 변경, 나는 서비스 데몬을 다시로드하고 다시 시작한 후 다음과 같은 오류가 발생합니다 : 내가 니스 소유하는 사용자 정의 파일에 대한 권한을 변경 시도
>> sudo systemctl status varnish.service
● varnish.service - Varnish HTTP accelerator
Loaded: loaded (/lib/systemd/system/varnish.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2016-09-07 14:29:58 ADT; 5s ago
Docs: https://www.varnish-cache.org/docs/4.1/
man:varnishd
Process: 7588 ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :6081 -T localhost:6082 -f /home/bozdoz/path/to/default.vcl
Main PID: 7588 (code=exited, status=2)
Sep 07 14:29:58 bozdoz-dell systemd[1]: Started Varnish HTTP accelerator.
Sep 07 14:29:58 bozdoz-dell varnishd[7588]: Error: Cannot read -f file (/home/bozdoz/path/to/default.vcl)
을, 또는 vcache,하지만 둘 다 작동하지 않습니다. 777 (테스트 목적으로 만) 권한을 열려고 시도했지만 여전히 실패했습니다.
또한 사용자 지정 파일을 /etc/varnish/default.vcl
에 복사하면 바니시가 완벽하게 작동합니다. 문제는 파일을 git 저장소에 저장하고 싶지만 바니시 서비스가 사용자 정의 파일에 액세스 할 수없는 것입니다.
systemd를 사용하여 다른 디렉토리의 사용자 정의 파일을 어떻게 사용할 수 있습니까?
여전히 권한과 관련된 문제를 해결할 수 없습니다. 변경할 필요가있을 때마다 repo의 default.vcl 파일을/etc/varnish 디렉토리로 복사 할 수 있습니다. 사용자 정의 파일을 사용할 수없는 경우 가장 좋은 방법입니다. – bozdoz