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

service varnish restart fails #71

Closed
mgla opened this issue Mar 29, 2017 · 7 comments
Closed

service varnish restart fails #71

mgla opened this issue Mar 29, 2017 · 7 comments
Assignees

Comments

@mgla
Copy link

mgla commented Mar 29, 2017

Expected Behavior

If i run service varnish restart, it should restart usually

Current Behavior

I try to restart varnish and I get this error:

$ sudo service varnish restart
 * Checking syntax varnishd
   ...done.
 * Stopping HTTP accelerator varnishd
No /usr/sbin/varnishd found running; none killed.
   ...fail!
 * Starting HTTP accelerator varnishd
   ...fail!
Error: Cannot open socket: :80: Address already in use

Context

sudo service varnish start

works fine, same with

sudo service varnish stop

It is just the restart that does not work.

Your Environment

Version used: varnish-4.1.5 revision 2c82b1c
Operating System and version: Ubuntu 14.04

I used this package: https://packagecloud.io/varnishcache/varnish41/packages/ubuntu/trusty/varnish_4.1.5-1~trusty_amd64.deb

@mgla
Copy link
Author

mgla commented Mar 29, 2017

I created a patch which fixes that specific problem for me, but probably breaks something else:

https://gist.github.com/mgla/3e04a06bc21e6def88133917def56e9f

The problems seems to occur be in the unhandled else in the outer if clause.

@denisbr
Copy link
Contributor

denisbr commented Mar 31, 2017

Hi @mgla, thanks for the report. I'll try to reproduce the error, and test the proposed fix. Would you mind creating a pull request for the patch?

@denisbr
Copy link
Contributor

denisbr commented Mar 31, 2017

Actually @mgla, no need to create a PR for that patch as it does indeed remove logic that we want to keep. I'll try to fix the script without stripping the configtest out.

@mgla
Copy link
Author

mgla commented Mar 31, 2017

@denisbr Thanks. I really could not recommend that patch.

@denisbr
Copy link
Contributor

denisbr commented Apr 3, 2017

@mgla I tried reproducing your issue, but start, stop, restart all worked fine here.
The error you pasted doesn't really indicate a problem with the initscript, but rather an issue (maybe some other service uses port 80) on your server.

Could you try using the normal initscript again, and if it still fails, paste the full output, and do netstat -lntpd | grep PORT where PORT is the port varnish is configured to use.

@denisbr
Copy link
Contributor

denisbr commented Apr 4, 2017

@mgla Did you try this again?

@denisbr denisbr self-assigned this Apr 4, 2017
@mgla
Copy link
Author

mgla commented Apr 4, 2017

Can't reproduce anymore. Was probably something else. I am on it, but I will close this report for now...

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

No branches or pull requests

2 participants