Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8cd36ce204
Fetching contributors…

Cannot retrieve contributors at this time

executable file 59 lines (46 sloc) 1.916 kb
#!/bin/bash
#
# Copyright (c) 2010 Joyent Inc., All rights reserved.
#
set -e
SVCCFG="${ROOT}/projects/illumos/usr/src/cmd/svc/svccfg/svccfg-native"
rdmnt=$1
if [ -z "${rdmnt}" ] || [ ! -d "${rdmnt}" ]; then
echo "FATAL: Invalid ramdisk root '${rdmnt}'"
echo "Usage: $0 <rdmnt>"
exit 1
fi
if [ -z "${ROOT}" ]; then
echo "FATAL: ROOT not specified"
exit 1
fi
if [[ ! -x ${SVCCFG} ]]; then
echo "FATAL: Missing svccfg-native binary from illumos build looked in '${SVCCFG}'"
exit 1
fi
# TODO check that we're root
REPO_DB=${rdmnt}/etc/svc/repository.db
export SVCCFG_CHECKHASH=1
export PKG_INSTALL_ROOT=${rdmnt}
export SVCCFG_DTD=${rdmnt}/usr/share/lib/xml/dtd/service_bundle.dtd.1
export SVCCFG_REPOSITORY=${REPO_DB}
export SVCCFG_CONFIGD_PATH=/lib/svc/bin/svc.configd
${SVCCFG} -v repository ${REPO_DB}
${SVCCFG} -v add smf/manifest
${SVCCFG} -v import ${rdmnt}/lib/svc/manifest
${SVCCFG} -s "system/boot-config:default" setprop config/fastreboot_default=false
${SVCCFG} -s "system/auditd:default" setprop general/enabled=true
${SVCCFG} -s "system/coreadm:default" setprop config_params/global_enabled=true
${SVCCFG} -s "system/coreadm:default" setprop config_params/global_pattern='/%Z/cores/core.%f.%p'
# These two are only for use in zones.
${SVCCFG} -s "smartdc/mdata:fetch" setprop general/enabled=false
${SVCCFG} -s "smartdc/mdata:execute" setprop general/enabled=false
# ${SVCCFG} -s "system/manifest-import" setprop start/exec=:true
${SVCCFG} -v apply ${rdmnt}/etc/svc/profile/generic.xml
${SVCCFG} -v apply ${rdmnt}/etc/svc/profile/platform.xml
# rcap imports with enabled=false, but applying generic.xml enables it.
${SVCCFG} -s "rcap:default" setprop general/enabled=false
# make sure mail svcs enabled after we've applied generic.xml
${SVCCFG} -s "network/smtp:sendmail" setprop general/enabled=true
${SVCCFG} -s "network/sendmail-client:default" setprop general/enabled=true
exit 0
Jump to Line
Something went wrong with that request. Please try again.