The next few sections discuss starting and stopping the Maestro Project Server.
To start Maestro, execute the following in a command window:
[maestro_home]/projectserver/bin/maestro.bat console
If you want to add Maestro as a service in Windows, execute:
[maestro_home]/projectserver/bin/maestro.bat install
Note: This can be done before or after Maestro is running.
Once Maestro is installed as a service and its Startup Type is Manual, you can start the Maestro Project Server service by typing:
[maestro_home]/projectserver/bin/maestro.bat start
By default, the Startup Type of the installed service is Automatic. You can change this by following the steps below:
Also by default, a service runs with the system user that doesn't have a home directory. If you want to use your own settings.xml and run the service with your user, you need to configure the service with your user. To do this:
The Maestro startup script is found in [maestro_home]/projectserver/bin/. To start Maestro, you may execute any of the following steps:
The maestro script for UNIX systems (Linux, Solaris, and Mac OS) have the following options in addition to the start and stop options discussed in the above sections.
If you start Maestro on a UNIX system and it starts, but immediately shuts itself down make sure your UNIX hostname is configured properly. Then start Maestro again.
To install Maestro as a Linux service, just follow the steps below. Take note that you need to execute them as root.
Create a maestro file under /etc/init.d/ with the following content. Replace maestro_user with the name of an account that you have already created. In the script below, the Maestro binaries were unpacked in /opt.
#!/bin/sh MAESTRO_HOME=/opt/maestro-2.3.1 su - maestro_user -c "$MAESTRO_HOME/projectserver/bin/maestro console $@ &"
ln -s /usr/local/maestro-[VERSION]/projectserver/bin/maestro /etc/init.d/maestro
In the above command, the Maestro binaries were assumed to be unpacked at /usr/local. At this point, Maestro is ready to be symlinked from different runlevels. To create these links, just run this as root:
update-rc.d -n maestro defaults 80
After running this command, you will something similar to this:
Adding system startup for /etc/init.d/maestro ... /etc/rc0.d/K80maestro -> ../init.d/maestro /etc/rc1.d/K80maestro -> ../init.d/maestro /etc/rc6.d/K80maestro -> ../init.d/maestro /etc/rc2.d/S80maestro -> ../init.d/maestro /etc/rc3.d/S80maestro -> ../init.d/maestro /etc/rc4.d/S80maestro -> ../init.d/maestro /etc/rc5.d/S80maestro -> ../init.d/maestro
These are the symlinks that would be created. The above command didn't actually create anything because of the -n switch. Remove that switch and run the command again to have the actual links created.
Configuring Maestro on a RedHat-based system (like Fedora Core) is a bit different from the above. Instead of running update-rc.d, you need to add a new service using the chkconfig command. In order to add Maestro using this command, you would need to add some comments to the /etc/rc.d/init.d/maestro script and run a number of commands. These tasks are executed by running the chkconfig_install.sh script below. Take note that maestro_user needs to be replaced by the name of an account you have already created.
#! /bin/sh
# figure out Maestro's directory
MAESTRO_HOME=`dirname $0`
cd ${MAESTRO_HOME}
MAESTRO_HOME=`pwd`
INITD_SCRIPT=/etc/rc.d/init.d/maestro
if [ -f ${INITD_SCRIPT} ]
then
echo "File ${INITD_SCRIPT} already exists. Please remove it and try again."
exit 1
fi
echo "Creating file ${INITD_SCRIPT}"
cat >> ${INITD_SCRIPT} <<EOF
#! /bin/sh
# chkconfig: 345 90 10
# description: Maestro server
# uncoment to set JAVA_HOME as the value present when Maestro is installed
#export JAVA_HOME=${JAVA_HOME}
if [ -z "\${JAVA_HOME}" ]
then
echo "Cannot manage Maestro without variable JAVA_HOME set"
echo " (try to set it on file ${INITD_SCRIPT})"
exit 1
fi
# run Maestro as root
cd ${MAESTRO_HOME}
./bin/maestro \$*
# run Maestro as user _maestro_user_
#su - _maestro_user_ -c "cd ${MAESTRO_HOME}; ./bin/maestro \$*"
EOF
chmod +x ${INITD_SCRIPT}
echo "Adding Maestro to chkconfig"
chkconfig --add maestro
echo "Enabling Maestro on chkconfig"
chkconfig maestro on
echo "Maestro set to start on run levels 3, 4 and 5."
echo "To start Maestro now, run 'service maestro start'"
To install Maestro as a service in MacOSX, just add the snippet below to /Library/LaunchDaemons/com.maestrodev.maestro.plist, where the value /Applications/Maestro/maestro-2.3.1/projectserver/bin/maestro below is the path to the Maestro startup script. Make sure that you are pointing to the correct location.
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.maestrodev.maestro</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Applications/Maestro/maestro-2.3.1/projectserver/bin/maestro</string>
<string>console</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Maestro Project Server</string>
</dict>
</plist>
If you manually installed the binary distribution of Maestro, added it as a Windows service and it is currently running in the background, you can stop it from the Windows Control Panel > Administrative Tools > Services. Choose the Maestro Project Server service and click Stop. Or you can open a console and execute:
[maestro_home]/projectserver/bin/maestro.bat stop
If you started the Maestro Project Server by executing [maestro_home]/projectserver/bin/maestro.bat console:
On Windows command line: press Ctrl+C to stop the process, and then answer "y" to the "Terminate batch job (Y/N)" question.
Note: Whether you answer Y or N, Maestro will terminate.
To stop Maestro Project Server service on UNIX type:
./[maestro_home]/projectserver/bin/maestro stop
where [maestro_home] is the directory in which Maestro was installed.
If you started the Maestro Project Server by executing ./[maestro_home]/projectserver/bin/maestro console, press Ctrl+C to stop the process.