Demo on how an executable can respawn after an update

Auto respawn on update demo

Demo on how an executable can respawn after an update

How to build

go build updatedemo.go

How to run

./updatedemo

Rebuild a new version

From a different console, rebuild it with a new version:

go build -ldflags "-X main.Version=0.2" updatedemo.go

The program should replace the running process with the newer version. It will keep the same PID and a supervisor like systemd will not notice it.

Test supervisor

To run it un ther the demo supervisor:

sh ./supervisor.sh ./updatedemo

Try the above rebuild and notice that the supervisor never gets the SIGCHLD, nor does it respawn it.

From a spearate console, try killing the updatedemo:

kill $(pidof ./updatedemo)

The supervisor will respawn it.

Similar Resources

Go-generic-unboxing - A quick ready to ship demo for go generic using the official example

Go generic This repo contain basic demo for installing and running go1.18beta1 v

Feb 1, 2022

This is a demo of various bursavich.dev packages.

Demo This provides a demo of various bursavich.dev packages. See the frontend command for a unified usage example, from which the following sample met

Feb 10, 2022

:runner:runs go generate recursively on a specified path or environment variable and can filter by regex

Package generate Package generate runs go generate recursively on a specified path or environment variable like $GOPATH and can filter by regex Why wo

Sep 27, 2022

A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.

Cron.go This is a simple library to handle scheduled tasks. Tasks can be run in a minimum delay of once a second--for which Cron isn't actually design

Dec 17, 2022

A go backend you can use as a template

A go backend you can use as a template

Golang project template form Golang Sri Lanka

May 18, 2022

a leaderboard system that can run on any Internet enabled device.

hacktoberfest-leaderboard a leaderboard system that can run on any Internet enabled device. How it works The app updates the leaderboard on README.md

Nov 1, 2021

GoDumpLsass is a simple tool that can dump lsass without to get caught by Windows Defender.

GoDumpLsass GoDumpLsass is a simple tool that can dump lsass without to get caught by Windows Defender. Releases https://github.com/Enelg52/GoDumpLsas

Nov 4, 2022

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Advent of Code 2021 Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved

Dec 2, 2021

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. This repository holds my submission/answers for these challenges.

Advent of Code - Zach Howell's Answers Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels

Jan 4, 2022
Enable your Golang applications to self update with S3

s3update Enable your Golang applications to self update with S3. Requires Go 1.8+ This package enables our internal tools to be updated when new commi

Jul 20, 2022
Go + Amis 后台研发解决方案 Demo

goAmis 一种易用且友好的后台研发解决方案 在我们平常的开发过程中,时常会出现以下情况: 需要临时编写脚本用于执行特定任务 需要获取特定形式的数据并转换成 Excel 或进行可视化呈现 需要根据业务快速搭建一套可用的操作后台,但苦于不熟悉前端 需要提供脚本程序给 运营 / 产品 或其他产品研发人

Oct 26, 2022
Application to learn and demo Tekton pipelines

Tekton sample Application to learn and demo Tekton pipelines Building $ go test ./pkg/api && go build Running it locally $ podman-compose up --force-r

Oct 28, 2021
Demo project which implements accumulative loyalty system

Gophermart Demo project which implements accumulative loyalty system POST /api/user/register — user registration; POST /api/user/login — user authenti

Mar 31, 2022
Code for the keycloak demo for the talk I gave at blablaconf 2021
Code for the keycloak demo for the talk I gave at blablaconf 2021

This demo illustrates the usage of keycloak to secure several service accross different clients using roles. How to Run: From a terminal you need to r

Oct 30, 2021
grpc + grpc gateway demo

grpc + grpc gateway demo

Nov 5, 2021
Quick and dirty demo of cobra functionality

Cobra Demo Purpose Testing out how cobra CLI's are parsed. Overview To use this repo, you can run something like this (from the directory where you cl

Sep 26, 2022
Goyaccparse: a demo for goyacc

goyaccparse That a demo for goyacc. Run Env Macos 10.14.6 go mod download generate yacc cd /Users/ouyangbin/Documents/001_work/01_git/goyaccparse/pars

Nov 8, 2021
A Go demo project

A Bookstore Demo Project 基于Gin和GRPC实现一个书店项目的demo,包括两个服务,book(书本管理)和customer(顾客管理),每个服务的http服务使用gin来实现,同时提供对应的RPC服务使用GRPC框架实现。book服务会调用customer的GRPC服务来

May 6, 2022
ispx github.com/goplus/spx interp demo

ispx github.com/goplus/spx interp demo

Jun 4, 2022