Skip to main content
Topic: [Solved] Building Artix as a vagrant box issue: 'Cannot access /run/dinitctl' (Read 306 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Solved] Building Artix as a vagrant box issue: 'Cannot access /run/dinitctl'

I'm using vagrant packer to build a customized Artix Linux box,
but I'm running into this issue for the box:

Code: [Select]
/usr/bin/ls: cannot access '/run/dinitctl': No such file or directory

To clarify:
Vagrant packer starts a VM, loads an inserted ISO
and then uses scripts to install the box. 
It has no issue with enabling dinitctl  services on the loaded ISO, 
but for some reason cannot initiate dinitctl on the box. 

This is my list of scripts:
 -  liveVM.sh
 -   tables.sh
 -   partitions.sh
 -   base.sh
 -   mirrors.sh
 -   bootloader.sh
 -   pacman.sh
 -   setup.sh

_setup.sh_
Code: [Select]
#!/usr/bin/env bash

. /tmp/files/vars.sh

NAME_SH=setup.sh

# stop on errors
set -eu

echo ">>>> ${NAME_SH}: Debugging part.."
/usr/bin/artix-chroot ${ROOT_DIR} /usr/bin/ls -lha /dev/
/usr/bin/artix-chroot ${ROOT_DIR} ln -s /dev/dinitctl /run/dinitctl
/usr/bin/artix-chroot ${ROOT_DIR} /usr/bin/ls -lha /run/dinitctl
/usr/bin/artix-chroot ${ROOT_DIR} /usr/bin/dinitctl list

What to do?

Re: Building Artix as a vagrant box issue: 'Cannot access /run/dinitctl'

Reply #1
I've noticed that dinit works after a reboot. 

Write a script called services.sh  
in which all init services are loaded. 
Call this script in a second provisioner. 
Reboot at the end of the first provisioner. 

The virtual disk then gets loaded, 
and an ISO grub menu with countdown appears, 
bringing the user to the shell prompt, 
where the next scripts can be loaded via SSH.

This now brings me to quite a conundrum
In order to start the SSH service, I would need to run dinitctl. 
And in order to run dinitctl I need to reboot and then run an SSH service.