Giter VIP home page Giter VIP logo

Comments (9)

gniemetz avatar gniemetz commented on September 11, 2024

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 the WatchPath 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.

gniemetz avatar gniemetz commented on September 11, 2024

Any updates on this?

from automount.

 avatar commented on September 11, 2024

Sorry for the delay! I was travelling since last week and just returned home. Will try it tonight!

from automount.

 avatar commented on September 11, 2024

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.

 avatar commented on September 11, 2024

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.

gniemetz avatar gniemetz commented on September 11, 2024

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.

 avatar commented on September 11, 2024

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.

screenshot 2017-02-22 11 08 22

from automount.

gniemetz avatar gniemetz commented on September 11, 2024

It seems it tricky to solve this problem :)

Maybe http://superuser.com/a/626919/325746 could help (only the watchpaths)?

from automount.

gniemetz avatar gniemetz commented on September 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.