Gentoo Archives: gentoo-dev

From: Brian Jackson <iggy@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] ebuilds creating mountpoints
Date: Sat, 07 Jan 2006 18:37:38
Message-Id: 43C0095D.7000101@gentoo.org
In Reply to: [gentoo-dev] ebuilds creating mountpoints by Stefaan
1 You could handle it the way the baselayout ebuild does.
2
3 --Iggy
4
5 Stefaan wrote:
6 > Hi!
7 >
8 > I'm having an issue with the openafs-ebuild, and I don't see a
9 > solution for the moment. I wondered if someone on the list would:
10 >
11 > Prerequisite:
12 > The ebuild needs to create the /afs directory, and remove that same
13 > directory when it is uninstalled.
14 >
15 > The obvious solution seems to do "keepdir", so portage would attempt
16 > to make the directory and put a .keep file in there. I say attempt,
17 > because the following problem will occur during an re-merge or
18 > upgrade, while the mountpoint is in use:
19 > !!! Cannot write to '/afs'.
20 > !!! Please check permissions and directories for broken symlinks.
21 > etc.
22 > (This is related to bug #9849, if I'm not mistaken)
23 >
24 > The currently implemented solution is to do
25 > pkg_prerm()
26 > {
27 > rmdir /afs 2> /dev/null
28 > }
29 > pkg_postinst()
30 > {
31 > mkdir /afs 2> /dev/null
32 > }
33 > which works fine when remerging an already emerged ebuild. That's
34 > because pkg_prerm is ran first, and pkg_postinst afterwards.
35 > However, during an upgrade, pkg_prerm of the old version is ran
36 > _after_ pkg_postinst of the new version. This results in the
37 > directory disappearing, and therefore afs failing to start.
38 >
39 > Any input is greatly appreciated,
40 > Thanks,
41 > Stefaan
42 >
43
44
45 --
46 Stuff for sale -- http://www.brianandsara.net/temp/forsale.html
47 Gentoo Linux -- http://www.gentoo.org
48 IVTV -- http://ivtv.writeme.ch
49 --
50 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] ebuilds creating mountpoints Stefaan <stefaan@g.o>