Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x
- Puppet >= 6.22.1 < 8.0.0
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'simp-upstart', '6.3.0'
Learn more about managing modules with a PuppetfileDocumentation
Module
Table of Contents
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with upstart
- Usage - Configuration options and additional functionality
- Reference
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Acceptance Tests
Module Description
Upstart is an event-based replacement for the /sbin/init daemon which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.
This class allows for configuration of upstart init files. The main class will ensure that /etc/init has proper permissions and disable ctrl+alt+del restarts by default.
upstart::job
allows you to manage upstart jobs in /etc/init.
Setup
Include SIMP/upstart
in your modulepath.
What upstart affects
This module will manage the /etc/init directory, and any additional jobs created
by upstart::job
Begging with upstart
To ensure the proper permissions on /etc/init and disable ctrl+alt+delete restart, just include the main class in your manifest.
include upstart
Usage
I want to re-enable ctrl+alt+delete restarts
class{'upstart':
disable_ctrl_alt_del => false,
}
I want to run a script at restart on any run-level
upstart::job { 'myjob':
main_process_type => 'script',
main_process => template('myprofile/script'),
start_on => 'runlevel [0123456]',
description => 'Used to run my process'
}
I have a simple command I want to run on runlevel 5
upstart::job { 'myjob':
main_process_type => 'script',
main_process => '/bin/foo --opt -xyz foo bar',
start_on => 'runlevel [5]',
description => 'Used to foo xyz options on foo and bar',
}
Reference
Public Classes
- upstart: Manages /etc/init and controls the ctrl+alt+delete job.
Defined Types
- upstart::job: Manages upstart jobs
Limitations
SIMP Puppet modules are generally intended to be used on a Red Hat Enterprise Linux-compatible distribution.
Development
Please read our Contribution Guide.
If you find any issues, they can be submitted to our JIRA.
Acceptance tests
To run the system tests, you need Vagrant
installed.
You can then run the following to execute the acceptance tests:
bundle exec rake beaker:suites
Some environment variables may be useful:
BEAKER_debug=true
BEAKER_provision=no
BEAKER_destroy=no
BEAKER_use_fixtures_dir_for_modules=yes
BEAKER_debug
: show the commands being run on the STU and their output.BEAKER_destroy=no
: prevent the machine destruction after the tests finish so you can inspect the state.BEAKER_provision=no
: prevent the machine from being recreated. This can save a lot of time while you're writing the tests.BEAKER_use_fixtures_dir_for_modules=yes
: cause all module dependencies to be loaded from thespec/fixtures/modules
directory, based on the contents of.fixtures.yml
. The contents of this directory are usually populated bybundle exec rake spec_prep
. This can be used to run acceptance tests to run on isolated networks.
Reference
Table of Contents
Classes
upstart
: This class allows you to configure the upstart init files Unless otherwise noted, the variables passed to this class set up ``/etc/sysconfig
Defined types
upstart::job
: This define allows you to manage upstart jobs in /etc/init. See init(5) for more information. All variables lacking comments come directly f
Functions
upstart::validate_sys_limit
: Validate the initial system resource limits for a job's processes See init(5) for more information.
Data types
Classes
upstart
This class allows you to configure the upstart init files
Unless otherwise noted, the variables passed to this class set up
/etc/sysconfig/init
This only sets security-relevant options. You'll need to use the augeas provider to prod different values in the target file but this provides a good example.
- See also
- init(8)
Parameters
The following parameters are available in the upstart
class:
auditd
Data type: Boolean
If true, includes SIMP's ::auditd class and then adds upstart audit rule
Default value: simplib::lookup('simp_options::auditd', { 'default_value' => false })
Defined types
upstart::job
This define allows you to manage upstart jobs in /etc/init.
See init(5) for more information. All variables lacking comments come directly from init(5)
Parameters
The following parameters are available in the upstart::job
defined type:
start_on
main_process_type
main_process
pre_start_type
pre_start
post_start_type
post_start
pre_stop_type
pre_stop
post_stop_type
post_stop
stop_on
default_env
env_export
is_task
respawn_limit
normal_exit
instance_name
description
doc_version
emits
console
nice
oom
chroot
chdir
sys_limit
kill_timeout
expect_stop
expect_daemon
expect_fork
respawn
author
umask
start_on
Data type: String
The set of events that will cause the job to be automatically started.
main_process_type
Data type: Upstart::Process
The type of the main process, may be one of 'exec' or 'script'.
Default value: 'exec'
main_process
Data type: Optional[String]
The content of the main process.
Default value: undef
pre_start_type
Data type: Upstart::Process
The type of the pre-start script, may be one of 'exec' or 'script'.
Default value: 'exec'
pre_start
Data type: Optional[String]
The content of the pre-start stanza.
Default value: undef
post_start_type
Data type: Upstart::Process
The type of the post-start script, may be one of 'exec' or 'script'
Default value: 'exec'
post_start
Data type: Optional[String]
The content of the post-start stanza.
Default value: undef
pre_stop_type
Data type: Upstart::Process
The type of the pre-stop script, may be one of 'exec' or 'script'
Default value: 'exec'
pre_stop
Data type: Optional[String]
The content of the pre-stop stanza.
Default value: undef
post_stop_type
Data type: Upstart::Process
The type of the post-stop script, may be one of 'exec' or 'script'
Default value: 'exec'
post_stop
Data type: Optional[String]
The content of the post-stop stanza.
Default value: undef
stop_on
Data type: Optional[String]
The set of events that will cause the job to be automatically stopped.
Default value: undef
default_env
Data type: Optional[String]
Corresponds to the 'env' keyword.
Default value: undef
env_export
Data type: Optional[String]
Corresponds to the 'export' keyword.
Default value: undef
is_task
Data type: Boolean
Corresponds to the 'task' keyword.
Default value: false
respawn_limit
Data type: Optional[Array[Integer,2,2]]
An array containing two integers corresponding to 'count' and 'interval' for the 'respawn limit' keyword.
Default value: undef
normal_exit
Data type: Optional[Array[String]]
An array of exit statuses and/or signals that indicate tat the job has terminated successfully.
Default value: undef
instance_name
Data type: Optional[String]
The 'instance' keyword.
Default value: undef
description
Data type: Optional[String]
The description of the job.
Default value: undef
doc_version
Data type: Optional[String]
The jversion information about the job. Maps to the 'version' keyword.
Default value: undef
emits
Data type: Optional[Array[String]]
An array of arbitrary events to emit.
Default value: undef
console
Data type: Optional[Upstart::Console]
Option to connect standard input, output, and error to /dev/console. Value may be 'output' or 'owner'.
Default value: undef
nice
Data type: Optional[Integer]
The process's nice value.
Default value: undef
oom
Data type: Optional[String]
The OOM killer setting.
Default value: undef
chroot
Data type: Optional[Stdlib::Absolutepath]
The directory underneath which the process will be run in a chroot.
Default value: undef
chdir
Data type: Optional[Stdlib::Absolutepath]
The directory to be the root of the chroot instead of the root of the filesystem.
Default value: undef
sys_limit
Data type: Optional[Array[String, 3, 3]]
Maps to the 'limit' keyword. Accepts a three item array of values that should be 'LIMIT','SOFT', and 'HARD' respectively.
Default value: undef
kill_timeout
Data type: Optional[Integer]
The interval between sending the job's main process the SIGTERM and SIGKILL signals when stopping the running job.
Default value: undef
expect_stop
Data type: Boolean
Maps to 'expect stop'.
Default value: false
expect_daemon
Data type: Boolean
Maps to 'expect daemon'.
Default value: false
expect_fork
Data type: Boolean
Maps to 'expect fork'.
Default value: false
respawn
Data type: Boolean
Default value: false
author
Data type: Optional[String]
Default value: undef
umask
Data type: Simplib::Umask
Default value: '022'
Functions
upstart::validate_sys_limit
Type: Ruby 4.x API
Validate the initial system resource limits for a job's processes
See init(5) for more information.
upstart::validate_sys_limit(Optional[Array[String, 3, 3]] $sys_limit)
Validate the initial system resource limits for a job's processes
See init(5) for more information.
Returns: Any
true in validation succeeds
Raises:
upon
any validation failure
sys_limit
Data type: Optional[Array[String, 3, 3]]
3-tuple containing the limit name, soft limit, and hard limit
Data types
Upstart::Console
The Upstart::Console data type.
Alias of Enum['output', 'owner']
Upstart::Process
The Upstart::Process data type.
Alias of Enum['exec', 'script']
- Mon Jul 17 2023 Chris Tessmer chris.tessmer@onyxpoint.com - 6.3.0
- Add RockyLinux 8 support
- Thu Jun 17 2021 Chris Tessmer chris.tessmer@onyxpoint.com - 6.2.0
- Removed support for Puppet 5
- Ensured support for Puppet 7 in requirements and stdlib
- Sat Dec 19 2020 Chris Tessmer chris.tessmer@onyxpoint.com - 6.1.2
- Removed EL6 support
- Thu Jul 23 2020 Jeanne Greulich jeanne.greulich@onyxpoint.com - 6.1.1-0
- update the upper bound of simplib for SIMP 6.5 release
- Fri Aug 02 2019 Robert Vincent pillarsdotnet@gmail.com - 6.1.0-0
- Drop Puppet 4 support
- Add Puppet 6 support
- Add puppetlabs-stdlib 6 support
- Wed May 08 2019 Liz Nemsick lnemsick.simp@gmail.com - 6.0.5-0
- Maintenance: removed OBE build/rpm_metadata/requires
- Tue Feb 12 2019 Liz Nemsick lnemsick.simp@gmail.com - 6.0.4-0
- Use Simplib::Umask data type in lieu of validate_umask(), a deprecated simplib Puppet 3 function.
- Update the upper bound of stdlib to < 6.0.0
- Update a URL in the README.md
- Thu Sep 13 2018 Nicholas Markowski nicholas.markowski@onyxpoint.com - 6.0.3-0
- Added Puppet 5 and OEL support
- Dropped support for Hiera v4. Dependency auditd has dropped support for Hiera v4, causing Puppet 4.7 tests to fail in this module.
- Update badges and contribution guide URL in README.md
- Thu Jun 07 2018 Liz Nemsick lnemsick.simp@gmail.com - 6.0.2-0
- Advance beyond bad changelog entry
- Thu Jun 16 2017 Liz Nemsick lnemsick.simp@gmail.com - 6.0.1-0
- Update to Puppet 4 custom function
- Confine puppet version in metadata.json
- Thu Jan 05 2017 Trevor Vaughan tvaughan@onyxpoint.com - 6.0.0-0
- Removed the 'ctrl-alt-del' job since that has been moved into the 'simp' module
- Thu Dec 15 2016 Liz Nemsick lnemsick.simp@gmail.com - 6.0.0-0
- Use simp_options module for global catalysts
- Use strongly typed parameters
- Fix bug whereby optional, respawn limit was not properly specified in upstart jobs.
- Refined upstart::job::sys_limit validation to reject non-integer numbers.
- Mon Nov 21 2016 SIMP-Team https://groups.google.com/forum/#!forum/simp - 5.0.0-0
- Updated module for compliance markup API v1.0.0 compatibility.
- Fri Jul 29 2016 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.2-0
- Fixed an ordering issue in the 'job' ERB template
- Tue Mar 01 2016 Ralph Wright ralph.wright@onyxpoint.com - 4.1.0-5
- Added compliance function support
- Mon Nov 09 2015 Chris Tessmer chris.tessmer@onypoint.com - 4.1.0-4
- migration to simplib and simpcat (lib/ only)
- Fixed a set of bugs that were introduced to the 'job.erb' template.
- Code cleanup
- Fri Jan 16 2015 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.0-3
- Changed puppet-server requirement to puppet
- Wed Apr 16 2014 Trevor Vaughan tvaughan@onyxpoint.com - 4.1.0-2
- Added the ability to disable ctrl-alt-del to the main upstart class.
- Wed Feb 12 2014 Kendall Moore kmoore@keywcorp.com - 4.1.0-1
- Converted all boolean strings into native booleans.
- Fri Jan 03 2014 Nick Markowski nmarkowski@keywcorp.com 4.1.0-0
- Updated module for puppet3/hiera compatability, optimized code for lint tests, and added puppet-rspec tests.
- Tue Dec 31 2013 Nick Markowski nmarkowski@keywcorp.com 4.1.0-0
- Updated module for puppet3/hiera compatability, and optimized code for lint tests.
- Tue Oct 08 2013 Kendall Moore kmoore@keywcorp.com 4.0.0-7
- Updated all erb templates to properly scope variables.
-
Wed Feb 06 2013 Maintenance 4.0.0-6
-
Tue Feb 05 2013 Maintenance 4.0.0-5
- Create a Cucumber test to install and configure the upstart module.
- Fri Jul 27 2012 Maintenance 4.0.0-4
- Updated the init.pp to only manage 'prompt' and 'single' since that's all that's really security relevant.
- Wed Apr 11 2012 Maintenance 4.0.0-3
- Updated pp files to better meet Puppet's recommended style guide.
- Fri Mar 02 2012 Maintenance 4.0.0-2
- Improved test stubs.
- Mon Dec 26 2011 Maintenance 4.0.0-1
- Updated the spec file to not require a separate file list.
- Mon Jul 25 2011 Maintenance 4.0.0-0
- Initial release of upstart module.
Dependencies
- puppetlabs/stdlib (>= 8.0.0 < 9.0.0)
- simp/simplib (>= 3.7.0 < 5.0.0)
pupmod-simp-upstart - A Puppet Module for managing Upstart -- Per Section 105 of the Copyright Act of 1976, these works are not entitled to domestic copyright protection under US Federal law. The US Government retains the right to pursue copyright protections outside of the United States. The United States Government has unlimited rights in this software and all derivatives thereof, pursuant to the contracts under which it was developed and the License under which it falls. --- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.