Skip to content
Snippets Groups Projects
Commit 8c18c557 authored by Vivek Dutta's avatar Vivek Dutta
Browse files

Fix start of services on container start

parent 067e975c
No related branches found
No related tags found
1 merge request!10Fix iopsys template
Pipeline #26463 passed
...@@ -123,7 +123,7 @@ function install_package() ...@@ -123,7 +123,7 @@ function install_package()
resolve_dependency ${dep} resolve_dependency ${dep}
install_package ${root} ${pkg} install_package ${root} ${pkg}
else else
echo "Installing package ${pkg}" log "Installing package ${pkg}"
copy_single_opkg ${root} ${pkg} copy_single_opkg ${root} ${pkg}
fi fi
} }
...@@ -138,5 +138,5 @@ if [ -z "${2}" ]; then ...@@ -138,5 +138,5 @@ if [ -z "${2}" ]; then
exit 0; exit 0;
fi fi
echo "Preparing container for swmodd" echo "Installing pkg [${2}] with dependencies"
install_package ${1} ${2} install_package ${1} ${2}
...@@ -53,6 +53,7 @@ install_busybox() ...@@ -53,6 +53,7 @@ install_busybox()
${rootfs}/etc/config \ ${rootfs}/etc/config \
${rootfs}/etc/init.d \ ${rootfs}/etc/init.d \
${rootfs}/etc/rc.d \ ${rootfs}/etc/rc.d \
${rootfs}/etc/hotplug.d \
${rootfs}/bin \ ${rootfs}/bin \
${rootfs}/sbin \ ${rootfs}/sbin \
${rootfs}/usr/bin \ ${rootfs}/usr/bin \
...@@ -141,10 +142,22 @@ EOF ...@@ -141,10 +142,22 @@ EOF
chmod +x ${rootfs}/etc/init.d/boot chmod +x ${rootfs}/etc/init.d/boot
cat <<EOF >> "${rootfs}/bin/boot_lxc"
#!/bin/sh
for f in \`ls -1 /etc/init.d/\`; do
/etc/init.d/\$f enable
/etc/init.d/\$f start
done
/bin/login root
EOF
chmod +x ${rootfs}/bin/boot_lxc
cat <<EOF >> "${rootfs}/etc/inittab" cat <<EOF >> "${rootfs}/etc/inittab"
::sysinit:/etc/init.d/rcS S boot ::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown ::shutdown:/etc/init.d/rcS K shutdown
console::askfirst:/bin/login root console::respawn:/bin/boot_lxc
EOF EOF
# writable and readable for other # writable and readable for other
chmod 644 "${rootfs}/etc/inittab" || return 1 chmod 644 "${rootfs}/etc/inittab" || return 1
...@@ -268,17 +281,16 @@ lxc.net.0.name = eth0 ...@@ -268,17 +281,16 @@ lxc.net.0.name = eth0
lxc.net.0.mtu = 1500 lxc.net.0.mtu = 1500
EOF EOF
libdirs="\ libdirs="lib"
lib \
lib64 \ #cp -rf /lib/functions.sh ${rootfs}/lib/
usr/lib64" #cp -rf /lib/functions ${rootfs}/lib/
#cp -rf /lib/preinit ${rootfs}/lib/
#cp -rf /lib/* ${rootfs}/lib/ for dir in ${libdirs}; do
#for dir in ${libdirs}; do if [ -d "/${dir}" ] && [ -d "${rootfs}/${dir}" ]; then
# if [ -d "/${dir}" ] && [ -d "${rootfs}/${dir}" ]; then echo "lxc.mount.entry = /${dir} ${dir} none ro,bind 0 0" >> "${path}/config"
# echo "lxc.mount.entry = /${dir} ${dir} none ro,bind 0 0" >> "${path}/config" fi
# fi done
#done
echo "lxc.mount.entry = /sys/kernel/security sys/kernel/security none ro,bind,optional 0 0" >> "${path}/config" echo "lxc.mount.entry = /sys/kernel/security sys/kernel/security none ro,bind,optional 0 0" >> "${path}/config"
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment