Mailing List Archive

#1069: `varnishd -C` does not return an appropriate return code
#1069: `varnishd -C` does not return an appropriate return code
----------------------+-----------------------------------------------------
Reporter: erikwebb | Type: defect
Status: new | Priority: high
Milestone: | Component: build
Version: 3.0.0 | Severity: normal
Keywords: |
----------------------+-----------------------------------------------------
To allow for easier scripting and management of VCL changes, the `varnishd
-C` check for correct syntax should return a proper return code.
Regardless of the compilation outcome, zero is returned.

{{{
$ varnishd -C -f /path/to/bad/file/default.vcl
Message from VCC-compiler:
Expected one of
'acl', 'sub', 'backend', 'director', 'probe', or 'import'
Found: 'asdasd' at
('input' Line 211 Pos 2)
}asdasd
-######

Running VCC-compiler failed, exit 1
$ echo $?
0
}}}

{{{
$ varnishd -C -f /path/to/good/file/default.vcl
/*
* NB: This file is machine generated, DO NOT EDIT!
*
* Edit and run generate.py instead
*/

struct sess;
struct cli;

typedef void vcl_init_f(struct cli *);
typedef void vcl_fini_f(struct cli *);
typedef int vcl_func_f(struct sess *sp);

...

$ echo $?
0
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1069>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1069: `varnishd -C` does not return an appropriate return code [ In reply to ]
#1069: `varnishd -C` does not return an appropriate return code
-----------------------+----------------------------------------------------
Reporter: erikwebb | Type: defect
Status: closed | Priority: high
Milestone: | Component: build
Version: 3.0.0 | Severity: normal
Resolution: fixed | Keywords:
-----------------------+----------------------------------------------------
Changes (by Poul-Henning Kamp <phk@…>):

* status: new => closed
* resolution: => fixed


Comment:

(In [8bf6c6d2891b50b04af463791fc380c359b1d02c]) Also reflect the VCC exit
code through if -C is specified.

Fixes #1069

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1069#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs