badger

command module
v0.0.0-...-e162a3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

README

badger

logo

Badger is a lightweight alternative to systemd, it runs your scripts and manages your daemons at startup.

Features
  • Live reload of the daemons file allows your to add and remove daemons and scripts while system is running live
  • Automatically restarts failed daemons and stops removed daemons
  • Offers a simple replacement for an otherwise heavy init daemon like systemd.
  • Designed to be used with runc, systemd and serve as systemd replacement in docker containers
  • Properly reaps zombies
  • Follows KISS principle
initFile
s:/runMeOnce.sh param1
d:/iAmDaemon.sh
d:/usr/sbin/sshd -D
Running
Using inplace of /sbin/init

badger can be used inplace of /sbin/init, for example when using microvms. In those cases as no arguments are passed it will read config from /initrc and write log to init.log

Shell
./badger if /initFile log /log/badger.log
runC

Place badger in /bin/badger inside container/rootfs/bin/badger and create the container/rootfs/initFile and log folder. runC config.json example:

	"args": [
		"/bin/badger if /initFile log /log/badger.log"
	],
systemD

Using badger to start your services on startup Add contents to /etc/systemd/system/badger.service

[Unit]
Description=badger
After=network.target

[Service]
ExecStart=/bin/badger if /initFile log /log/badger.log
Type=simple

[Install]
WantedBy=multi-user.target
Alias=badger.service

Then run:

systemctl enable badger
systemctl start badger

Installing

repo="badger"; name="badger"; os=$(uname | tr '[:upper:]' '[:lower:]'); arch=$(uname -m); case $arch in x86_64) arch="amd64" ;; arm64) arch="arm64" ;; esac; url="https://github.com/8ff/${repo}/releases/download/latest/${name}.${os}.${arch}"; curl -L $url -o ${name} && chmod +x ${name}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL