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

runit-services-admin

v1.2.2

Published

Unix/Linux services administration for runit. It is mainly meant to be used on termux, but should work on any other Unix systems using runit.

Downloads

4

Readme

Runit Services Admin

Manage programs you want to run as services on your Unix machine. You can create, start, stop, activate, deactivate, drop a service. You can also set it for auto/manual start and list all installed services. This package was mainly meant to easily administer termux services, but I decided to make it run on any Unix platform that has runit installed.

Requirements

  • Runit program http://www.smarden.org/runit/
  • Bash

Optional

  • npm for installation
  • git for installation

Installation

There are two ways to install this package through NPM or using git cloning and running install script. Basically it copies the binaries that you need to run the commands into your /bin directory.

Using NPM

npm i -g runit-services-admin

This assumes that you have NPM installed, which is installed when you install NodeJs. You can also use Yarn to do the same thing.

Using Git

git clone https://github.com/emahuni/runit-services-admin.git
cd runit-services-admin
sudo ./install

This obviously assumes that you have Git installed.

2nd and half way

If you have neither Git nor NPM installed you can do the Git part manually.

  • visit 'www.github.com/emahuni/runit-services-admin'
  • click on download and this will download the repository as a zip file
  • extract the contents of the zip file
  • on the terminal do:

cd path/to/where/you/extracted/the/zip/file sudo ./install ```

That will install the package binaries as explained before.

Environment

Put environment variable SVDIR in your ~/.bash_profile file. It points to the services directory: export SVDIR=$HOME/.sv. You can use any other directory you want, this is the default.

Startup

For the services to automatically startup when you start your terminal or your system add line svdrun into your ~/.bash_profile file. It will run all active services installed in your $SVDIR directory, therefore this line should be below the above environment setup.

Uninstalling

Uninstalling is simple

Using NPM

npm un -g runit-services-admin

Using Git

If you don't have the files you cloned ealier you will have to clone them again then run

sudo ./uninstall

see above where cloning or zip download was done. Do the same for either method under Git, but just replace sudo ./install with sudo ./uninstall.

Startup

Remove the lines you inserted into your ~/.bash_profile file.

Usage

The package provides the following commands that you can easily manage your services with; type command --help for more info about each command.

  • svcreate - service create: creates a service for your program, script etc
  • svdrun - services directory/daemon run: runs all active services in the SVDIR directory and optionally monitor (daemon mode) any new services.
  • svdstop - services directory/daemon stop: stops running services daemon and exit all running services
  • svrun - service run: runs a specific service
  • svstop - service stop: exits a specific service
  • svdrop - service drop: deletes a specific service; optionally backs it up before deletion
  • svact - service activate: activates an inactive service, so that it is runnable
  • svdeact - service deactivate: deactivates an active service, so that it is not runnable
  • svlist - services list: lists all installed services and their modes and statuses
  • svwdown - service wants down: sets a service to go down (stop) on startup, use sv u service-name to start running it manually.
  • svwup - service wants up: sets a service to go up (run) on startup

Example:

svcreate docs 'http-server /mnt/storage/docs/ -p 8080'
  • The above example creates a service in ~/.sv that runs the NodeJs package http-server, that is instructed to serve html files in /mnt/storage/docs/ on port 8080.
  • If svdrun -m is set up in ~/.bash_profile then the service will begin running immdiately and on startup.
  • Else you can use svrun docs to begin running the service when required.
  • You can use the other commands to manage the service as simple as svdrop docs to delete the service.

In addition to the above-mentioned commands you can use the runit sv command to control and query installed active services eg: sv s docs to see the above-example service status. see sv --help for more info. http://www.smarden.org/runit/

Author

Emmanuel Mahuni

Github

https://github.com/emahuni/

License

Emmanuel Mahuni (c) 2018 MIT