homebrew-aws icon indicating copy to clipboard operation
homebrew-aws copied to clipboard

The amazon-efs-utils formulae post install steps is the wrong launchd Job

Open thimslugga opened this issue 1 year ago • 0 comments

The amazon-efs-utils formulae provides additional steps on post install. Currently the user is supposed to copy the amazon-efs-mount-watchdog.plist to the /Library/LaunchAgents directory.

issue 1

This should be updated to refer to /Library/LaunchDaemons as LaunchAgents are intended for per-user agents that run on behalf of a user when they they login to the system. LaunchDaemons will run on system startup and without a user logged in to the system.

issue 2

The launchctl load .. and launchctl unload .. commands are considered deprecated and should be updated.

Current:

To enable watchdog for TLS mounts:
  sudo cp #{libexec}/amazon-efs-mount-watchdog.plist /Library/LaunchAgents
  sudo launchctl load /Library/LaunchAgents/amazon-efs-mount-watchdog.plist

To disable watchdog for TLS mounts:
  sudo launchctl unload /Library/LaunchAgents/amazon-efs-mount-watchdog.plist

Updated

To enable watchdog for TLS mounts:
  sudo cp #{libexec}/amazon-efs-mount-watchdog.plist /Library/LaunchDaemons
  sudo launchctl bootstrap system /Library/LaunchDaemons/amazon-efs-mount-watchdog.plist

To disable watchdog for TLS mounts:
  sudo launchctl bootout system /Library/LaunchDaemons/amazon-efs-mount-watchdog.plist

References:

  • https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/Introduction.html
  • https://developer.apple.com/library/archive/technotes/tn2083/_index.html
  • https://wiki.freepascal.org/macOS_daemons_and_agents

thimslugga avatar Sep 30 '23 16:09 thimslugga