From 99af416e14756d1f4d037486f86f5030e13443b9 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 19 Apr 2023 21:41:05 +0100 Subject: [PATCH] use /bin/sh for init scripts --- modules/s6/default.nix | 4 +--- modules/s6/scripts/rc.init | 2 +- modules/s6/scripts/rc.shutdown | 2 +- modules/s6/scripts/rc.shutdown.final | 2 +- modules/s6/scripts/runlevel | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/s6/default.nix b/modules/s6/default.nix index 171f42f..c62b510 100644 --- a/modules/s6/default.nix +++ b/modules/s6/default.nix @@ -1,7 +1,6 @@ { config, pkgs, ... }: let inherit (pkgs) - busybox execline s6 s6-init-bin @@ -16,12 +15,11 @@ let name = "s6-scripts"; src = ./scripts; phases = ["unpackPhase" "installPhase" ]; - buildInputs = [busybox]; + buildInputs = []; installPhase = '' mkdir $out cp -r $src $out/scripts chmod -R +w $out - patchShebangs $out/scripts ''; }; service = dir { diff --git a/modules/s6/scripts/rc.init b/modules/s6/scripts/rc.init index 162d1d9..9c0747d 100755 --- a/modules/s6/scripts/rc.init +++ b/modules/s6/scripts/rc.init @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh rl="$1" shift diff --git a/modules/s6/scripts/rc.shutdown b/modules/s6/scripts/rc.shutdown index 83a29dd..81fac67 100755 --- a/modules/s6/scripts/rc.shutdown +++ b/modules/s6/scripts/rc.shutdown @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh ### Things to do before hardware halt/reboot/poweroff. diff --git a/modules/s6/scripts/rc.shutdown.final b/modules/s6/scripts/rc.shutdown.final index 048c6db..3f46b87 100755 --- a/modules/s6/scripts/rc.shutdown.final +++ b/modules/s6/scripts/rc.shutdown.final @@ -1,4 +1,4 @@ -#!/nix/store/xbdqbi2mscmhl5wcpbgpjdwxbsrvpkil-bash-5.1-p16/bin/sh -e +#!/bin/sh -e ### Things to do *right before* the machine gets rebooted or ### powered off, at the very end of the shutdown sequence, diff --git a/modules/s6/scripts/runlevel b/modules/s6/scripts/runlevel index a7fbb48..3c2cfcd 100755 --- a/modules/s6/scripts/runlevel +++ b/modules/s6/scripts/runlevel @@ -1,4 +1,4 @@ -#!/usr/bin/env sh -e +#!/bin/sh -e ### This script is called once at boot time by rc.init, and is ### also called by the runleveld service every time the user