npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

contboot

v1.0.1

Published

`contboot` is a Node.js tool designed to ensure Docker containers with the "always" restart policy are running as expected. This tool checks Docker containers and attempts to start those that are not running, ensuring they are up and running within a spec

Downloads

11

Readme

contboot

contboot is a Node.js tool designed to ensure Docker containers with the "always" restart policy are running as expected. This tool checks Docker containers and attempts to start those that are not running, ensuring they are up and running within a specified timeout period.

Motivation

Docker containers are often set to restart automatically using the "always" policy to ensure they are resilient to failures and reboots. However, there are instances where these containers may not start as expected due to various issues. contboot was created to address this problem by providing an automated way to check and start such containers, ensuring they adhere to the intended restart policy.

Features

  • Docker Availability Check: Verifies if Docker is available and responsive before proceeding.
  • Container Inspection: Lists and inspects all containers with the "always" restart policy.
  • Automated Startup: Attempts to start containers that are not running.
  • Timeout Monitoring: Monitors the startup process, retrying within a specified timeout period.

Installation

To install contboot globally, run the following command:

npm install -g contboot

Usage

To run contboot and optionally set a timeout period (default is 60 seconds), use the following command:

contboot [timeout]

For example, to set the timeout to 120 seconds:

contboot 120

Work with pm2:

pm2 start --max-restarts 0 contboot 
pm2 save
pm2 start --max-restarts 0 contboot -- 120
pm2 save

Example Output

Below is an example of the output when running contboot:

[2024-07-07 12:31:16:920] [INFO] Starting contboot...
[2024-07-07 12:31:16:938] [INFO] Docker is available.
[2024-07-07 12:31:17:112] [INFO] Found 2 containers with restart policy 'always'.
[2024-07-07 12:31:17:115] [INFO] Inspecting container container1 (79faad9901c)
[2024-07-07 12:31:17:118] [INFO] Container container1 (79faad9901c) is not running. Status: exited
[2024-07-07 12:31:17:133] [INFO] Attempting to start container: container1 (79faad9901c)
[2024-07-07 12:31:17:273] [INFO] Started container: container1 (79faad9901c)
[2024-07-07 12:31:27:285] [INFO] Container container1 (79faad9901c) status: running
[2024-07-07 12:31:27:285] [INFO] Container container1 (79faad9901c) is running.
[2024-07-07 12:31:27:285] [INFO] Ending contboot...
[2024-07-07 12:31:27:285] [INFO] Summary:
[2024-07-07 12:31:27:285] [INFO]   Started containers: 1
[2024-07-07 12:31:27:285] [INFO]   Failed containers: 0
[2024-07-07 12:31:27:285] [INFO]   Execution time: 10165 ms

License

contboot is licensed under the MIT License. See the LICENSE file for more details.