From cc1c3d46f61566afbb0b87c1b1b4d5b7a442595a Mon Sep 17 00:00:00 2001 From: lemniskett Date: Mon, 11 Jan 2021 14:00:43 +0700 Subject: [PATCH] Further integrate Archboxctl. --- archbox.conf | 10 ++++++++++ archboxinit.bash | 4 +++- install.sh | 1 - 3 files changed, 13 insertions(+), 2 deletions(-) mode change 100644 => 100755 install.sh diff --git a/archbox.conf b/archbox.conf index 2a4ece3..1ef1077 100644 --- a/archbox.conf +++ b/archbox.conf @@ -16,5 +16,15 @@ MOUNT_MOD="no" LAZY_UMOUNT="no" # Put your desired enviroment variable here, for example +# # ENV_VAR="HOME=/var/home/lemniskett" +# ENV_VAR="" + +# Parse a Systemd service and executes it on boot, order matters, for example +# +# SERVICES=(vmware-networks-configuration vmware-networks vmware-usbarbitrator nginx) +# +# Keep in mind that this doesn't resolve service dependencies, so you may need to +# enable the dependencies manually +SERVICES=() diff --git a/archboxinit.bash b/archboxinit.bash index 016da0a..0227d41 100644 --- a/archboxinit.bash +++ b/archboxinit.bash @@ -34,7 +34,9 @@ case $1 in [[ $MOUNT_RUN = "yes" ]] && rbind /run [[ $MOUNT_MOD = "yes" ]] && rbind /lib/modules && rbind /boot [[ -d /var/lib/dbus ]] && rbind /var/lib/dbus - chroot $CHROOT /usr/local/bin/serviced >/dev/null 2>&1 + for i in ${SERVICES[@]}; do + chroot $CHROOT /bin/su -c "/usr/local/bin/archboxctl exec $i" > /dev/null 2>&1 + done exit 0 ;; stop) diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index c191b98..c55a883 --- a/install.sh +++ b/install.sh @@ -8,7 +8,6 @@ install -v -D -m 755 ./copyresolv.bash /usr/local/share/archbox/bin/copyresolv install -v -D -m 755 ./archboxcommand.bash /usr/local/share/archbox/bin/archbox install -v -D -m 755 ./remount_run.bash /usr/local/share/archbox/bin/remount_run install -v -D -m 755 ./chroot_setup.bash /usr/local/share/archbox/chroot_setup.bash -install -v -D -m 755 ./archboxctl.bash /usr/local/share/archbox/archboxctl.bash install -v -D -m 755 ./archboxinit.bash /usr/local/share/archbox/bin/archboxinit [[ -z $1 ]] && exit 0