All Projects → bytegust → Spm

bytegust / Spm

A process manager similar to systemd and foreman with stop feature, written in Go.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Spm

Multiprocess
🚀Easy to make the common PHP/Python/js...script change daemon and multi-process execution
Stars: ✭ 151 (+243.18%)
Mutual labels:  daemon, manager, process
core d.js
Offload your heavy lifting to a daemon. Extracted from eslint_d.
Stars: ✭ 21 (-52.27%)
Mutual labels:  daemon, process
Immortal
⭕ A *nix cross-platform (OS agnostic) supervisor
Stars: ✭ 701 (+1493.18%)
Mutual labels:  daemon, process
Gtm In Viewport Manager
A manager of in-viewport events for GTM (Google Tag Manager).
Stars: ✭ 20 (-54.55%)
Mutual labels:  manager
Parsel
Create complex parsers by combining simple ones with Parsel!
Stars: ✭ 21 (-52.27%)
Mutual labels:  spm
Url Encoded Form
📝 Parse and serialize url-encoded form data with Codable support.
Stars: ✭ 32 (-27.27%)
Mutual labels:  spm
Processmanager
PHP Process Control tools
Stars: ✭ 43 (-2.27%)
Mutual labels:  daemon
Cluster Dispatch
解决Node.js在Cluster模式下的连接/资源复用问题
Stars: ✭ 13 (-70.45%)
Mutual labels:  process
Sketchkit
A lightweight auto-layout DSL library for iOS & tvOS.
Stars: ✭ 40 (-9.09%)
Mutual labels:  spm
Whatpulse
WhatPulse reverse engineered
Stars: ✭ 30 (-31.82%)
Mutual labels:  daemon
Leoric
PoC of fighting against force-stop kill process on Android
Stars: ✭ 946 (+2050%)
Mutual labels:  daemon
Processmaker
GLPI plugin that provides an interface with ProcessMaker (http://www.processmaker.com/)
Stars: ✭ 21 (-52.27%)
Mutual labels:  process
Principles.design
An open source collection of design principles and methods.
Stars: ✭ 975 (+2115.91%)
Mutual labels:  process
Life
Conway's Game of Life written in Swift 👾
Stars: ✭ 21 (-52.27%)
Mutual labels:  spm
Deluge
Deluge BitTorrent client - Git mirror, PRs only
Stars: ✭ 1,012 (+2200%)
Mutual labels:  daemon
Linkliar
🔗 Link-Layer MAC spoofing GUI for macOS
Stars: ✭ 885 (+1911.36%)
Mutual labels:  daemon
Swiftysound
SwiftySound is a simple library that lets you play sounds with a single line of code.
Stars: ✭ 995 (+2161.36%)
Mutual labels:  spm
Nsudo
Series of System Administration Tools
Stars: ✭ 945 (+2047.73%)
Mutual labels:  process
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 (-36.36%)
Mutual labels:  daemon
Wtfautolayout
The source code for Why The Failure, Auto Layout?
Stars: ✭ 958 (+2077.27%)
Mutual labels:  spm

spm - Simple Process Manager

spm is somewhere between systemd and foreman.

It runs as a daemon. You can start spm daemon by running spm command with no arguments. Once you've done that you are ready to start and manage your jobs(processes) with spm commands. spm reads its jobs from an extended Procfile syntax. You are eligible to start or stop jobs, see running jobs and their logs. Your processes executed as shell commands so you're allowed to use shell syntax in your Procfile.

Our extended version of Procfile syntax supports comments with # sign and multilines with \.

Why spm ?

All other foreman like process managers don't have a proper stop feature to end running jobs which spm has. spm works in a client/server convention, spm daemon listens for job commands(listed at spm -h) from it's clients through unix sockets. You are also able to use multiple Procfiles and start/stop multiple jobs in a Procfile which gives a huge flexiblity when you need to work with bunch of long running processes. Jobs are recognized by their names, make sure that your jobs has unique names otherwise spm will not start an already running job with same name that you started before.

Installation and Usage

$ go get github.com/bytegust/spm/cmd/spm
$ spm -h

Simple Process Manager.

Usage: spm [OPTIONS] COMMAND [arg...]
       spm [ --help ]

Options:

  -f, --file=~/.Procfile    Location of Procfile
  -h, --help                Print usage

Commands:

    start           Start all jobs defined in Procfile
    start <jobs>    Starts jobs if present in Procfile
    stop            Stop all current jobs
    stop <jobs>     Stop jobs if currently running
    list            Lists all running jobs
    logs <job>      Prints last 200 lines of job's logfile 

Documentation can be found at https://github.com/bytegust/spm

Example

Following Procfile has two jobs (tabs for legibility):

# Serve spm's github repository on local machine
repo:   rm -rf spm && \
        git clone https://github.com/bytegust/spm.git && \
        http-server ./spm -p 8080

# Download and serve a webpage on local machine
apod: \

        # Create directory that will be served
        rm -rf astropix && \
        mkdir astropix && \
        cd astropix && \

        # Downloads the content of https://apod.nasa.gov/apod/astropix.html
        wget -A.jpg -e robots=off -k \ 
        --user-agent="Mozilla/5.0 (compatible; Konqueror/3.0.0/10; Linux)" \
        --no-check-certificate https://apod.nasa.gov/apod/astropix.html && \

        # Rename file as index
        mv $(ls *.html | head -1) index.html && \

        # Serve webpage
        http-server -p 8081

Suppose that we have the Procfile above inside a folder named test. After starting the daemon by spm command we will be able to run jobs, inside our Procfile, from the clients, namely, other terminal windows or tabs.

  1. Run spm command to start daemon:

    $ spm
    2016/11/07 22:20:22 spm.go:209: deamon started
    

  2. Run spm start (or a specific job e.g. spm start apod) command from different terminal tab. Since our Procfile reside in the folder named test, we have to define its path using -f flag:

    $ spm -f test start
    2016/11/07 22:20:23 spm.go:122: done
    

  3. Log files are being saved under /tmp folder with a job specific name, so that it's possible to see logs by spm logs <jobname> command:

    $ spm logs apod
    
  4. List all running jobs using spm list command:

    $ spm list
    
  5. Stop running jobs using spm stop command (or a specific job e.g. spm stop apod):

    $ spm stop
    

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].