how to install & setup


At the moment of writing this document currently immortal can be installed in macOS via homebrew and FreeBSD (ports/pkg), therefore if you are familiar with your current operating system would be nice if you could contribute by creating a native port in order to make more simple the installation process.

Installing on linux

The easy way so far is to install a precompiled release, download the latest one that matches your architecture (*.deb) and then do:

sudo dpkg -i immortal_0.17.0_amd64.deb

In this case it will install version 0.17.0 for amd64, but you still need to configure immortaldir to start on boot time.

Setup immortaldir

To make your applications persistent across reboots, immortaldir needs to start on boot time so that it launches your applications every time your system is booted.

The main requirement is to create a directory that will contain all your *.yml files, it can be /etc/immortal, /usr/local/etc/immortal or either /var/services at the end this directory needs to be passed as the first argument to immortaldir

For Linux systems like ubuntu 14 with start-stop-daemon, you could put this script in /etc/init.d/immortaldir:

#!/bin/sh

# immortaldir start-stop-daemon
set -e

NAME=immortaldir
PIDFILE=/var/run/$NAME.pid
DAEMON=/usr/bin/immortaldir
DAEMON_OPTS="/etc/immortal"

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

case "$1" in
  start)
        echo -n "Starting daemon: "$NAME
	start-stop-daemon --start \
    --quiet \
    --oknodo \
    --make-pidfile \
    --pidfile $PIDFILE \
    --background \
    --startas /bin/sh \
    -- -c "exec $DAEMON $DAEMON_OPTS 2>&1 | logger -t immortaldir"
    echo "."
	;;
  stop)
        echo -n "Stopping daemon: "$NAME
        pkill $NAME
        echo "."
	;;
  *)
	echo "Usage: "$1" {start|stop}"
	exit 1
esac

exit 0

On Linux with systemd, put this script in /etc/systemd/system/immortaldir.service

comments powered by Disqus