Skip to content

thin-edge/tedge-services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tedge-services

thin-edge.io service file definitions for the following init systems:

  • sysvinit
  • openrc
  • runit
  • s6-overlay
  • supervisord
  • systemd (see note below)

This is a community driven repository where users are encouraged to create PRs to add support for any additional init system, or make changes to any of the existing definitions.

NOTES:

  • systemd definitions are provided out of the box via the official linux packages (e.g. tedge, tedge-agent etc.). The definitions included in the project are meant to aid in building linux images (e.g. using yocto).

Installation

The service definitions provided in the project are published to the Community Repository for easy installation.

The service definitions packages are there to compliment the existing thin-edge.io components by extending support beyond the default systemd service definitions.

The init system specific packages included the following contents:

  • service definitions for all thin-edge.io components (one package per init system type)
  • /usr/bin/tedgectl script used to abstract the calls to the init system (e.g. start/stop/restart/enable/disable services)
  • /etc/tedge/system.toml configuration file used by thin-edge.io to abstract interactions with the init system

If you have not already installed thin-edge.io on your device, please follow the installation guide from the official thin-edge.io documentation.

Pre-requisites

You must have already installed thin-edge.io and its components prior to installing the service definitions. If you don't so this, then you will have to manually enable and start the thin-edge.io services.

Debian/Ubuntu

Overview of packages

Package Link
tedge-sysvinit Latest version of 'tedge-sysvinit' @ Cloudsmith
tedge-openrc Latest version of 'tedge-openrc' @ Cloudsmith
tedge-runit Latest version of 'tedge-runit' @ Cloudsmith
tedge-s6overlay Latest version of 'tedge-s6overlay' @ Cloudsmith
tedge-supervisord Latest version of 'tedge-supervisord' @ Cloudsmith
tedge-systemd Latest version of 'tedge-systemd' @ Cloudsmith

Install instructions

Setup the repository using:

curl -1sLf 'https://dl.cloudsmith.io/public/thinedge/community/setup.deb.sh' | sudo bash

Then install your preferred init system service definition files:

# sysvinit
sudo apt-get install tedge-sysvinit

# openrc
sudo apt-get install tedge-openrc

# runit
sudo apt-get install tedge-runit

# s6-overlay (docker friendly init system)
sudo apt-get install tedge-s6overlay

# supervisord
sudo apt-get install tedge-supervisord

# systemd
sudo apt-get install tedge-systemd

RHEL/Fedora/RockyLinux

Overview of packages

Package Link
tedge-sysvinit Latest version of 'tedge-sysvinit' @ Cloudsmith
tedge-openrc Latest version of 'tedge-openrc' @ Cloudsmith
tedge-runit Latest version of 'tedge-runit' @ Cloudsmith
tedge-s6overlay Latest version of 'tedge-s6overlay' @ Cloudsmith
tedge-supervisord Latest version of 'tedge-supervisord' @ Cloudsmith
tedge-systemd Latest version of 'tedge-systemd' @ Cloudsmith

Setup the repository using:

curl -1sLf 'https://dl.cloudsmith.io/public/thinedge/community/setup.rpm.sh' | sudo bash

Then install your preferred init system service definition files:

# sysvinit
sudo dnf install tedge-sysvinit

# openrc
sudo dnf install tedge-openrc

# runit
sudo dnf install tedge-runit

# s6-overlay (docker friendly init system)
sudo dnf install tedge-s6overlay

# supervisord
sudo dnf install tedge-supervisord

# systemd
sudo dnf install tedge-systemd

Alpine Linux

Overview of packages

Package Link
tedge-sysvinit Latest version of 'tedge-sysvinit' @ Cloudsmith
tedge-openrc Latest version of 'tedge-openrc' @ Cloudsmith
tedge-runit Latest version of 'tedge-runit' @ Cloudsmith
tedge-s6overlay Latest version of 'tedge-s6overlay' @ Cloudsmith
tedge-supervisord Latest version of 'tedge-supervisord' @ Cloudsmith
tedge-systemd Latest version of 'tedge-systemd' @ Cloudsmith

Install instructions

Setup the repository using:

curl -1sLf 'https://dl.cloudsmith.io/public/thinedge/community/setup.alpine.sh' | sudo bash

Then install your preferred init system service definition files:

# sysvinit
sudo apk add tedge-sysvinit

# openrc
sudo apk add tedge-openrc

# runit
sudo apk add tedge-runit

# s6-overlay (docker friendly init system)
sudo apk add tedge-s6overlay

# supervisord
sudo apk add tedge-supervisord

# systemd
sudo apk add tedge-systemd

Other distributions / tarball

The service definitions are also available via a tarball which can be manually installed using the following steps:

  1. Download and extract the tarball for your preferred init system

    SysVinit

    curl -O 'https://dl.cloudsmith.io/public/thinedge/community/raw/names/tedge-sysvinit/versions/latest/tedge-sysvinit.tar.gz'
    sudo tar xzvf tedge-sysvinit.tar.gz -C /

    SysVinit (yocto)

    curl -O 'https://dl.cloudsmith.io/public/thinedge/community/raw/names/tedge-sysvinit-yocto/versions/latest/tedge-sysvinit-yocto.tar.gz'
    sudo tar xzvf tedge-sysvinit-yocto.tar.gz -C /

    OpenRC

    curl -O 'https://dl.cloudsmith.io/public/thinedge/community/raw/names/tedge-openrc/versions/latest/tedge-openrc.tar.gz'
    sudo tar xzvf tedge-openrc.tar.gz -C /

    runit

    curl -O 'https://dl.cloudsmith.io/public/thinedge/community/raw/names/tedge-runit/versions/latest/tedge-runit.tar.gz'
    sudo tar xzvf tedge-runit.tar.gz -C /

    s6-overlay

    curl -O 'https://dl.cloudsmith.io/public/thinedge/community/raw/names/tedge-s6overlay/versions/latest/tedge-s6overlay.tar.gz'
    sudo tar xzvf tedge-s6overlay.tar.gz -C /

    supervisord

    curl -O 'https://dl.cloudsmith.io/public/thinedge/community/raw/names/tedge-supervisord/versions/latest/tedge-supervisord.tar.gz'
    sudo tar xzvf tedge-supervisord.tar.gz -C /

    systemd

    curl -O 'https://dl.cloudsmith.io/public/thinedge/community/raw/names/tedge-systemd/versions/latest/tedge-systemd.tar.gz'
    sudo tar xzvf tedge-systemd.tar.gz -C /
  2. Enable/start the services using the generic tedgectl script which in included in the tarball

    For example if you want to enable all of the services then use:

    tedgectl enable tedge-mapper-c8y
    tedgectl start tedge-mapper-c8y
    
    tedgectl enable tedge-mapper-az
    tedgectl start tedge-mapper-az
    
    tedgectl enable tedge-mapper-aws
    tedgectl start tedge-mapper-aws
    
    tedgectl enable tedge-mapper-collectd
    tedgectl start tedge-mapper-collectd
    
    tedgectl enable tedge-agent
    tedgectl start tedge-agent
    
    tedgectl enable tedge-configuration-plugin
    tedgectl start tedge-configuration-plugin
    
    tedgectl enable tedge-log-plugin
    tedgectl start tedge-log-plugin
    
    tedgectl enable c8y-firmware-plugin
    tedgectl start c8y-firmware-plugin

    Notes

    Some of the service will exit if you have not already setup thin-edge. Check out the Getting Started guide for details on how to configure and use thin-edge.io.

Developers

This section details how to build the linux packages used to deliver the service files.

Pre-requisites

You need to have nfpm installed first before running the build tasks.

Build

  1. Build the packages (including generating service files from the templates)

    just build
  2. Start test containers (one per init system)

    just start
  3. Start a console and test the functions

    Start console inside one of the containers

    docker compose exec tedge-sysvinit sh

    Check service

    # Start service
    tedgectl start tedge-agent
    
    # Check it is running
    pgrep -fa tedge-agent
    
    # Check log file
    tail -f /var/log/tedge-agent.log
    
    # Stop service
    tedgectl stop tedge-agent
    
    # Check if service is stopped
    pgrep -fa tedge-agent

Init Systems

tedgectl is provided in the project to help interact with each of the init systems using the same interface. Each of the init systems can be interacted with using the following commands.

Start service

tedgectl start <name>

Stop service

tedgectl stop <name>

Enable service

tedgectl enable <name>

Disable service

tedgectl disable <name>

sysvinit

Get logs

tail -f /var/log/<name>.log

openrc

Get logs

tail -f /var/log/<name>.log

s6-overlay

Get logs

TODO

Acknowledgements

Hosted By: Cloudsmith

Package repository hosting is graciously provided by Cloudsmith. Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence.