Tags:
create new tag
view all tags

Calling commands at install time

Sometimes it is necessary to do a one-off command during the install process for a machine. You can do this by through the install component, (see docs for full details) you need to insert a tag into the desired position in the installmethods list resource and then specify the command. Here's an example:


!install.installmethods                 mREPLACE(mkdir_etc, mkdir_etc helloworld)
!install.imethod_helloworld          %oneshot% echo "hello world" > /tmp/helloworld

This method will be called after the mkdir_etc method which creates /etc

Because of the way the shell command is evaluated the use of %oneshot% is not considered the best way to do most things. The recommended approach is to create a method in the relevant component and call that instead. For example, many components have an install method:


install.imethod_fstab           fstab install /root
install.imethod_network       network install /root

-- StephenQuinney - 26 Oct 2007

Topic revision: r1 - 2008-02-07 - squinney
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback