Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using launchctl in postflight scripts



I need to start both a daemon and agent process using launchctl, but my postinstall/postupgrade scripts run as root.

You can use the environment variables set for the script. My agent preinstall script is given below for example.


Keith


#!/bin/sh

if [ -f /Library/LaunchAgents/dawnAlarma.plist ]; then
su $USER -c 'launchctl unload /Library/LaunchAgents/ com.buoy.dawnAlarma.plist'
fi


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/installer-dev/email@hidden

This email sent to email@hidden
References: 
 >using launchctl in postflight scripts (From: Shaun Wexler <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.