Documentation ¶
Overview ¶
A package to create upstart scripts. These scripts are essential to make rebooting boxes safe, but contain an inherent complexity that requires some understanding of what is going on.
NOTE: This is work in progress. There are quite some options not supported yet!
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Upstart ¶
type Upstart struct { Name string // Name of the upstart script. Used for the file located in /etc/init. Description string // Description of the service provided. StartOnEvents []string // Events the service should be started on. StopOnEvents []string // Events the service should be stopped at. WorkingDirectory string // Directory to be used as CWD for the exec statement or script. Environment map[string]string // Environment variables set and available in all script sections. Exports []string // List of env variables to be exported to all events resulting from this job. Exec string // Command to run to start the service. Script string // Script to be executed to start the service. PostStartScript string // Script to be executed post start. PostStopScript string // Script to be executed post stop. PreStartScript string // Script to be executed pre start. PreStopScript string // Script to be executed pre stop. Expect string // TODO Expected behavior of the started command (with regard to daemonization). Instance string // TODO Instance handling. Respawn bool // TODO ??? RespawnLimitCount int // TODO Number of times the job might be respawned in the given interval. RespawnLimitInterval int // TODO Time frame the job might be respawned the given times. OomScore int // TODO Configuration of the kernel's "Out of memory" killer facility. Limit []string // TODO Resource limits of the job started Nice int // TODO Set the job's scheduling priority. Gid string // TODO All processes are run as the given group. Uid string // TODO All processes are run as the given user. Umask os.FileMode // TODO File mode creation mask used for the job. KillSignal string // TODO Signal used to terminate the service. KillTimeout int // TODO Number of seconds to wait for the kill signal to succeed. ReloadSignal string // TODO Signal to be used for initiating a service reload. NormalExitCodes []int // TODO List of exit codes considered 'normal'. Manual bool // TODO Don't start automatically, ignoring the start/stop configuration. Task bool // TODO A short lived job. }
func (*Upstart) CreateScript ¶
Create a string containing the content of the upstart script (should be save to "/etc/init/{{ u.Name }}").
Click to show internal directories.
Click to hide internal directories.