Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

HEAD-427 separate config into a 'config' and a 'config.inc/defaults' …

…files
  • Loading branch information...
commit 14a8e6016b5cc498bc93a7299a9041cbab5daa55 1 parent 98f7f74
@jjelinek jjelinek authored
View
4 manifest
@@ -1601,7 +1601,7 @@ f lib/svc/manifest/system/ibsrp/target.xml 0444 root sys
f lib/svc/manifest/system/identity.xml 0444 root sys
f lib/svc/manifest/system/idmap.xml 0444 root sys
f lib/svc/manifest/system/intrd.xml 0444 root sys
-f lib/svc/manifest/system/joyinit.xml 0444 root sys
+f lib/svc/manifest/system/smartdc-init.xml 0444 root sys
f lib/svc/manifest/system/keymap.xml 0444 root sys
f lib/svc/manifest/system/labeld.xml 0444 root sys
f lib/svc/manifest/system/logadm-upgrade.xml 0444 root sys
@@ -1687,6 +1687,7 @@ f lib/svc/method/sendmail-client 0555 root sys
f lib/svc/method/slp 0555 root sys
f lib/svc/method/smartdc-beacon 0555 root bin
f lib/svc/method/smartdc-config 0555 root bin
+f lib/svc/method/smartdc-init 0555 root sys
f lib/svc/method/smartdc-ur 0555 root bin
f lib/svc/method/smb-client 0555 root sys
f lib/svc/method/smtp-sendmail 0555 root sys
@@ -1710,7 +1711,6 @@ f lib/svc/method/svc-hostid 0555 root bin
f lib/svc/method/svc-hotplug 0555 root bin
f lib/svc/method/svc-ii 0744 root sys
f lib/svc/method/svc-intrd 0555 root sys
-f lib/svc/method/svc-joyinit 0555 root sys
f lib/svc/method/svc-labeld 0555 root sys
f lib/svc/method/svc-legacy-routing 0555 root bin
f lib/svc/method/svc-lms 0555 root sys
View
15 overlay/lib/sdc/config.sh
@@ -53,7 +53,9 @@ function sdc_config_keys_contain {
search=$1
load_sdc_config_filename
if [[ -f ${SDC_CONFIG_FILENAME} ]]; then
- matches=$((cat ${SDC_CONFIG_FILENAME}; echo "config_inc_dir=${SDC_CONFIG_INC_DIR}") | sed -e "s/^ *//" | grep -v "^#" | grep "^[a-zA-Z]" | sed -e "s/=.*//" | grep $search | wc -l)
+ matches=$((cat ${SDC_CONFIG_FILENAME} ${SDC_CONFIG_INC_DIR}/generic; echo "config_inc_dir=${SDC_CONFIG_INC_DIR}") | \
+ sed -e "s/^ *//" | grep -v "^#" | grep "^[a-zA-Z]" | \
+ sed -e "s/=.*//" | grep $search | wc -l)
if [[ $matches -eq 0 ]]; then
echo false
else
@@ -68,7 +70,9 @@ function sdc_config_keys_contain {
function sdc_config_keys {
load_sdc_config_filename
if [[ -f ${SDC_CONFIG_FILENAME} ]]; then
- keys=$((cat ${SDC_CONFIG_FILENAME}; echo "config_inc_dir=${SDC_CONFIG_INC_DIR}") | sed -e "s/^ *//" | grep -v "^#" | grep "^[a-zA-Z]" | sed -e "s/=.*//")
+ keys=$((cat ${SDC_CONFIG_FILENAME} ${SDC_CONFIG_INC_DIR}/generic; echo "config_inc_dir=${SDC_CONFIG_INC_DIR}") | \
+ sed -e "s/^ *//" | grep -v "^#" | grep "^[a-zA-Z]" | \
+ sed -e "s/=.*//")
fi
echo "${keys}"
}
@@ -86,9 +90,12 @@ function load_sdc_config {
fi
load_sdc_config_filename
- # Ignore comments, spaces at the beginning of lines and lines that don't start with a letter.
+ # Ignore comments, spaces at the beginning of lines and lines that don't
+ # start with a letter.
if [[ -f ${SDC_CONFIG_FILENAME} ]]; then
- eval $((cat ${SDC_CONFIG_FILENAME}; echo "config_inc_dir=${SDC_CONFIG_INC_DIR}") | sed -e "s/^ *//" | grep -v "^#" | grep "^[a-zA-Z]" | sed -e "s/^/${prefix}/")
+ eval $((cat ${SDC_CONFIG_FILENAME} ${SDC_CONFIG_INC_DIR}/generic; echo "config_inc_dir=${SDC_CONFIG_INC_DIR}") | \
+ sed -e "s/^ *//" | grep -v "^#" | grep "^[a-zA-Z]" | \
+ sed -e "s/^/${prefix}/")
elif [[ ${headnode} == "true" ]]; then
echo "FATAL: Unable to load headnode config."
exit 1
View
65 overlay/lib/svc/manifest/system/smartdc-config.xml
@@ -43,6 +43,17 @@
<single_instance />
+ <!--
+ dependency/dependent info
+ We need to wait for fs-joyent to be done so we can access the USB key
+ We need to run before sysconfig so interactive configuration can talk
+ on the console
+ (sysconfig)
+ We don't want anything else running which spews on console
+ (system/identy)
+ We don't want manifest import scribbling on the console while running
+ (manifest-import)
+ -->
<dependency
name='filesystem-joyent'
type='service'
@@ -51,21 +62,45 @@
<service_fmri value='svc:/system/filesystem/smartdc' />
</dependency>
- <!-- We don't want ssh starting if we haven't updated the passwords/keys -->
- <dependent
- name='ssh_multi-user-server'
- grouping='require_all'
- restart_on='none'>
- <service_fmri value='svc:/network/ssh' />
- </dependent>
-
- <!-- Make ntp wait so we can setup the config. -->
- <dependent
- name='ntp'
- grouping='require_all'
- restart_on='none'>
- <service_fmri value='svc:/network/ntp' />
- </dependent>
+ <!--
+ We don't want ssh starting if we haven't updated the passwords/keys
+ -->
+ <dependent
+ name='ssh_multi-user-server'
+ grouping='require_all'
+ restart_on='none'>
+ <service_fmri value='svc:/network/ssh' />
+ </dependent>
+
+ <!-- Make ntp wait so we can setup the config. -->
+ <dependent
+ name='ntp'
+ grouping='require_all'
+ restart_on='none'>
+ <service_fmri value='svc:/network/ntp' />
+ </dependent>
+
+ <dependent
+ name='headnode_config'
+ grouping='optional_all'
+ restart_on='none'>
+ <service_fmri value='svc:/milestone/sysconfig' />
+ </dependent>
+
+ <dependent
+ name='identity'
+ grouping='optional_all'
+ restart_on='none'>
+ <service_fmri value='svc:/system/identity:node' />
+ </dependent>
+
+ <dependent
+ name='headnode_no_output'
+ grouping='optional_all'
+ restart_on='none'>
+ <service_fmri value='svc:/system/manifest-import' />
+ </dependent>
+
<exec_method
type='method'
View
21 overlay/lib/svc/manifest/system/joyinit.xml → .../lib/svc/manifest/system/smartdc-init.xml
@@ -45,13 +45,16 @@
<single_instance />
<!--
- Ideally we would define the system/zones svc to be dependent on this
- svc so that we run before system/zones. However, we cannot create
- that dependency since the system/zones svc already exists in the
- template repo and we'll get an error during early manifest import when
- this svc is imported. Thus, we'll just use the zone autoboot logic
- directly in our start method and have a dependency on the zones svc so
- that there is no race condition booting the zones.
+ dependency info
+ This depends on the system/zones svc which seems weird since that
+ svc runs late in boot because it depends on milestone/multi-user-server.
+ Our svc does the initial setup of the infrastructure zones on the
+ headnode so we need the system/zones svc to run first so that we can
+ install and boot the infrastructure zones. The reason this seems
+ weird is that this svc also sets up the zpool when we first boot,
+ before we reboot to install the infrastructure zones, so it might seem
+ like it should run early in boot, but it can't because of the zone
+ issue described above.
-->
<dependency
name='zones'
@@ -64,14 +67,14 @@
<exec_method
type='method'
name='start'
- exec='/lib/svc/method/svc-joyinit %m'
+ exec='/lib/svc/method/smartdc-init %m'
timeout_seconds='0'>
</exec_method>
<exec_method
type='method'
name='stop'
- exec='/lib/svc/method/svc-joyinit %m'
+ exec='/lib/svc/method/smartdc-init %m'
timeout_seconds='60'>
</exec_method>
View
0  overlay/lib/svc/method/svc-joyinit → overlay/lib/svc/method/smartdc-init
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.