lib/glance
e263c82e
 #!/bin/bash
 #
73f6f25b
 # lib/glance
6d04fd7b
 # Functions to control the configuration and operation of the **Glance** service
73f6f25b
 
 # Dependencies:
6a5aa7c6
 #
 # - ``functions`` file
 # - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
 # - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined
 # - ``SERVICE_HOST``
 # - ``KEYSTONE_TOKEN_FORMAT`` must be defined
73f6f25b
 
 # ``stack.sh`` calls the entry points in this order:
 #
6a5aa7c6
 # - install_glance
 # - configure_glance
 # - init_glance
 # - start_glance
 # - stop_glance
 # - cleanup_glance
73f6f25b
 
 # Save trace setting
 XTRACE=$(set +o | grep xtrace)
 set +o xtrace
 
 
 # Defaults
 # --------
 
 # Set up default directories
e08ab104
 GITDIR["python-glanceclient"]=$DEST/python-glanceclient
aecd189f
 GITDIR["glance_store"]=$DEST/glance_store
73f6f25b
 GLANCE_DIR=$DEST/glance
aed60792
 
 # Glance virtual environment
 if [[ ${USE_VENV} = True ]]; then
     PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
     GLANCE_BIN_DIR=${PROJECT_VENV["glance"]}/bin
 else
     GLANCE_BIN_DIR=$(get_python_exec_prefix)
 fi
 
73f6f25b
 GLANCE_CACHE_DIR=${GLANCE_CACHE_DIR:=$DATA_DIR/glance/cache}
 GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images}
bc071bce
 GLANCE_AUTH_CACHE_DIR=${GLANCE_AUTH_CACHE_DIR:-/var/cache/glance}
73f6f25b
 
 GLANCE_CONF_DIR=${GLANCE_CONF_DIR:-/etc/glance}
76e3925d
 GLANCE_METADEF_DIR=$GLANCE_CONF_DIR/metadefs
73f6f25b
 GLANCE_REGISTRY_CONF=$GLANCE_CONF_DIR/glance-registry.conf
 GLANCE_API_CONF=$GLANCE_CONF_DIR/glance-api.conf
dd622935
 GLANCE_SEARCH_CONF=$GLANCE_CONF_DIR/glance-search.conf
73f6f25b
 GLANCE_REGISTRY_PASTE_INI=$GLANCE_CONF_DIR/glance-registry-paste.ini
 GLANCE_API_PASTE_INI=$GLANCE_CONF_DIR/glance-api-paste.ini
dd622935
 GLANCE_SEARCH_PASTE_INI=$GLANCE_CONF_DIR/glance-search-paste.ini
73f6f25b
 GLANCE_CACHE_CONF=$GLANCE_CONF_DIR/glance-cache.conf
 GLANCE_POLICY_JSON=$GLANCE_CONF_DIR/policy.json
46d1ba6e
 GLANCE_SCHEMA_JSON=$GLANCE_CONF_DIR/schema-image.json
f4f01c63
 GLANCE_SWIFT_STORE_CONF=$GLANCE_CONF_DIR/glance-swift-store.conf
73f6f25b
 
18d4778c
 if is_ssl_enabled_service "glance" || is_service_enabled tls-proxy; then
     GLANCE_SERVICE_PROTOCOL="https"
 fi
 
73f6f25b
 # Glance connection info.  Note the port must be specified.
18d4778c
 GLANCE_SERVICE_HOST=${GLANCE_SERVICE_HOST:-$SERVICE_HOST}
180f5eb6
 GLANCE_SERVICE_LISTEN_ADDRESS=${GLANCE_SERVICE_LISTEN_ADDRESS:-$SERVICE_LISTEN_ADDRESS}
18d4778c
 GLANCE_SERVICE_PORT=${GLANCE_SERVICE_PORT:-9292}
 GLANCE_SERVICE_PORT_INT=${GLANCE_SERVICE_PORT_INT:-19292}
 GLANCE_HOSTPORT=${GLANCE_HOSTPORT:-$GLANCE_SERVICE_HOST:$GLANCE_SERVICE_PORT}
 GLANCE_SERVICE_PROTOCOL=${GLANCE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
 GLANCE_REGISTRY_PORT=${GLANCE_REGISTRY_PORT:-9191}
 GLANCE_REGISTRY_PORT_INT=${GLANCE_REGISTRY_PORT_INT:-19191}
dd622935
 GLANCE_SEARCH_PORT=${GLANCE_SEARCH_PORT:-9393}
 GLANCE_SEARCH_PORT_INT=${GLANCE_SEARCH_PORT_INT:-19393}
 GLANCE_SEARCH_HOSTPORT=${GLANCE_SEARCH_HOSTPORT:-$GLANCE_SERVICE_HOST:$GLANCE_SEARCH_PORT}
73f6f25b
 
cc6b4435
 # Functions
 # ---------
73f6f25b
 
e4fa7213
 # Test if any Glance services are enabled
 # is_glance_enabled
 function is_glance_enabled {
     [[ ,${ENABLED_SERVICES} =~ ,"g-" ]] && return 0
     return 1
 }
 
73f6f25b
 # cleanup_glance() - Remove residual data files, anything left over from previous
 # runs that a clean run would need to clean up
aee18c74
 function cleanup_glance {
73f6f25b
     # kill instances (nova)
     # delete image files (glance)
995eb927
     sudo rm -rf $GLANCE_CACHE_DIR $GLANCE_IMAGE_DIR $GLANCE_AUTH_CACHE_DIR
dd622935
 
     if is_service_enabled g-search; then
         ${TOP_DIR}/pkg/elasticsearch.sh stop
     fi
73f6f25b
 }
 
 # configure_glance() - Set config files, create data dirs, etc
aee18c74
 function configure_glance {
8421c2b9
     sudo install -d -o $STACK_USER $GLANCE_CONF_DIR $GLANCE_METADEF_DIR
76e3925d
 
73f6f25b
     # Copy over our glance configurations and update them
     cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
03997942
     iniset $GLANCE_REGISTRY_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
180f5eb6
     iniset $GLANCE_REGISTRY_CONF DEFAULT bind_host $GLANCE_SERVICE_LISTEN_ADDRESS
73f6f25b
     inicomment $GLANCE_REGISTRY_CONF DEFAULT log_file
7e79d913
     local dburl=`database_connection_url glance`
ceca15db
     iniset $GLANCE_REGISTRY_CONF database connection $dburl
73f6f25b
     iniset $GLANCE_REGISTRY_CONF DEFAULT use_syslog $SYSLOG
37b779c3
     iniset $GLANCE_REGISTRY_CONF DEFAULT workers "$API_WORKERS"
73f6f25b
     iniset $GLANCE_REGISTRY_CONF paste_deploy flavor keystone
0595237e
     configure_auth_token_middleware $GLANCE_REGISTRY_CONF glance $GLANCE_AUTH_CACHE_DIR/registry
37eca489
     iniset $GLANCE_REGISTRY_CONF DEFAULT notification_driver messaging
2dd110ce
     iniset_rpc_backend glance $GLANCE_REGISTRY_CONF
73f6f25b
 
     cp $GLANCE_DIR/etc/glance-api.conf $GLANCE_API_CONF
03997942
     iniset $GLANCE_API_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
180f5eb6
     iniset $GLANCE_API_CONF DEFAULT bind_host $GLANCE_SERVICE_LISTEN_ADDRESS
73f6f25b
     inicomment $GLANCE_API_CONF DEFAULT log_file
ceca15db
     iniset $GLANCE_API_CONF database connection $dburl
73f6f25b
     iniset $GLANCE_API_CONF DEFAULT use_syslog $SYSLOG
     iniset $GLANCE_API_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
     iniset $GLANCE_API_CONF paste_deploy flavor keystone+cachemanagement
0595237e
     configure_auth_token_middleware $GLANCE_API_CONF glance $GLANCE_AUTH_CACHE_DIR/api
37eca489
     iniset $GLANCE_API_CONF DEFAULT notification_driver messaging
2dd110ce
     iniset_rpc_backend glance $GLANCE_API_CONF
bc2ef929
     if [ "$VIRT_DRIVER" = 'xenserver' ]; then
         iniset $GLANCE_API_CONF DEFAULT container_formats "ami,ari,aki,bare,ovf,tgz"
         iniset $GLANCE_API_CONF DEFAULT disk_formats "ami,ari,aki,vhd,raw,iso"
     fi
19354585
     if [ "$VIRT_DRIVER" = 'libvirt' ] && [ "$LIBVIRT_TYPE" = 'parallels' ]; then
         iniset $GLANCE_API_CONF DEFAULT disk_formats "ami,ari,aki,vhd,vmdk,raw,qcow2,vdi,iso,ploop"
     fi
73f6f25b
 
fe65e2df
     # Store specific configs
     iniset $GLANCE_API_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
180f5eb6
     iniset $GLANCE_API_CONF DEFAULT registry_host $GLANCE_SERVICE_HOST
fe65e2df
 
05bd7b80
     iniset $GLANCE_API_CONF DEFAULT workers "$API_WORKERS"
2f72050a
 
c77b932e
     # Store the images in swift if enabled.
     if is_service_enabled s-proxy; then
fe65e2df
         iniset $GLANCE_API_CONF glance_store default_store swift
         iniset $GLANCE_API_CONF glance_store swift_store_create_container_on_put True
f4f01c63
 
         iniset $GLANCE_API_CONF glance_store swift_store_config_file $GLANCE_SWIFT_STORE_CONF
         iniset $GLANCE_API_CONF glance_store default_swift_reference ref1
fe65e2df
         iniset $GLANCE_API_CONF glance_store stores "file, http, swift"
f4f01c63
 
         iniset $GLANCE_SWIFT_STORE_CONF ref1 user $SERVICE_TENANT_NAME:glance-swift
         iniset $GLANCE_SWIFT_STORE_CONF ref1 key $SERVICE_PASSWORD
19c5e62a
         iniset $GLANCE_SWIFT_STORE_CONF ref1 auth_address $KEYSTONE_SERVICE_URI/v3
         iniset $GLANCE_SWIFT_STORE_CONF ref1 user_domain_id default
         iniset $GLANCE_SWIFT_STORE_CONF ref1 project_domain_id default
         iniset $GLANCE_SWIFT_STORE_CONF ref1 auth_version 3
f4f01c63
 
         # commenting is not strictly necessary but it's confusing to have bad values in conf
         inicomment $GLANCE_API_CONF glance_store swift_store_user
         inicomment $GLANCE_API_CONF glance_store swift_store_key
         inicomment $GLANCE_API_CONF glance_store swift_store_auth_address
c77b932e
     fi
 
18d4778c
     if is_service_enabled tls-proxy; then
         iniset $GLANCE_API_CONF DEFAULT bind_port $GLANCE_SERVICE_PORT_INT
6254d5fd
         iniset $GLANCE_API_CONF DEFAULT public_endpoint $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT
18d4778c
         iniset $GLANCE_REGISTRY_CONF DEFAULT bind_port $GLANCE_REGISTRY_PORT_INT
     fi
 
     # Register SSL certificates if provided
     if is_ssl_enabled_service glance; then
         ensure_certificates GLANCE
 
         iniset $GLANCE_API_CONF DEFAULT cert_file "$GLANCE_SSL_CERT"
         iniset $GLANCE_API_CONF DEFAULT key_file "$GLANCE_SSL_KEY"
 
         iniset $GLANCE_REGISTRY_CONF DEFAULT cert_file "$GLANCE_SSL_CERT"
         iniset $GLANCE_REGISTRY_CONF DEFAULT key_file "$GLANCE_SSL_KEY"
     fi
 
     if is_ssl_enabled_service glance || is_service_enabled tls-proxy; then
         iniset $GLANCE_API_CONF DEFAULT registry_client_protocol https
     fi
 
701276a8
     # Format logging
     if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
1577663f
         setup_colorized_logging $GLANCE_API_CONF DEFAULT tenant user
         setup_colorized_logging $GLANCE_REGISTRY_CONF DEFAULT tenant user
701276a8
     fi
 
73f6f25b
     cp -p $GLANCE_DIR/etc/glance-registry-paste.ini $GLANCE_REGISTRY_PASTE_INI
 
     cp -p $GLANCE_DIR/etc/glance-api-paste.ini $GLANCE_API_PASTE_INI
 
     cp $GLANCE_DIR/etc/glance-cache.conf $GLANCE_CACHE_CONF
03997942
     iniset $GLANCE_CACHE_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
73f6f25b
     inicomment $GLANCE_CACHE_CONF DEFAULT log_file
     iniset $GLANCE_CACHE_CONF DEFAULT use_syslog $SYSLOG
     iniset $GLANCE_CACHE_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
     iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_url
3561d7f9
     iniset $GLANCE_CACHE_CONF DEFAULT auth_url $KEYSTONE_AUTH_URI/v2.0
73f6f25b
     iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_tenant_name
     iniset $GLANCE_CACHE_CONF DEFAULT admin_tenant_name $SERVICE_TENANT_NAME
     iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_user
     iniset $GLANCE_CACHE_CONF DEFAULT admin_user glance
     iniuncomment $GLANCE_CACHE_CONF DEFAULT auth_password
     iniset $GLANCE_CACHE_CONF DEFAULT admin_password $SERVICE_PASSWORD
180f5eb6
     iniset $GLANCE_CACHE_CONF DEFAULT registry_host $GLANCE_SERVICE_HOST
73f6f25b
 
fe65e2df
     # Store specific confs
     iniset $GLANCE_CACHE_CONF glance_store filesystem_store_datadir $GLANCE_IMAGE_DIR/
 
73f6f25b
     cp -p $GLANCE_DIR/etc/policy.json $GLANCE_POLICY_JSON
46d1ba6e
     cp -p $GLANCE_DIR/etc/schema-image.json $GLANCE_SCHEMA_JSON
76e3925d
 
     cp -p $GLANCE_DIR/etc/metadefs/*.json $GLANCE_METADEF_DIR
18d4778c
 
     if is_ssl_enabled_service "cinder" || is_service_enabled tls-proxy; then
         CINDER_SERVICE_HOST=${CINDER_SERVICE_HOST:-$SERVICE_HOST}
         CINDER_SERVICE_PORT=${CINDER_SERVICE_PORT:-8776}
 
         iniset $GLANCE_API_CONF DEFAULT cinder_endpoint_template "https://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/%(project_id)s"
         iniset $GLANCE_CACHE_CONF DEFAULT cinder_endpoint_template "https://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/%(project_id)s"
     fi
dd622935
 
     # Configure search
     if is_service_enabled g-search; then
         cp $GLANCE_DIR/etc/glance-search.conf $GLANCE_SEARCH_CONF
         iniset $GLANCE_SEARCH_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
180f5eb6
         iniset $GLANCE_SEARCH_CONF DEFAULT bind_host $GLANCE_SERVICE_LISTEN_ADDRESS
dd622935
         inicomment $GLANCE_SEARCH_CONF DEFAULT log_file
         iniset $GLANCE_SEARCH_CONF DEFAULT use_syslog $SYSLOG
ceca15db
         iniset $GLANCE_SEARCH_CONF database connection $dburl
dd622935
         iniset $GLANCE_SEARCH_CONF paste_deploy flavor keystone
         configure_auth_token_middleware $GLANCE_SEARCH_CONF glance $GLANCE_AUTH_CACHE_DIR/search
 
         if is_service_enabled tls-proxy; then
             iniset $GLANCE_SEARCH_CONF DEFAULT bind_port $GLANCE_SEARCH_PORT_INT
         fi
         # Register SSL certificates if provided
         if is_ssl_enabled_service glance; then
             ensure_certificates GLANCE
             iniset $GLANCE_SEARCH_CONF DEFAULT cert_file "$GLANCE_SSL_CERT"
             iniset $GLANCE_SEARCH_CONF DEFAULT key_file "$GLANCE_SSL_KEY"
         fi
 
         cp $GLANCE_DIR/etc/glance-search-paste.ini $GLANCE_SEARCH_PASTE_INI
     fi
73f6f25b
 }
 
42a59c2b
 # create_glance_accounts() - Set up common required glance accounts
 
dd622935
 # Project              User            Roles
 # ---------------------------------------------------------------------
 # SERVICE_TENANT_NAME  glance          service
 # SERVICE_TENANT_NAME  glance-swift    ResellerAdmin (if Swift is enabled)
 # SERVICE_TENANT_NAME  glance-search   search (if Search is enabled)
42a59c2b
 
 function create_glance_accounts {
     if is_service_enabled g-api; then
0abde393
 
85ff5323
         create_service_user "glance"
0abde393
 
42a59c2b
         # required for swift access
         if is_service_enabled s-proxy; then
0abde393
 
16ef9760
             local glance_swift_user=$(get_or_create_user "glance-swift" \
9d7e776b
                 "$SERVICE_PASSWORD" "default" "glance-swift@example.com")
9b215db5
             get_or_add_user_project_role "ResellerAdmin" $glance_swift_user $SERVICE_TENANT_NAME
42a59c2b
         fi
0abde393
 
42a59c2b
         if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
0abde393
 
b17ad756
             get_or_create_service "glance" "image" "Glance Image Service"
             get_or_create_endpoint "image" \
0abde393
                 "$REGION_NAME" \
18d4778c
                 "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \
                 "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT" \
                 "$GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT"
42a59c2b
         fi
     fi
dd622935
 
     # Add glance-search service and endpoints
     if is_service_enabled g-search; then
         if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
b17ad756
             get_or_create_service "glance-search" "search" "EXPERIMENTAL - Glance Graffiti Search Service"
dd622935
 
b17ad756
             get_or_create_endpoint "search" \
dd622935
                 "$REGION_NAME" \
                 "$GLANCE_SERVICE_PROTOCOL://$GLANCE_SEARCH_HOSTPORT" \
                 "$GLANCE_SERVICE_PROTOCOL://$GLANCE_SEARCH_HOSTPORT" \
                 "$GLANCE_SERVICE_PROTOCOL://$GLANCE_SEARCH_HOSTPORT"
         fi
     fi
42a59c2b
 }
 
f03bafeb
 # create_glance_cache_dir() - Part of the init_glance() process
aee18c74
 function create_glance_cache_dir {
f03bafeb
     # Create cache dir
dd622935
     sudo install -d -o $STACK_USER $GLANCE_AUTH_CACHE_DIR/api $GLANCE_AUTH_CACHE_DIR/registry $GLANCE_AUTH_CACHE_DIR/search
     rm -f $GLANCE_AUTH_CACHE_DIR/api/* $GLANCE_AUTH_CACHE_DIR/registry/* $GLANCE_AUTH_CACHE_DIR/search/*
f03bafeb
 }
 
73f6f25b
 # init_glance() - Initialize databases, etc.
aee18c74
 function init_glance {
73f6f25b
     # Delete existing images
     rm -rf $GLANCE_IMAGE_DIR
     mkdir -p $GLANCE_IMAGE_DIR
 
     # Delete existing cache
     rm -rf $GLANCE_CACHE_DIR
     mkdir -p $GLANCE_CACHE_DIR
 
f03bafeb
     # (Re)create glance database
157c84b8
     recreate_database glance
73f6f25b
 
f03bafeb
     # Migrate glance database
16312738
     $GLANCE_BIN_DIR/glance-manage db_sync
bc071bce
 
76e3925d
     # Load metadata definitions
     $GLANCE_BIN_DIR/glance-manage db_load_metadefs
 
f03bafeb
     create_glance_cache_dir
dd622935
 
     # Init glance search by exporting found metadefs/images to elasticsearch
     if is_service_enabled g-search; then
         ${TOP_DIR}/pkg/elasticsearch.sh start
         $GLANCE_BIN_DIR/glance-index
     fi
73f6f25b
 }
 
 # install_glanceclient() - Collect source and prepare
aee18c74
 function install_glanceclient {
e08ab104
     if use_library_from_git "python-glanceclient"; then
         git_clone_by_name "python-glanceclient"
         setup_dev_lib "python-glanceclient"
8df690c5
         sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-glanceclient"]}/tools/,/etc/bash_completion.d/}glance.bash_completion
5cb19069
     fi
73f6f25b
 }
 
 # install_glance() - Collect source and prepare
aee18c74
 function install_glance {
4f78f8f3
     # Install glance_store from git so we make sure we're testing
     # the latest code.
ee5ae7b9
     if use_library_from_git "glance_store"; then
         git_clone_by_name "glance_store"
         setup_dev_lib "glance_store"
     fi
4f78f8f3
 
73f6f25b
     git_clone $GLANCE_REPO $GLANCE_DIR $GLANCE_BRANCH
dd622935
 
     if is_service_enabled g-search; then
00d0da36
         ${TOP_DIR}/pkg/elasticsearch.sh download
         ${TOP_DIR}/pkg/elasticsearch.sh install
     fi
dd622935
 
     setup_develop $GLANCE_DIR
73f6f25b
 }
 
 # start_glance() - Start running processes, including screen
aee18c74
 function start_glance {
18d4778c
     local service_protocol=$GLANCE_SERVICE_PROTOCOL
     if is_service_enabled tls-proxy; then
         start_tls_proxy '*' $GLANCE_SERVICE_PORT $GLANCE_SERVICE_HOST $GLANCE_SERVICE_PORT_INT &
         start_tls_proxy '*' $GLANCE_REGISTRY_PORT $GLANCE_SERVICE_HOST $GLANCE_REGISTRY_PORT_INT &
dd622935
 
         # Handle g-search
         if is_service_enabled g-search; then
             start_tls_proxy '*' $GLANCE_SEARCH_PORT $GLANCE_SERVICE_HOST $GLANCE_SEARCH_PORT_INT &
         fi
18d4778c
     fi
 
2f27a0ed
     run_process g-reg "$GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
     run_process g-api "$GLANCE_BIN_DIR/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf"
18d4778c
 
73f6f25b
     echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..."
18d4778c
     if ! wait_for_service $SERVICE_TIMEOUT $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT; then
101b4248
         die $LINENO "g-api did not start"
73f6f25b
     fi
dd622935
 
     # Start g-search after g-reg/g-api
     if is_service_enabled g-search; then
         run_process g-search "$GLANCE_BIN_DIR/glance-search --config-file=$GLANCE_CONF_DIR/glance-search.conf"
         echo "Waiting for g-search ($GLANCE_SEARCH_HOSTPORT) to start..."
         if ! wait_for_service $SERVICE_TIMEOUT $GLANCE_SERVICE_PROTOCOL://$GLANCE_SEARCH_HOSTPORT; then
             die $LINENO "g-search did not start"
         fi
     fi
73f6f25b
 }
 
699a29f7
 # stop_glance() - Stop running processes
aee18c74
 function stop_glance {
73f6f25b
     # Kill the Glance screen windows
2f27a0ed
     stop_process g-api
     stop_process g-reg
dd622935
 
     if is_service_enabled g-search; then
         stop_process g-search
     fi
73f6f25b
 }
 
 # Restore xtrace
 $XTRACE
584d90ec
 
6a5aa7c6
 # Tell emacs to use shell-script-mode
 ## Local variables:
 ## mode: shell-script
 ## End: