question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autocmd should split by space

See original GitHub issue

After renewal I wanted to reload nginx (like graceful reload in apache). Running docker exec nginx nginx -s reload works.

The problem: Autocmd code calls execute code with the entire command in one string while other args are seperated to a list.

This is a python\linux underlying issue, because it makes docker expect a file inside the docker named “nginx -s reload” (not only nginx)

  • The python code subprocess.call(['docker','exec','nginx','nginx -s reload'],env=env) fails
  • while the following code succeeds: subprocess.call(['docker','exec','nginx','nginx', '-s', 'reload'],env=env) (last argument converted to list)

My current work around is to use the deploy_hook: docker exec nginx nginx -s reload. My suggested fix it to split the command and concatenate: ["docker", "exec", container, command] will become ["docker", "exec", container] + command.split(' ') in here : https://github.com/adferrand/dnsrobocert/blob/master/src/dnsrobocert/core/hooks.py#L282

Anyway thanks for the project, use it a lot!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
davidyukcommented, Jun 20, 2020

Another approach would be to allow define cmd in autocmd as a list

0reactions
davidyukcommented, Jun 25, 2020

The third option is fine. It is better than the second because it doesn’t make breaking changes 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

BufLeave: Auto save split file not working
in files open in split and edit them. I would like vim to autosave the *.in files whenever I switch between splits. Searching...
Read more >
Vim: how to make buffers automatically split space evenly on ...
You can use the key combination ctrl-w = to resize all splits to their appropriate size. ... autocmd WinResize * wincmd = This...
Read more >
Multiple autocommands in vim - Stack Overflow
You can call a function, if you like: autocmd Filetype ruby call SetRubyOptions() function SetRubyOptions() setlocal ts=2 ... endfunction.
Read more >
autocmd.txt - Vim
No white space can be used in this list. The command applies to all the events in the list. For READING FILES there...
Read more >
Vim split to a specific size - VimTricks
Open Vim splits to a specific height or width by prepending a number to the command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found