Skip to content

Cannot use YACReaderLibrary GUI while YACReaderLibraryServer is running #545

@simonbcn

Description

@simonbcn

Summary

The desktop GUI YACReaderLibrary and the headless YACReaderLibraryServer cannot run at the same time on a user session: starting the server (typical use case: autostart on login so the Android client can connect) makes it impossible to ever open the GUI. Both processes share the same QLocalServer GUID for their single-instance check, so the second one to start exits silently with code 0.

This is a functional problem, not a UX/diagnostics one. The desktop GUI is the only tool the package ships for managing the library (adding/removing libraries, scanning, editing comic metadata, organizing folders, etc.). Having to stop the server every time I want to manage my library defeats the purpose of running an always-on server in the first place.

What I want

Be able to launch and use YACReaderLibrary while YACReaderLibraryServer is already running, so I can manage my library without killing the server (and dropping Android-client connectivity during management).

Steps to reproduce

  1. Start YACReaderLibraryServer (e.g. via autostart) so it is listening on the local socket.
  2. Run YACReaderLibrary.
  3. The process returns immediately (exit 0), no window appears, stderr is empty.
  4. ~/.local/share/YACReader/YACReaderLibrary/yacreaderlibrary.log (server side) shows:
    ERROR ... Local connection: unable to read the message size \"QLocalSocket: Remote closed\"
    

Root cause (from the 10.0.0 source)

Both binaries call YACReaderLocalServer::isRunning() against the same shared GUID:

  • common/yacreader_global.h:33
    #define YACREADERLIBRARY_GUID \"ea343ff3-2005-4865-b212-7fa7c43999b8\"
  • YACReaderLibrary/main.cpp:211
    if (YACReaderLocalServer::isRunning()) // only a single instance of YACReaderLibrary is allowed
    {
        ...
        return 0;
    }
  • YACReaderLibraryServer/main.cpp:194 — identical check, same GUID.
  • YACReaderLibrary/yacreader_local_server.cpp:20-21 — both binaries listen(YACREADERLIBRARY_GUID) on the same Unix socket.

The check (per the comment) is intended to block duplicate GUI instances, but because the GUID is shared with the server, it also blocks GUI ↔ server cross-detection.

Possible directions

I am not attached to any particular implementation. A few approaches that could work:

  • Use a distinct GUID for the headless server vs the GUI, so each only blocks duplicates of itself. The GUI would also need to either skip starting its embedded YACReaderHttpServer (port already taken) or detect and reuse the running one.
  • Make the GUI detect a running server and attach to it (treat the running server as the shared data source / event channel) instead of refusing to start.

Environment

  • YACReader: 10.0.0 (built locally from the upstream release tarball via a custom PKGBUILD, no PDF backend, DECOMPRESSION_BACKEND=7zip)
  • Qt: 6.11.1
  • OS: Arch Linux (rolling)
  • Kernel: 7.0.9 (XanMod)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions