Opened 11 months ago

Last modified 6 weeks ago

#18758 new bug

Session problem with Keyboard shortcuts.

Reported by: ilzu Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: Servers/launch_daemon Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by ilzu)

I have ssh-agent running in UserSetupEnvironment and I have shortcut to open QuickLaunch. When opening an app through Quicklaunch opened by shortcut, it has different SSH_AGENT_PID for ssh-agent, so it doesn't have same ssh keys authenticated as the apps opened from Tracker or Deskbar. The other environment variables are correct.

Attachments (1)

Screenshot.png (20.6 KB ) - added by ilzu 11 months ago.
One terminal opened from Deskbar, another via Quicklaunch from a shortcut

Download all attachments as: .zip

Change History (10)

comment:1 by ilzu, 11 months ago

Description: modified (diff)

by ilzu, 11 months ago

Attachment: Screenshot.png added

One terminal opened from Deskbar, another via Quicklaunch from a shortcut

comment:2 by waddlesplash, 11 months ago

Component: - GeneralServers/launch_daemon
Owner: changed from nobody to axeld

comment:3 by jackburton, 7 weeks ago

Same problem here when using git+ssh from Genio. Basically this makes ssh_agent almost unusable on Haiku.

If I start Genio from the Terminal where I used ssh-add, I can connect to my git repos, otherwise it doesn't detect the added key.

See also #12534

comment:4 by jackburton, 7 weeks ago

I'd change the issue title since it's not very clear: The problem isn't limited to the keyboard shortcut, but also applications launched by Tracker have this issue.

Last edited 7 weeks ago by jackburton (previous) (diff)

comment:5 by jackburton, 7 weeks ago

By the way, is there an "official" way to start ssh_agent in Haiku ? It seems it's launched automatically every time I start the first Terminal, but I can't find where.

comment:6 by augiedoggie, 7 weeks ago

I use keychain to manage the ssh-agent process. The package should be set up to run automatically for shells but I have changed the UserSetupEnvironment script in order to be available to apps launched via Tracker. With this in place, I can launch KeePassXC using QuickLaunch and then KeePassXC will insert ssh keys from my database into the ssh-agent. From there I can user other apps which need the keys, such as GittyUp.

From my ~/config/settings/boot/UserSetupEnvironment ...

[[ -s /system/data/profile.d/keychain.sh ]] && \
	source /system/data/profile.d/keychain.sh
Last edited 7 weeks ago by augiedoggie (previous) (diff)

comment:7 by jackburton, 6 weeks ago

Thanks! That doesn't seem to fix the issue reported on comment 3, though.

comment:8 by jackburton, 6 weeks ago

Just for the record:

~> env | grep SSH | sort
SSH_AGENT_PID=177
SSH_AUTH_SOCK=/tmp/ssh-yk6yQDeA8NgJ/agent.176

but if I use getenv() from Genio, I get this:

char* auth = getenv("SSH_AUTH_SOCK");
char* pid = getenv("SSH_AGENT_PID");
char *path = getenv("PATH");
LogError("auth: %s", auth);
LogError("pid: %s", pid);
LogError("path: %s", path);

USER: Genio: {E} auth: (null)
USER: Genio: {E} pid: (null)
USER: Genio: {E} path: .:/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/system/non-packaged/bin:/bin:/boot/system/apps:/boot/system/preferences

So these SSH_AUTH_SOCK and SSH_AGENT_PID are not exported into other apps environment ?

Last edited 6 weeks ago by jackburton (previous) (diff)

comment:9 by jackburton, 6 weeks ago

These are the results when launching from Terminal, instead:

USER: Genio: {E} auth: /tmp/ssh-yk6yQDeA8NgJ/agent.176
USER: Genio: {E} pid: 177
USER: Genio: {E} path: .:/boot/home/config/non-packaged/bin:/boot/home/config/bin:/boot/system/non-packaged/bin:/bin:/boot/system/apps:/boot/system/preferences

Note: See TracTickets for help on using tickets.