You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Launch Agents' behavior has been changed in the new version of macOS 13 Ventura.
Upon the network configuration change, the locationchanger script gets running several times: one time under the root user and the other time under the user registered the Launch Agent.
In case the ~/.locations/locations.conf configuration file is used to define an alias for a wireless network, the run under the root user doesn't see it because the CONFIG_FILE=$HOME/.locations/locations.conf path in case of root user gets resolved to /.locations/locations.conf which doesn't exist.
This leads to the "Automatic" location being resolved for the root user; therefore, the location gets changed back and forth from Automatic to the one specified in the ~/.locations/locations.conf.
I fixed it by moving the configuration file to /usr/local/etc/.locations/location.conf making it accessible for all the users, though it's not what would fit the original design.
The other way to fix it could be that the runs under the root user just get simply ignored. This wasn't an option for me because upon location change I got to re-route IP traffic and sudo is required for that. I could've done it with sudoers and more custom scripts though.
In summary, I suggest the latter for the amendments to the implementation.
Cheers ✌🏻
Ed
The text was updated successfully, but these errors were encountered:
gileswells
added a commit
to gileswells/locationchanger
that referenced
this issue
Dec 20, 2022
Launch Agents' behavior has been changed in the new version of macOS 13 Ventura.
Upon the network configuration change, the
locationchanger
script gets running several times: one time under theroot
user and the other time under the user registered the Launch Agent.In case the
~/.locations/locations.conf
configuration file is used to define an alias for a wireless network, the run under theroot
user doesn't see it because theCONFIG_FILE=$HOME/.locations/locations.conf
path in case ofroot
user gets resolved to/.locations/locations.conf
which doesn't exist.This leads to the "Automatic" location being resolved for the
root
user; therefore, the location gets changed back and forth from Automatic to the one specified in the~/.locations/locations.conf
.I fixed it by moving the configuration file to
/usr/local/etc/.locations/location.conf
making it accessible for all the users, though it's not what would fit the original design.The other way to fix it could be that the runs under the
root
user just get simply ignored. This wasn't an option for me because upon location change I got to re-route IP traffic and sudo is required for that. I could've done it withsudoers
and more custom scripts though.In summary, I suggest the latter for the amendments to the implementation.
Cheers ✌🏻
Ed
The text was updated successfully, but these errors were encountered: