wouterdebie / locast2tuner

Locast to Emby/Plex/Channels server
https://wouterdebie.github.io/locast2tuner/
MIT License
52 stars 8 forks source link

"Address already in use" error when stopping & starting locast2tuner from terminal (Homebrew/macOS) #55

Closed sumocomputers closed 3 years ago

sumocomputers commented 3 years ago

Running Homebrew version on macOS 11 (just went from 0.1.37 to 0.1.39).

Sometimes I need to close locast2tuner from the command line, like to update to a newer version or for other reasons.

I normally just hit Control + X, and then run my normal command like this:

/usr/local/bin/locast2tuner --config /Users/mediamacmini/Downloads/Locast2Tuner/config.ini

And sometimes it starts up fine, and other times I get errors like below.

I am assuming something with locast2tuner isn't fully quitting and releasing the port number on localhost, but just a guess. A reboot seems to fix it.

May 21 17:11:31.714 DEBG starting new connection: https://api.locastnet.org/
May 21 17:11:32.288 DEBG response '200 OK' for https://api.locastnet.org/api/user/login
May 21 17:11:32.288 INFO Login succeeded!
May 21 17:11:32.288 DEBG starting new connection: https://api.locastnet.org/
May 21 17:11:32.872 DEBG response '200 OK' for https://api.locastnet.org/api/user/me
May 21 17:11:32.873 DEBG starting new connection: https://api.locastnet.org/
May 21 17:11:33.360 DEBG response '200 OK' for https://api.locastnet.org/api/dma
May 21 17:11:33.361 INFO Using cached FCC facilities at /Users/mediamacmini/.locast2tuner/facilities
May 21 17:11:33.375 DEBG starting new connection: https://api.locastnet.org/
May 21 17:11:33.851 DEBG response '200 OK' for https://api.locastnet.org/api/watch/dma/zip/44144
May 21 17:11:33.859 DEBG starting new connection: https://api.locastnet.org/
May 21 17:11:34.594 DEBG response '200 OK' for https://api.locastnet.org/api/watch/epg/510?startTime=2021-05-22T00:00:00-00:00&hours=208
May 21 17:11:46.305 INFO Loading stations for Cleveland (cache: true, cache timeout: 3600, days: 30)..
May 21 17:11:46.317 INFO Starting http server for Multiplexer on http://127.0.0.1:6077
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 48, kind: AddrInUse, message: "Address already in use" }', src/http/mod.rs:84:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Abort trap: 6
eiddor commented 3 years ago

@sumocomputers Yeah probably want to give it a few seconds to do what it needs to do in order to gracefully shut down.

You can check to see if it's running with a:

ps -ef | grep locast2tuner

I don't have locast2tuner on my Mac, but here's an example of it with iTerm2:

➜  ~ ps -ef | grep -i iTerm2
  501  2118     1   0 11May21 ??        11:08.48 /Applications/iTerm.app/Contents/MacOS/iTerm2

If you've waited long enough and it's still running, you can do a kill -9 <pid> to force kill the process.

In my case the PID for iTerm2 is 2118 (second column). Yours will be different each time, just make sure you use the correct one :-)

wouterdebie commented 3 years ago

Why ctrl-x? You should hit ctrl-c to stop it.

On Fri, May 21, 2021, 19:24 Roddie Hasan @.***> wrote:

@sumocomputers https://github.com/sumocomputers Yeah probably want to give it a few seconds to do what it needs to do in order to gracefully shut down.

You can check to see if it's running with a:

ps -ef | grep locast2tuner

I don't have locast2tuner on my Mac, but here's an example of it with iTerm2:

➜ ~ ps -ef | grep -i iTerm2

501 2118 1 0 11May21 ?? 11:08.48 /Applications/iTerm.app/Contents/MacOS/iTerm2

If you've waited long enough and it's still running, you can do a kill -9

to force kill the process. In my case the PID for iTerm2 is 2118 (second column). Yours will be different each time, just make sure you use the correct one :-) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe .
eiddor commented 3 years ago

(heh I hesitated to ask in case it was some new command that I had never heard of)

sumocomputers commented 3 years ago

Sorry for the typo, it was ctrl-c, lol.

And I waited even a few minutes but it still wouldn’t start back up.

I’ll use those ps and kill commands in the future, thank you!