Main BLOGGER
Google
WWW THIS BLOG
Wednesday, June 14, 2006
 
generic wrapper for logger

Ggeneralized the service wrapper script that does stdout+err redirection to a file

It's literally 3-4 dead simple lines of code

 

ServiceWrapper (must be made executable with something like chmod a+x ServiceWrapper)

 

#!/bin/bash -f
# -f: do not source .bashrc (for speed)
# Alain Andrieux, Platform

 

# Wrapper script for stdout/err redirection, service troubleshooting, etc...

# To use this wrapper instead of the service executable:
# 1) specify the startCmd of the service in the application profile as such:
# startCmd="${SOAM_DEPLOY_DIR}/ServiceWrapper MyServiceExecutable"
# 2) package this file along with the service executable
#
# To stop using this script, simply change the
# service startCmd in the app profile back to:
# startCmd="${SOAM_DEPLOY_DIR}/MyServiceExecutable"

 

serviceExeName=$1

shift

outputFile=$SOAM_HOME/work/$serviceExeName.$HOSTNAME.log

# The service deployment dir is in the PATH, so no need for absolute path
$serviceExeName $* >> $outputFile 2>&1

 

# Note:
# If the service executable name is ommitted or incorrect, the following kind of# error message will appear in the SIM log:
# 2006-06-14 16:57:36.399 GMT ERROR [22435:35433392] sim.backend.ServiceBroker - [-905929660] (1, 10, 40004)  SimBasicSiAdaptor.cpp:461   Domain <Application>: Failed to start the service instance, service name /home/sc49285/soam/deploy/PLGridService 1.0.v8/ServiceWrapper. The service startCmd command specified in the Application Profile terminated unexpectedly with exit code: 0 State:Exit. Check your Application Profile, whether the services dependent libraries can load and your service code.

 




<< Home

Powered by Blogger

Google
WWW THIS BLOG