Add systemd service support with servicectl

This commit is contained in:
lemniskett 2020-11-09 21:08:19 +07:00
parent fdcb3acf30
commit dc88d63389
3 changed files with 10 additions and 5 deletions

View File

@ -11,7 +11,4 @@ mount -R /run $CHROOT/run
mount -R /lib/modules $CHROOT/lib/modules mount -R /lib/modules $CHROOT/lib/modules
mount -R /boot $CHROOT/boot mount -R /boot $CHROOT/boot
mount -R /var/lib/dbus $CHROOT/var/lib/dbus mount -R /var/lib/dbus $CHROOT/var/lib/dbus
chroot $CHROOT /usr/local/bin/serviced
# Runit will re-execute scripts those are finished,
# so we create a neverending loop.
while true; do sleep 10800; done

View File

@ -14,6 +14,13 @@ pacman-key --init
pacman-key --populate archlinux pacman-key --populate archlinux
msg "Installing essential packages..." msg "Installing essential packages..."
pacman -Syu base base-devel xorg pulseaudio --noconfirm pacman -Syu base base-devel xorg pulseaudio --noconfirm
msg "Installing servicectl..."
mkdir -p /usr/local/share/servicectl/enabled
curl -L 'https://raw.githubusercontent.com/lemniskett/servicectl/master/servicectl' > /usr/local/share/servicectl/servicectl 2>/dev/null
curl -L 'https://raw.githubusercontent.com/lemniskett/servicectl/master/serviced' > /usr/local/share/servicectl/serviced 2>/dev/null
chmod +x /usr/local/share/servicectl/service{d,ctl}
ln -s /usr/local/share/servicectl/servicectl /usr/local/bin/servicectl
ln -s /usr/local/share/servicectl/serviced /usr/local/bin/serviced
msg "Creating user account..." msg "Creating user account..."
CHROOT_USER="$(cat /tmp/archbox_user)" CHROOT_USER="$(cat /tmp/archbox_user)"
useradd -m $CHROOT_USER useradd -m $CHROOT_USER
@ -27,3 +34,4 @@ while true; do
passwd $CHROOT_USER && break passwd $CHROOT_USER && break
done done
sed -i 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers sed -i 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers
echo "Don't forget to run /usr/local/share/archbox/bin/archboxinit in host on boot"

View File

@ -7,7 +7,7 @@ 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 ./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 ./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 ./chroot_setup.bash /usr/local/share/archbox/chroot_setup.bash
install -v -D -m 755 ./archboxinit.bash /usr/local/share/archbox/bin/archboxinit
[[ -z $1 ]] && exit 0 [[ -z $1 ]] && exit 0
if [ $1 = "--exp" ]; then if [ $1 = "--exp" ]; then