You can customize the automatic behavior of the startup script to provide the appliance with custom functionality
Define the following parameters in the file:
/etc/sysconfig/applogic_init
You can modify the existing file or, if needed, create a new file. If the file /etc/sysconfig/applogic_init is present, the APK init script reads it as a shell include script with the "." command. If not present, it is simply skipped.
Important: The /etc/sysconfig/applogic_init file is executed before any configuration data is retrieved or applied. The script cannot rely on the presence of any appliance configuration files. Do not use this file for executing initialization code. Use the file only for defining the following configuration variables.
Example /etc/sysconfig/applogic_init:
APK_CONFIG_FILES=/etc/httpd/conf.d/myconfig.conf APK_AUTH_KEY_PATH=/root/.ssh/alternate_keys
For additional information on the appliance startup scripts, refer to Appliance Startup and Hooks in the Tie Boundary to Interior section of this guide. For instructions on creating, configuring, and finalizing appliances, begin with the Appliance Overview section. The overview provides procedures and diagrams as well as the concepts about appliance creation.
You can define the following parameters:
|
Parameter |
Description |
|
APK_AUTH_KEY_PATH |
Location in which to store the appliance SSH access public key. The 3t comp ssh command connects to appliances using the matching private key. Default is /root/.ssh. If set to an empty string, the key will not be stored anywhere. If the specified value is an existing directory, the key will be stored in a file named $APK_AUTH_KEY_PATH/authorized_keys Otherwise, it is assumed to be a literal file name where the key should be stored. If the specified location is an existing file, its owner and permissions will be preserved. Otherwise the file will be created with owner root. |
|
APK_CONFIG_FILES |
Space separated list of files to which to apply appliance properties. An appliance using the APK will use the APK_CONFIG_FILES list located on the appliance itself, not the list specified in the GUI. If the appliance is not using the APK, this replaces the config file list specified in the Modify Boundary dialog in the Infrastructure Editor of the GUI. Important: If installing the APK in an existing appliance, verify the configuration files in the class descriptor. The class descriptor is located on the Config Files tab of the Modify Boundary dialog in the Infrastructure Editor. Transfer the list of files to the APK_CONFIG_FILES setting in the appliance. |
|
APK_CONFIG_DNS |
Setting this parameter controls updates of the system name resolver configuration. Values:
|
|
APK_HOSTNAME_UPDATE |
Setting this parameter to No disables the default behavior of changing the hostname or computer name to a string derived from the instance name of the appliance. Disabling the automatic hostname change may be desirable for Virtual Private or Dedicated Server appliances, where the appliance owner maintains all aspects of its configuration, including the hostname. |
|
APK_AUTOMOUNT |
Setting this parameter to No disables the automatic assignment of drive letters or mount points, as specified in the appliance class. This also disables all volume state checks in APK. Important! This option must be used if the appliance is outfitted with a CD-ROM device configured by assigning an ISO-formatted image as one of its virtual disks. The APK auto-mounting does not work in this combination and will cause the appliance start to fail. |
Appliance Post-start Check
If the file /etc/sysconfig/applogic_appliance or \applogic\config\applogic_appliance is present, the APK late init script reads it as a shell include script with the "." command, after all other services on the appliance have been started. The return status from the script indicates whether the appliance is to be considered started OK or failed.
If the script prints a message to stderr and returns an error, the last line from this message is used as the error message sent to the controller.
Example post-start check file for a web server appliance. This verifies that the server is up and responds to HTTP GET to the home page:
if ! wget -q -O /dev/null http://localhost/ ; then echo "start failed - web server is not responding" >&2 return 1 fi return 0
Avoid using /etc/sysconfig/applogic_appliance as startup script to launch appliance services. This prevents your setup from being used or tested outside of an appliance which has APK installed.
Important: In Windows, the applogic_appliance post-start check is initiated after the Windows SCM (service control manager) has loaded all services - NOT when they have completed initializing. This is different from other platforms supported by the APK.
In Windows, some services are started by other services using an API call, rather than as an explicit dependency. These cannot be accounted for simply by waiting on the automatic services load completion event. Any 'startup check' code added to the /etc/sysconfig/applogic_appliance file must account for this and wait for any services that it needs to monitor in case they have not yet initialized.
|
Copyright © 2013 CA Technologies.
All rights reserved.
|
|