Closed XerockXMG closed 1 year ago
After some messing around with various things, I managed to get this to work on Rocky8 Headless.
I had to install gnome-keyring
and dbus
I added the following to my ~/.bash_profile
# set dbus for remote SSH connections
if [ -n "$SSH_CLIENT" -a -n "$DISPLAY" ]; then
machine_id=$(LANGUAGE=C hostnamectl|grep 'Machine ID:'| sed 's/^.*: //')
x_display=$(echo $DISPLAY|sed 's/^.*:\([0-9]\+\)\(\.[0-9]\+\)*$/\1/')
dbus_session_file="$HOME/.dbus/session-bus/${machine_id}-${x_display}"
if [ -r "$dbus_session_file" ]; then
export $(grep '^DBUS.*=' "$dbus_session_file")
# check if PID still running, if not launch dbus
ps $DBUS_SESSION_BUS_PID | tail -1 | grep dbus-daemon >& /dev/null
[ "$?" != "0" ] && export $(dbus-run-session) >& /dev/null
else
export $(dbus-run-session) >& /dev/null
fi
fi
I then had to run the following command
gnome-keyring-unlock --unlock --replace
When you run this command, you will be taken to the next line with what seems like nothing happening. You are in the stdin prompt for gnome-keyring. Type your unlock password here and hit Enter. Then press "Ctrl + D" to tell it you are done with input. You should get a message about it replacing the daemon.
If you get an error about a directory not being found like /root/.local/share/keyrings
, make the directory manually.
The final piece of getting this to run headless was to modify /cmd/constants.go
to change the keyring it tries to use from ipatool-auth.service
to login
as you can only unlock the default keyring while running headless.
After modifying that and building from source, I am now able to run ipatool headless without an issue thus far.
What happened?
Attempting to get this to run on a headless Linux system, but keep bumping into the following error:
I've tried a few different methods of attempting to mimic a Desktop instance, but still hitting it. Figured that
--non-interactive
would bypass this, but doesn't seem to.Version
2.0.3
Relevant log output