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

Serve command runs in background #3819

Closed
5 tasks
beechnut opened this issue Apr 11, 2024 · 4 comments · Fixed by #3959
Closed
5 tasks

Serve command runs in background #3819

beechnut opened this issue Apr 11, 2024 · 4 comments · Fixed by #3959
Labels

Comments

@beechnut
Copy link
Contributor

Expected Behavior

When I run ./serve and signal an interrupt (ctrl+C), the serve command should stop running and the site should stop working in the browser.

Actual Behavior

When I run ./serve and signal an interrupt (ctrl+C), serve continues running in the background and the local site continues to work.

Steps to reproduce the behavior

  • Follow local installation instructions and run ./serve
  • Visit the site (it should be running)
  • Type ctrl+C to interrupt
  • Refresh the tab with the site (it's still running, but shouldn't be)

This issue is done when

  • serve shuts down when given an interrupt signal (ctrl+C)
@beechnut
Copy link
Contributor Author

beechnut commented Apr 11, 2024

This line appears to be the culprit — there's a & (which backgrounds a process) where I suspect we want a &&. But it's a little hard to tell, perhaps it's intentional that it's trying to run a couple processes in parallel.

@caleywoods
Copy link
Contributor

I don't see this issue occurring on my machine. Sending ctrl + c to interrupt a running ./serve causes the local site to stop responding when using ./serve or ./serve-fast and the PIDs associated with the running job/task disappear when doing a process list with ps -a.

I'm not sure what the difference could be but some here's some info about my local setup:

  • Intel chip macbook (non Apple Silicon/M1/M2/M3)
  • I'm using Kitty for a terminal app
  • I'm using zshell and not bash

I tried a few different things to see if it changed the behavior I see:

  • I updated the ./serve script to run in a bash shell by changing #!/bin/sh at the top of the script to #!/bin/bash. Running this script in Kitty and in the default terminal application made no difference.
  • I tried running the ./serve script in the default terminal application and that made no difference.
  • I ran chsh -s /bin/bash to temporarily switch over to a bash shell and then running an unmodified ./serve script resulted in no changes, the process stops as expected when sent an interrupt.

@beechnut
Copy link
Contributor Author

If it's not reproducible after all that work, I'm comfortable closing this for now.

@beechnut
Copy link
Contributor Author

beechnut commented Jul 1, 2024

It re-presented itself while working on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants