Skip to content

RFC: OpenRC initscript #114

@automorphism88

Description

@automorphism88

I'm using Gentoo, and since bees comes with a systemd service but I'm using OpenRC, I decided to write my own initscript. It is based somewhat on the beesd script (which I couldn't just use directly since it wouldn't work with start-stop-daemon), and designed to work with a conf.d file that's similar to the one that's installed in /etc/bees, but with some additional options added to control logging and {io,}nice level. It also avoids bashisms so that it can be run with dash as /bin/sh.

Is this something you would be interested in merging upstream? My /etc/init.d file can be found here: https://github.com/automorphism88/gentoo-overlay/blob/master/sys-fs/bees/files/bees.initd and the corresponding template /etc/conf.d file can be found here: https://github.com/automorphism88/gentoo-overlay/blob/master/sys-fs/bees/files/bees.confd. Note that while this initscript works for me, it should be considered experimental. I haven't tried to get this merged into the official Gentoo ebuild yet since I figured it would be even better to upstream the script directly into bees.

A few things I noticed about the beesd script when I was using it as a reference were:

  1. Is there some reason to chmod 700 the database file instead of chmod 600? Executable permission doesn't seem to be necessary.
  2. stat -c %s FILE is a simpler, faster, and more portable way of checking file size than the method used in the beesd script (which, I believe, relies on a GNU extension in sed to interpret \t as tab). Incidentally, stat -c %i can also be used to check whether a directory is a btrfs subvolume, since a btrfs subvolume will have an inode number of 256.
  3. Why not mount the root subvolume with noatime? Unlike btrfs-specific mount options like compression, this one can be set per-subvolume, so it will default to relatime even if the rest of the filesystem is mounted with noatime. Probably wouldn't make much difference in this case, I'm just in the habit of using noatime everywhere unless there's a specific need to do otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions