termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.34k stars 3.07k forks source link

[Bug]: Keychain Not Working Properly in Termux #21736

Closed devxpain closed 1 month ago

devxpain commented 1 month ago

Problem description

I am experiencing issues with the keychain package while using it in Termux on an Android device. The command keychain --eval --agents ssh does not seem to set the SSH_AUTH_SOCK and SSH_AGENT_PID environment variables correctly. I receive the message "Waiting 5 seconds for lock..." but no lock files are found, and the variables remain unset.

What steps will reproduce the bug?

  1. Install keychain in Termux using:
    pkg install keychain
  2. Open a new Termux session.
  3. Run the command:
    eval $(keychain --eval --agents ssh)
  4. Observe that the output indicates waiting for a lock:
    * Waiting 5 seconds for lock...
  5. Check for environment variables:
    echo $SSH_AUTH_SOCK
    echo $SSH_AGENT_PID
  6. Notice that these variables are not set.

What is the expected behavior?

The keychain command should successfully initialize the SSH agent and set the SSH_AUTH_SOCK and SSH_AGENT_PID environment variables, allowing for seamless SSH key management.

System information

**Termux Info:**

Termux Variables:
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=11475
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0

Packages CPU architecture:
aarch64

Subscribed repositories:
# sources.list
deb https://mirrors.medzik.dev/termux/termux-main stable main

Updatable packages:
All packages up to date

termux-tools version:
1.43.6

Android version:
10

Kernel build information:
Linux localhost 4.14.116 #1 SMP PREEMPT Mon Oct 16 19:13:50 CST 2023 aarch64 Android

Device manufacturer:
HUAWEI

Device model:
STK-L22

LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so

Keychain Info:

* keychain 2.8.5 ~ http://www.funtoo.org
Copyright 2002-2006 Gentoo Foundation;
Copyright 2007 Aron Griffis;
Copyright 2009-2017 Funtoo Solutions, Inc;
lockfile() Copyright 2009 Parallels, Inc.
Keychain is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Related Issues:

fornwall commented 1 month ago

Thanks! This should be fixed by #21737 in version 2.8.5-2 of the keychain package. Update to it with pkg up (it might take some time for the updated package to reach all mirrors).