Package postinstall scripts

Arto Teras ateras at niksula.hut.fi
Mon Apr 15 19:56:14 CEST 2002


Hi, 

When adding new packages to FAI there sometimes seem to be some problems
with postinstall scripts. Recently we added rwhod to the package list of
nodes (running potato) and the rwhod package contains among other things the
following lines in the postinst script:

> if ! id -u rwhod >/dev/null 2>&1; then
>         adduser --quiet --system --home /var/spool/rwho rwhod
> fi
> mkdir -p -m 755 /var/spool/rwho
> chown -R rwhod /var/spool/rwho

When FAI installs the package the target disk is not mounted as root 
(it's under /mnt/target if I remember correctly). This causes the postinst
script to fail to create the directories in /var/spool and to create
symbolic links using update-rc-d. Obviously the rwhod daemon then doesn't
work after installation.

I succeeded in solving the problem partially by creating a script in the
fai config tree where the path names recognize the target:

mkdir -p -m 755 $target/var/spool/rwho
chown rwhod $target/var/spool/rwho
...

Changing the ownership of the /var/spool/rwho directory still fails and this
is an ugly workaround.

What would be the right way the solve the problem so that the package would
install nicely both with and without FAI? 

Should I file a bug report against the package? At least with potato FAI is
not an official part of the distribution, so I guess this cannot be seen as
a bug there? However, the rwhod package in woody seems to contain an almost
identical postinstall script --- I haven't tried that yet but most likely it
won't work either. 

AJT

-- 
Arto Teräs --- See http://www.iki.fi/ajt/ for contact info



More information about the linux-fai mailing list