Skip to content
Snippets Groups Projects
Commit 143746bc authored by Mate Farkas's avatar Mate Farkas
Browse files

Mini-init has been added.

parent 43f7f021
No related branches found
No related tags found
No related merge requests found
......@@ -15,9 +15,10 @@ RUN chown -R vagrant. /home/vagrant/
ADD etc/sudoers.d/vagrant /etc/sudoers.d/vagrant
ADD root/bin/start_ssh /root/bin/start_ssh
RUN chmod 0700 /root/bin/start_ssh
ADD sbin/mini-init /sbin/mini-init
RUN chmod u+x /sbin/mini-init
ADD etc/mini-init /etc/mini-init
EXPOSE 22
CMD /root/bin/start_ssh
CMD /sbin/mini-init
......@@ -2,3 +2,19 @@
Base image for Vagrant using Ubuntu 16.04 LTS (Xenial Xerus).
## mini-init
The container by default starts with the **/sbin/mini-init** process, which executes binaries located under **/etc/mini-init**.
The binaries are executed in alphabetical order and the boot process is logged in **/var/log/mini-init.log**.
The *last* binary shouldn't exit. Make sure that an **ssh** daemon is running to be able to use the container with **Vagrant**.
Example:
/etc/mini-init/
10-disks
20-networks
50-services
99-ssh
File moved
#!/bin/bash
CONFDIR="/etc/mini-init"
LOGFILE="/var/log/mini-init.log"
for file in `ls $CONFDIR`
do
script="$CONFDIR/$file"
echo "Running startup script: $script" >> $LOGFILE
bash -x $script &>> $LOGFILE
echo "Startup script [$script] finished with exit code: $?" >> $LOGFILE
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment