I am having trouble connecting to my university’s VPN. I am using the Cisco anyconnect client. The client creates the following vpnagentd.service which fails on system startup:
I found in the logs that the service does not find the file /etc/environment.
After a little research I came across a reddit post that says the file was removed after a December update. The question now is, where did the file go or how else can I pass the environment file to the service?
P.S.: before the December update the client was working. Therefore I suspect that the EnvironmentFile line is causing the problem.
Nowhere. This file is still used if it exists. You just cannot and never could assume that it exists, so this unit should have used EnvironmentFile=-/etc/environment to ignore missing file.
What exactly “use” means here? You should not use this file to define your own variables because this file will be unconditionally overwritten on update. And adding your settings to /etc/environment.d will not work with this unit anyway.
I do not know what environment variables are used here, but if it is just for setting a couple of anyconnect specific variables, using unit-sepecific file would be much better.
@Tmax see what @arvidjaar indicated, does it use it? If going to adjust a service file, then also better to copy into /etc/systemd/system so it won’t be overwritten on an update as well.
Me neither. The service file was created by the Cisco installer (third party closed source software). I didn’t touch this file or add anything to it. I only noticed that the service failed because of the missing /etc/environment file.
I don’t know if the service needs any variables at all, and if so, which ones. My /usr/etc/environment file is empty, so I assume that the service does not need any variables.
Since it is not an openSUSE service, it should not be overwritten during a system update. The Unit file is already in /etc/systemd/system.