Comments (9)
This also happens to me sometimes, unfortunately I don't know how to log the events that trigger the script.
Try this workaround
- Unload LaunchAgent via
sudo launchctl unload ~/Library/LaunchAgents/it.niemetz.automount.plist
- Install the new launchd (without
KeepAlive
and theWatchPath
set to a specific file)
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>it.niemetz.automount</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/automount.sh</string>
<string>--mountall</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist</string>
</array>
</dict>
</plist>
- Load LaunchAgent via
sudo launchctl load ~/Library/LaunchAgents/it.niemetz.automount.plist
from automount.
Any updates on this?
from automount.
Sorry for the delay! I was travelling since last week and just returned home. Will try it tonight!
from automount.
Little update … I couldn't wait and updated on my Macbook. ;-) So far so good. After the first hour, automount just did as supposed to. When I trigger a network event (join/switch wifi, connect/disconnect VPN) the script runs – besides that I don't get any messages.
I will install it on my iMac tonight and report back!
from automount.
Installed it on second Mac last night. After using both machines for the whole evening, it still triggers without obvious reasons, though less often. The Macbook is connected through Wifi, the iMac through ethernet.
Isn't there the possibility to protocol launchd with all triggers/events?
from automount.
Unfortunately i don't know a way to log when or why a script is started via launchd :(
But it should only run when logging in or when the file /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
changes (that is when a network configuration changes).
In your case some process is touching/writing to this file so the script gets triggered, maybe a
fs_usage -w | grep /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
could help
from automount.
When I let fs_usage run, it doesn't generate output when I do manual changes to the network interfaces like switching on/off wifi or changing between static IP and DHCP.
from automount.
It seems it tricky to solve this problem :)
Maybe http://superuser.com/a/626919/325746 could help (only the watchpaths)?
from automount.
Sleepwatcher from http://www.bernhard-baehr.de/ looks promising, i will test it the next days, this could be a solution
from automount.
Related Issues (12)
- Understanding the configuration HOT 3
- Any issues with macOS High Sierra? HOT 1
- Expect scripts return exit code 0 even if command failed
- launchctl status code 1
- Mount commands in the script may need to be changed for Sierra 10.12.3 HOT 1
- macOS Sierra no longer has /Volumes as world writable HOT 9
- /usr/local/bin/automount.sh: line 346: Error Reading File: HOT 21
- Couple problems with ${USER}, ${HOME}, ${LOGINNAME}, etc. HOT 4
- Support for the Domain username HOT 9
- Line 284: declare: PPID: readonly variable HOT 1
- Need help HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from automount.