All Projects → simone-sanfratello → service-systemd

simone-sanfratello / service-systemd

Licence: other
Setup a node.js app as systemd service.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to service-systemd

Logmonitor
Monitoring log files on windows systems.
Stars: ✭ 23 (-34.29%)
Mutual labels:  service, daemon
Clight
A C daemon that turns your webcam into a light sensor. It will adjust screen backlight based on ambient brightness.
Stars: ✭ 371 (+960%)
Mutual labels:  daemon, systemd
Ecominit
eComInit is a free init system and service manager designed to scale from lightweight desktops to web-scale cloud deployments. It aims to offer feature-parity with systemd but with a modular, portable architecture compliant with software engineering best-practice.
Stars: ✭ 352 (+905.71%)
Mutual labels:  service, systemd
Ipmonitor
IP Monitor is a simple application which monitors your public IP address for changes and lets you set different kinds of notifications such as email, audio, pop up or executing a command
Stars: ✭ 28 (-20%)
Mutual labels:  service, daemon
Daemon
A daemon package for use with Go (golang) services
Stars: ✭ 1,720 (+4814.29%)
Mutual labels:  service, daemon
InitWare
The InitWare Suite of Middleware allows you to manage services and system resources as logical entities called units. Its main component is a service management ("init") system.
Stars: ✭ 164 (+368.57%)
Mutual labels:  service, systemd
Systemd Ngrok
Automatically start ngrok by systemd
Stars: ✭ 241 (+588.57%)
Mutual labels:  service, systemd
InitKit
Neo-InitWare is a modular, cross-platform reimplementation of the systemd init system. It is experimental.
Stars: ✭ 364 (+940%)
Mutual labels:  service, systemd
erlang-systemd
systemd utilities for Erlang applications
Stars: ✭ 140 (+300%)
Mutual labels:  systemd
daemonize-me
Rust library to ease the task of creating daemons
Stars: ✭ 34 (-2.86%)
Mutual labels:  daemon
jetson-monitor
🚨 Jetson is an HTTP monitoring service used to notify by various messaging platforms such as Slack and Telegram
Stars: ✭ 45 (+28.57%)
Mutual labels:  service
systemd-formula
No description or website provided.
Stars: ✭ 24 (-31.43%)
Mutual labels:  systemd
terraform-aws-ecs-alb-service-task
Terraform module which implements an ECS service which exposes a web service via ALB.
Stars: ✭ 108 (+208.57%)
Mutual labels:  service
riemann-sumd
Agent for scheduling event generating processes and sending the results to Riemann
Stars: ✭ 48 (+37.14%)
Mutual labels:  daemon
server-framework
纯C的分布式服务器框架通用模板,跨平台,模块动态加载,tcp/可靠UDP,协程RPC,日志,集群建立
Stars: ✭ 24 (-31.43%)
Mutual labels:  service
Minerva-Debugger
Providing a great interface to the iOS kernel, hardware, threads and processes in a great research environment. (WIP)
Stars: ✭ 23 (-34.29%)
Mutual labels:  daemon
dotfiles
🏡 Personal dotfiles configuration
Stars: ✭ 73 (+108.57%)
Mutual labels:  systemd
go-systemd-time
📅 Go implementation of systemd relative time adjustments
Stars: ✭ 21 (-40%)
Mutual labels:  systemd
google-music-manager-uploader
Google Music Manager Uploader module / Easily upload MP3 (folder) to Google Music
Stars: ✭ 21 (-40%)
Mutual labels:  daemon
notification-thing
Python-based implementation of Desktop Notifications Specification (notification-daemon)
Stars: ✭ 24 (-31.43%)
Mutual labels:  daemon

service-systemd

NPM Version NPM Downloads

JS Standard Style

Purpose

Setup a node.js app as systemd service.

Sometimes you just want an "old style" daemon for simple services.
Sometimes you have to deploy in small devices (like a RaspberryPi) and you can't use Docker and all the band.

Installing

npm i -g service-systemd

Quick start

  • Install service

    • pass settings in command line (see full documentation for all options)
    sudo service-systemd --add --service my-service --cwd /path/to/service --app main.js
    • pass all settings in JSON file
    sudo service-systemd --add --settings service.json
  • Run the service

sudo service my-service start
sudo service my-service stop
sudo service my-service restart
  • Uninstall service
sudo service-systemd --remove --service my-service

Programmatic usage

const service = require('service-systemd')

// add service

try {
  await service.add({
    name: 'my-service',
    cwd: '/path/to/app',
    app: 'main.js',
    env: {
      NODE_ENV: 'prod',
      PORT: 3002
    }
  })
  console.log('my-service installed')
} catch (error) {
  console.error('something wrong', error)
}

// remove service

try {
  await service.remove('my-service')
  console.log('my-service removed')
} catch (error) {
  console.error('something wrong', error)
}

Engines

App can run using engines: node (default), forever, pm2. With forever and pm2 you can use their options and tools.

Documentation

See documentation for further informations.

Changelog

See changelog.

TODO

v. 3.6

  • test suite

v. 3.7

  • show examples in --help
  • get bin/node location by which node
  • replace log-segment

v. 3.8

  • add EnvironmentFile
  • check if systemd is on board

v. 3.9

  • rollback on error

v. 4.0

  • replace commander with yargs and rename args

v. 4.1

  • run multiple instances

Thanks to

Chris Lea for these articles

License

The MIT License (MIT)

Copyright (c) 2017-2019, braces lab

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].