How to install Linux daemon using Kickstart

Dejan asked:

%post --log=/root/ks-post.log  --interpreter /bin/sh

exec < /dev/tty3 > /dev/tty3 2>&1
chvt 3    

cat > /mnt/sysimage/etc/init.d/daemon <<EOL
  #stuff goes here

chmod 755 /mnt/sysimage/etc/init.d/daemon 
ln -s /mnt/sysimage/etc/init.d/daemon /mnt/sysimage/etc/rc.d/rc3.d/S09daemon 
chvt 1

The problem is that daemon does not exist in /etc/init.d/
and when I remove /mnt/sysimage prefix, kickstart freezes in post install.

My answer:

There is no /mnt/sysimage directory in your freshly installed system.

Remember that %post operates within the chroot environment, unless you explicitly tell it not to do so.

To resolve the problem, use the correct pathnames.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.