Giter Site home page Giter Site logo

systemd-screecher's Introduction

systemd-screecher

This is a super basic C++ plugin for node that will notify systemd that your backend node server has started up.

Requirements

  • Linux distribution that supports systemd

  • Node >= 8.0.0

  • The ability to build c++ during your install step

Setting up your server

C++ build tools (CentoOS 7)

sudo yum install gcc-c++

note: probably not the best idea to add c++ compilers to your server so put this in your CI build pipeline

Systemd development files (CentOS 7)

sudo yum install systemd-devel

Tips and Tricks
  • This package will attempt to build the c++ when performing npm install. It will only build in a linux environment.

  • To ensure this package doesn't fail your npm install you can add systemd-screecher as an optional dependency.

  • Make sure to change your systemd service file to "Notify" mode. Example:

[Service]
Environment="NODE_ENV=production"
Type=notify
ExecStart=/usr/sbin/simple-notifying-service
TimeoutStartSec=30
Restart=always

Installation (Once the other steps have been fufilled)

npm i systemd-screecher

Usage

const express = require("express");
const app = express();

const notify = require("systemd-screecher");

app.get("/", (req, res) => res.send("Hello World!"));

app.listen(3000, () => {
  console.log("App is listening on port " + port);

  // once the app has finished bootstrapping...

  notify();
});

systemd-screecher's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.