ports/sysutils/py-google-compute-engine/files/google_startup.in
Richard Gallamore 9c025a94bc Google Compute Engine offers scripts and daemons which runs in the
background and provides the following services:

- Accounts daemon to setup and manage user accounts, and to enable SSH key based
  authentication.
- Clock skew daemon to keep the system clock in sync after VM start and stop
  events.
- Instance setup scripts to execute VM configuration scripts during boot.
- IP forwarding daemon that integrates network load balancing with forwarding
  rule changes into the guest.
- Metadata scripts to run user provided scripts at VM startup and shutdown.
- Network setup service to enable multiple network interfaces on boot.

WWW: https://github.com/GoogleCloudPlatform/compute-image-packages

PR:		219687
Submitted by:	Helen Koike (maintainer)
Reviewed by:	matthew (mentor), koobs, sunpoet, swills, julian
Approved by:	matthew (mentor)
Differential Revision:	https://reviews.freebsd.org/D12077
2017-08-19 18:02:55 +00:00

42 lines
851 B
Bash

#!/bin/sh
# $FreeBSD$
#
# PROVIDE: google_startup
# BEFORE: LOGIN
# REQUIRE: NETWORKING syslogd google_instance_setup google_network_setup
# KEYWORD: shutdown
#
# google_startup_enable (bool): Set to NO by default.
# Set it to YES to enable google_startup.
#
. /etc/rc.subr
name="google_startup"
rcvar="google_startup_enable"
load_rc_config "${name}"
: ${google_startup_enable:="NO"}
command_interpreter="%%PYTHON_CMD%%"
command=%%PREFIX%%/bin/google_metadata_script_runner
command_startup_args="--script-type startup"
command_shutdown_args="--script-type shutdown"
pidfile=/var/run/${name}.pid
start_cmd="google_startup_start"
stop_cmd="google_startup_stop"
google_startup_start()
{
${command} ${command_startup_args}
}
google_startup_stop()
{
echo "Stopping ${name}."
${command} ${command_shutdown_args}
}
run_rc_command "$1"