stayup

A nohup alternative that actually stays up. Under the hood, stayup installs a systemd unit, so your process comes back after a reboot, a cloned VM, a crash or a lost SSH session. Perfect for services on temporary VMs for agents. stayup stores no state of its own.

stayup npm run dev                                   # start, detach
stayup -f npm run dev                                # run attached: start and watch the output
stayup -a npm run dev                                # attach to a running process (or by PID / NAME)
stayup -o out.log --stderr err.log -- npm run dev    # log to files instead of the system log
stayup -l                                            # list: name, PID, state, started, last restart, restarts, dir, command
stayup -K npm run dev                                # kill (same command, same dir)
stayup -K 12345                                      # ...or by PID
stayup -K stayup-npm-1a2b3c4d                        # ...or by NAME from -l (works while it is restarting)

In the attached view (-f or -a) the last line reads ctrl-c to kill, ctrl-d or close connection to hang up and stay up. Ctrl-C kills the process. Ctrl-D, a hangup or a dropped connection leaves it running. Starting the same command from the same directory twice is a no-op.

Build

go build -o stayup .
install -m755 stayup ~/.local/bin/

Install

curl -fsSLo stayup https://stayup.sh/stayup
install -m755 stayup ~/.local/bin/

Downloads