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

Windows daemon process detection #2258

Closed
kicken opened this issue Feb 3, 2019 · 4 comments
Closed

Windows daemon process detection #2258

kicken opened this issue Feb 3, 2019 · 4 comments

Comments

@kicken
Copy link

kicken commented Feb 3, 2019

The Issue

Detecting an existing daemon process on windows appears to be fragile and fails to work under some circumstances.

Steps to Reproduce

  1. Create a shortcut to the daemon app with settings:
    a. Target: "C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe" start
    b. Start In: "C:\Program Files\LBRY\resources\static\daemon"
  2. Launch daemon process using shortcut
  3. Launch desktop application

Expected Behavior

Desktop application uses existing daemon and launches successfully.

Actual Behavior

Desktop application fails to detect existing daemon and then fails to run.

System Configuration

  • LBRY Daemon version: lbrynet 0.30.4
  • LBRY App version: LBRY 0.28.0-rc.2
  • LBRY Installation ID: 4V4d9Ak5UMWhytVuYyxggyFx9V18TXboU8HaJC6CTmFeQ2e2UkszhhWi6kp7uZBoWa
  • Operating system: Windows 10 v1803 (build 17134.523)

Anything Else

Looking at the commit history I see there were a few attempts at fixes for this based on the output of WMIC. In my testing it appears as though the WMIC output can vary depending on how one launches the process. I tested a varity of ways to launch the daemon and looked at the WMIC output that find_process matches against.

When using a command prompt to launch the daemon WMIC has a double-space as well as path/quotes if present in the original command.
lbrynet start
"c:\Program Files\LBRY\resources\static\daemon\lbrynet.exe" start
"c:\Program Files\LBRY\resources\static\daemon\lbrynet" start

When using a shortcut as described above, you get a single space and full path:
"C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe" start

When using a tool such as hstart to launch the daemon without a visible console window (what I've been doing previously) you get a single space and path/quotes depending on the original command.
lbrynet.exe start
"C:\Program Files\LBRY\resources\static\daemon\lbrynet.exe" start

@neb-b
Copy link

neb-b commented Feb 3, 2019

Wow thank your for the very detailed issue!

We definitely didn't test these different ways to open the app but shouldn't this is very helpful. Shouldn't be to hard to fix. Thanks again. 🙂

@tzarebczan
Copy link
Contributor

Thanks for the report. There's a known process parsing issue that prevents us from detecting it in a better way on Windows (most won't run into this problem). If you start lbrynet as just lbrynet start, without the exe, it should work. There is a guide here, we can make a note... https://lbry.io/faq/how-to-run-lbry

Not sure how to do this via a shortcut, will give it a shot.

@tzarebczan
Copy link
Contributor

Can we show you some appreciation for opening the issue? Thanks again!!

@tzarebczan
Copy link
Contributor

Fixed in #2283

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

No branches or pull requests

3 participants