Uploaded image for project: 'Libmongocrypt'
  1. Libmongocrypt
  2. MONGOCRYPT-115

Expose a default system dependent PID file + domain socket location for mongocryptd

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Expose functions like:

      const char*
      mongocrypt_default_pid_file_path (void);
      
      const char*
      mongocrypt_default_domain_socket_path (void);
      

      Which returns the default PID file path a driver should use to spawn and connect to mongocryptd.

      mark.benvenuto helpfully suggested the base logic per system:

      MacOS

      NSTemporaryDirectory()/mongocryptd.pid
      https://developer.apple.com/documentation/foundation/1409211-nstemporarydirectory  
      

      Linux

      if $XDG_RUNTIME_DIR set:
         $XDG_RUNTIME_DIR/mongocryptd.pid
      else if $XDG_DATA_HOME is set
        $XDG_DATA_HOME/mongocryptd.pid
      else if $HOME
          $HOME/.local/share/mongocryptd.pid
      else
         abort
      https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html  
      

      Windows

      %LOCALAPPDATA%\Temp\mongocryptd.pid 
      
      Via FOLDERID_LocalAppData i.e. (%LOCALAPPDATA% (%USERPROFILE%\AppData\Local))
      https://docs.microsoft.com/en-us/windows/desktop/shell/knownfolderid
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: