PDA

View Full Version : need read AND write access to some files in /var/lib



redrat
03-06-2003, 12:30 PM
hi there,

I'm trying to remaster KNOPPIX to support an OpenSource Accounting programm (SQL-Ledger). I started with Knoppix KDE Version. Nearly everything went fine until I wanted to install PostgresQL. Actually I installed it, testet it in a chroot environment and everything went fine. I created the cloop image, the iso images, burned it to an RW and startet it.

Now PostgresQL wont start, because it can't open a file (/var/lib/postgres/data/global/pg_control) in read and _write_ mode. After searching a little bit through my filesystem I found that every file in /var/lib/postgres is a link to /KNOPPIX/var/lib/postgres which is not writeable.

There is a similar problem with apache (apache is not part of KDE Knoppix CD).

maybe someone can tell what I have to do to make these files (and some others) writeable. I know there must be a way, because apache is part of the 'normal' Knoppix CD.

There must be a possibility to change this.

hope anyone can help.

so long,
red

BlckJck
03-08-2003, 07:09 AM
A thought would be to make a sim link to the file. The sim link being in /var where your program is looking for it, and the file being decompressed and written to the /ramdisk/whatever. This would allow it to be written to, but changes will be lost on a reboot.

redrat
03-10-2003, 12:49 PM
where does knoppix stores which files get copied and symllinked to the ramdisk?

so long,
red

David Douthitt
03-12-2003, 03:19 AM
I'm trying to remaster KNOPPIX to support an OpenSource Accounting programm (SQL-Ledger). I started with Knoppix KDE Version.


Now PostgresQL wont start, because it can't open a file (/var/lib/postgres/data/global/pg_control) in read and _write_ mode. After searching a little bit through my filesystem I found that every file in /var/lib/postgres is a link to /KNOPPIX/var/lib/postgres which is not writeable.

This can be changed at a cost of less RAM memory. I do this for /usr/local on Knoppix, and have done it in the past for /var/apt and others. Generally, what you need is a place on /ramdisk to put the stuff, and create new links to everything that is needed.

For example, if /var/lib is writable, then:


# cd /var/lib
# cp -av --backup=.orig postgres postgres.new
# rm -f postgres
# mv postgres.new postgres

If /var/lib is NOT writable, then do the same thing, but at the /var/lib level:


# cd /var
# cp -av --backup=.orig lib lib.new
# rm -f lib
# mv lib.new lib

...then change into /var/lib and go thru the steps previously described.

If /var/lib/postgres is writable:



# cd /var/lib/postgres
# for i in * ; do \
cp -av --backup=.orig $i $i.new && \
mv $i.new $i ; \
done


Remember to make sure you've got space on /ramdisk (or wherever) for all this stuff....