Firstly, your service should be a user service instead. System services cannot open a terminal to do what you want. If it must be a system service, you'll need to create a method of sending yourself a notification when you log in to the system, so that you can perform the task and restart the service. As a user service though, it will run while you are logged in, and you can use the following method to pop a terminal up when you log in if the service fails to start.
Your service file should have PartOf=graphical-session.target
in the [Unit]
section of the service, and Restart=always
in [Service]
with your ExecStart=
pointing to a shell script which runs
/home/adamfg/bin/unison default || gnome-terminal -e "bash -c 'genkey_command && exit 1'"
Or similar. This will cause your service to start when you log into the graphical session, and if it fails, open a terminal with genkey_command
awaiting input, but will always exit 1, causing the service to restart after generating the new key.
You could also make the shell script more complex so it starts directly instead of relying on systemd service restarting, after generating the new key, and exits cleanly, instead.
cat /etc/systemd/system/unison.service
and if possible the output ofcat /home/adamfg/bin/unison
after removing confidential information like usernames and passwords from the second file. Please edit your question to add that.