Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

varnishadm always returns 0 (success) when commands sent via STDIN #4012

Open
Bilge opened this issue Oct 21, 2023 · 1 comment · May be fixed by #4018
Open

varnishadm always returns 0 (success) when commands sent via STDIN #4012

Bilge opened this issue Oct 21, 2023 · 1 comment · May be fixed by #4018
Assignees

Comments

@Bilge
Copy link

Bilge commented Oct 21, 2023

Expected Behavior

varnishadm returns a non-zero exit code when any command sent via STDIN fails.

Current Behavior

Regardless of how many commands are sent to varnishadm and whether any of them fail or not, it always returns a zero (success) code.

Possible Solution

Whenever any command fails in a series of commands sent to varnishadm, the program stops at that point. The exit code of that command should be used when the main process exits.

Steps to Reproduce (for bugs)

varnishadm vcl.load x; echo $?

1

echo vcl.load x | varnishadm; echo $?

0

Context

See varnishcache/pkg-varnish-cache#170.

Varnish Cache version

varnishd (varnish-6.6.1 revision e6a8c86)

Operating system

Ubuntu 22.04.3 LTS

Source of binary packages used (if any)

http://nova.clouds.archive.ubuntu.com/ubuntu

@bsdphk
Copy link
Contributor

bsdphk commented Oct 23, 2023

This is not optimal.

The problem is you dont want varnishadm to give up in interactive mode.

Bugwash consensus:

Give varnishadm -e argument (like shells) which makes it stop in first bad return, but with the same - prefix feature as varnishd -I

walid-git added a commit to walid-git/varnish-cache that referenced this issue Nov 8, 2023
@walid-git walid-git linked a pull request Nov 8, 2023 that will close this issue
walid-git added a commit to walid-git/varnish-cache that referenced this issue Nov 8, 2023
walid-git added a commit to walid-git/varnish-cache that referenced this issue Nov 9, 2023
walid-git added a commit to walid-git/varnish-cache that referenced this issue Nov 13, 2023
walid-git added a commit to walid-git/varnish-cache that referenced this issue Nov 16, 2023
walid-git added a commit to walid-git/varnish-cache that referenced this issue Nov 20, 2023
walid-git added a commit to walid-git/varnish-cache that referenced this issue Nov 30, 2023
walid-git added a commit to walid-git/varnish-cache that referenced this issue Nov 30, 2023
walid-git added a commit to walid-git/varnish-cache that referenced this issue Dec 27, 2023
walid-git added a commit to walid-git/varnish-cache that referenced this issue Jan 23, 2024
walid-git added a commit to walid-git/varnish-cache that referenced this issue Jan 23, 2024
walid-git added a commit to walid-git/varnish-cache that referenced this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants