Init Script Packager

Welcome to AURIS, the Artix User Repository of Init Scripts. This is a platform to crowdsource init scripts.

Consuming scripts

This package repository is the wild west, similar to the AUR. Assume scripts here have not been vetted.

Before you grab init scripts, evaluate your personal tolerance for running potentially malicious scripts on your computer.

  • If you have no tolerance, turn back now. It's possible that good scripts will ascend into the official repos in time. Be patient.
  • If you have a tiny bit of tolerance, find the repo containing the init script you're looking for, thoroughly inspect it, and install each file manually
  • If you are feeling brave, find the branch in this repo corresponding to the init script you're looking for, inspect it, then install the pacman package linked in the readme
  • If you are a wild child, enable the package repo and install like you would any official package. This ensures your packages stay up-to-date with your system without any oversight, which would only bother you if you weren't a freak.

Notice that convenience is inversely proportional to the security afforded to your system. There are some guardrails in place, but in the end you're placing user scripts on your system.

Using the pacman package repository

here are the steps to follow if you've settled on using pacman to download and install init script packages:

  1. Download the key: curl https://auris.artixlinux.org/api/packages/auris/arch/repository.key -o repository.key

  2. Display the key ID: gpg --show-keys repository.key

  3. Add the key: pacman-key --add repository.key

  4. Sign it using the ID from step 2: pacman-key --lsign-key 74E5750C4A3C00F037070EF2357B525A97500B9F

  5. Add the repo to the bottom of /etc/pacman.conf:

     [auris]
     SigLevel = Required
     Server = https://auris.artixlinux.org/api/packages/auris/arch/$repo/$arch
    
  6. pacman -Sy

Contributing scripts

Want to share your init script with the world? First thing you've got to do is sign up and verify your email.

Repo creation

Next, create an issue on this repo with a title that follows the pattern create: <package name>-<init system>. For example, if you're contributing a runit script for act-runner, you'd title your issue create: act-runner-runit. This will trigger the creation of a repo that you will have write access to.

Committing the init script

Clone the repo. Create a file called pkg.yml. This file must contain the following properties:

license: "BSD-2-Clause" # the license for your init script in SPDX identifier format
depends: # list of required packages. usually the package the init script is for plus the init system itself
    - act-runner
    - runit
source: # list of files that make up your init script package. files vary by init system. See the next section for details
    - act_runner.run
    - act_runner.log.run
allowedBuilders: # list of usernames that are allowed to trigger builds for this package
    - robort     # put your username here
backup: [] # list of files for pacman to back up. optional.

License must be one from the whitelist.

Add the files mentioned in the source section, then commit and push.

Notes on init script files

Each init system has a pattern for init scripts. The workflow takes these into account when producing the final PKGBUILD.

/etc/conf.d/.conf files are automatically added to the PKGBUILD's backup array.

dinit

  • Files that end with .script go in /usr/lib/dinit/<basename>
  • Files that end with .user.script go in /usr/lib/dinit/user/<basename>
  • Files that end with .user go in /etc/dinit.d/user/<basename>
  • Files that end with .conf go in /etc/dinit.d/config
  • All other files go in /etc/dinit.d/

openrc

  • Files that end with .initd go in /etc/init.d/<basename>
  • Files that end with .user.initd go in /etc/user/init.d/<basename>
  • Files that end with .confd go in /etc/conf.d/<basename>

runit

  • .conf files go /etc/runit/sv/<basename>/conf
  • files that end with .log.{run,finish,check} install to /etc/runit/sv/<basename>/log/{run,finish,check}
  • files that end with .{run,finish,check} install to /etc/runit/sv/<basename>/{run,finish,check}

s6

Create a flattened directory structure (replacing directory separators with __) representing the things you'd like to install to /etc/s6/sv/. As a special case, files ending in .conf are installed to /etc/s6/config.

At the very least, service-name__type must be present (which is installed to /etc/s6/sv/service-name/type). For more information, read s6's documentation. Then create the additional files you need.

For instance, a simple daemon, without a logger, could be:

File Contents
daemon__type longrun
daemon__run #!/bin/execlineb
daemon

A simple oneshot, with a dependency:

File Contents
action__type oneshot
action__up /usr/bin/my-oneshot action
action__dependencies.d__mount-filesystems empty

If service whose name ends in -srv is present, a logger service ending in -log is automatically created for it, following the template present in Artix's s6-services repository.

File Contents
daemon-srv__type longrun
daemon-srv__run #!/bin/execlineb
fdmove -c 2 1
daemon

In a single package, more than one service may be present.

Building the package

Final step is building the package. Come back to this repo and create a new issue that follows the pattern build: <package name>-<init system>. For example, build: act-runner-runit. The workflow bot will reply with pipeline status. First it will generate a PKGBUILD automatically. If that succeeds it will build and publish the package, pending a moderator's approval.

If the build fails, look at the logs for a hint as to why. If you've already built the package once already today, you may receive a message that the version already exists in the package registry. You can adjust the pkgrel by adding i.e. emergencyPkgrel: 2 to your pkg.yml file.

S
Description
Repo responsible for running build jobs
Readme 254 KiB
Languages
Markdown 100%