|
From: Holger D. <hol...@um...> - 2011-12-09 15:09:32
|
I've tried changing the upstart script to launch the wrapper with "start" instead of "launchdinternal". Didn't work.
Digging through the wrapper shell script I found that:
'start')
if [ "$DIST_OS" = "macosx" -a -f "/Library/LaunchDaemons/${APP_PLIST}" ] ; then
macosxstart
elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then
checkUser touchlock "$@"
upstartstart
else
checkUser touchlock "$@"
if [ ! -n "$FIXED_COMMAND" ] ; then
shift
fi
start "$@"
fi
;;
where for upstart configurations it will run:
checkUser touchlock "$@"
upstartstart
where checkUser relaunches the wrapper shell script as the user I intend the script to run as then exits the first iteration without calling upstartstart -- at least that's how I interpret the code.
The next iteration -- now running as the intended user -- calls checkUser again, but nothing will happen as the script is already running under the intended user account.
It proceeds to upstartstart, but here it fails because the user running the script is no longer "root". And even if it would succeed past the "root" test, upstartstart just would try to launch /sbin/start <script> again instead of actually starting the wrapper application. The way I understand it, there's a flaw in this logic.
I would omit this condition completely:
elif [ "$DIST_OS" = "linux" -a -f "/etc/init/${APP_NAME}.conf" ] ; then
checkUser touchlock "$@"
upstartstart
and only distinguish between macos start and everything else.
Why would starting the wrapper daemon with upstart be any different from starting it by any other means?
Does anyone have any thoughts?
Thank you,
Holger
Holger Dippel
Assistant Director for Infrastructure Integration
University of Massachusetts Dartmouth
285 Old Westport Road • North Dartmouth, MA 02747
508-999-9181 • hol...@um... http://www.umassd.edu/
CITS will never ask you for your password or other confidential information via email. Beware of phishing scams where email and/or malicious web sites try to trick users into entering their username and password.
For more information about password security please visit: http://www.umassd.edu/cits/security/
----- Original Message -----
From: "Holger Dippel" <hol...@um...>
To: wra...@li...
Sent: Friday, December 9, 2011 9:04:56 AM
Subject: Ubuntu Upstart default script launches wrapper with "launchdinternal" option?
Good morning,
I am experimenting with the community edition of the wrapper to launch the Grouper Loader as a system service.
After installing and launching the script as upstart service on Ubuntu with the default upstart settings for wrapper, I checked the running processes and was surprised that all wrapper processes run as root.
Digging a little deeper I figured out that the wrapper is started with the "launchdinternal" option. In the wrapper shell script "launchdinternal" does not call the checkUser function. Also, "launchd" is MacOS X specific.
Why would the "install" option of the wrapper script detect Ubuntu correctly, but then install a default upstart script that's MacOS X specific?
Does anyone have an Ubuntu specific upstart script for the wrapper?
Thank you,
Holger Dippel
Holger Dippel
Assistant Director for Infrastructure Integration
University of Massachusetts Dartmouth
285 Old Westport Road • North Dartmouth, MA 02747
508-999-9181 • hol...@um... http://www.umassd.edu/
|