4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL)". You may
6 # only use this file in accordance with the terms of the CDDL.
8 # A full copy of the text of the CDDL should have accompanied this
9 # source. A copy of the CDDL is also available via the Internet at
10 # http://www.illumos.org/license/CDDL.
14 # Copyright 2011 EveryCity Ltd. All rights reserved.
17 .
/lib
/svc
/share
/smf_include.sh
19 # Set a reasonable ulimit
22 # Allow more than 256 file descriptors on Solaris 10 32bit
23 # See the following URL for a full description:
24 # http://developers.sun.com/solaris/articles/stdio_256.html
25 # export LD_PRELOAD_32=/usr/lib/extendedFILE.so.1
28 NGINX_ETC_ROOT
=/etc
/nginx
36 svcprop
-q -p $1 ${SMF_FMRI}
37 if [ $?
-eq 0 ] ; then
38 PROPVAL
=`svcprop -p $1 ${SMF_FMRI}`
39 if [ "${PROPVAL}" = "\"\"" ] ; then
47 getprop httpd
/config_dir
48 if [ "${PROPVAL}" != "" ] ; then
49 NGINX_ETC_ROOT
=$PROPVAL
52 NGINX_HOME
=${NGINX_USR_ROOT}
53 NGINX_BIN
=${NGINX_HOME}/sbin
55 getprop httpd
/startup_options
56 if [ "${PROPVAL}" != "" ] ; then
57 echo startupoptions
set
59 STARTUP_OPTIONS
="${PROPVAL} -k"
62 # Export NGINX_ETC_ROOT as an environment variable for use in config files
63 export NGINX_ETC_ROOT
="${NGINX_ETC_ROOT}"
67 ${NGINX_BIN}/nginx ${STARTUP_OPTIONS} -c ${NGINX_ETC_ROOT}/nginx.conf
2>&1
70 echo "Usage: $0 {start}"
71 exit $SMF_EXIT_ERR_CONFIG
77 echo "Server failed to start. Check the error log (defaults to ${NGINX_USR_ROOT}/var/nginx/logs/error_log) for more information, if any."
78 exit $SMF_EXIT_ERR_FATAL