WebFaction
Community site: login faq

I am installing an app from source. (archiveopteryx). it

"make install" worked fine but the next steop is to run lib/installer which will create a database and some users in my postgress instance and then install the conf file.

The problem is tha it insists that i execute it as root. Is there a workaround or can you run it for me?

Mark

asked 02 Jan '11, 21:32

Mark B
11
accept rate: 0%


I was able to build and install archiveopteryx using the following commands:

mkdir -p $HOME/src
cd $HOME/src
wget http://archiveopteryx.org/download/archiveopteryx-3.1.3.tar.bz2
tar -xjf archiveopteryx-3.1.3.tar.bz2

# delete lines 187-189 in installer.cpp to remove root check
sed -i '187,189d' $HOME/src/archiveopteryx-3.1.3/installer/installer.cpp

cd archiveopteryx-3.1.3

# notice that the Makefile has all of the paths hard-coded. Change them:
sed -i "s^/usr/local^$HOME^g" Makefile

# the logfile location is also wrong; fix it:
sed -i "s^syslog/mail^$HOME/archiveopteryx/log^" Makefile

make -f Makefile
make install

Install completed. Note the new $HOME/archiveopteryx directory.
You may want to add $HOME/archiveopteryx/bin to your PATH as well:

echo "export PATH=\$PATH:$HOME/archiveopteryx/bin" >> $HOME/.bash_profile
echo "export PATH=$HOME/bin:\$PATH" >> $HOME/.bash_profile

Now, log out and log back in.

Create a new Custom Application (listening on port) in the control panel called "pgport" to reserve a port. Enter it as a shell variable:

PGPORT=35270

Now proceed to install Postgresql:

cd $HOME/src
wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.4.6/postgresql-8.4.6.tar.bz2
tar -xjf postgresql-8.4.6.tar.bz2
cd postgresql-8.4.6
./configure --prefix=$HOME --with-pgport=$PGPORT
make && make install

#set up db
mkdir $HOME/pgsql
$HOME/bin/initdb -D $HOME/pgsql/data

#start server
$HOME/bin/postgres -D $HOME/pgsql/data >> $HOME/pgsql/log 2>&1 &

#create postgres superuser
createuser -s postgres -P

cd $HOME/archiveopteryx
./lib/installer -u $USER -g $USER -t $PGPORT -p postgres -P

Now, the installer fails saying that it can't find "psql" in the path, even though it's there. But it gives a command to copy-paste, and that works:

psql -h /tmp -p $PGPORT archiveopteryx -f - <<PSQL;
\set ON_ERROR_STOP
SET SESSION AUTHORIZATION aoxsuper;
SET client_min_messages TO 'ERROR';
\i $HOME/archiveopteryx/lib/schema.pg
\i $HOME/archiveopteryx/lib/flag-names
\i $HOME/archiveopteryx/lib/field-names
\i $HOME/archiveopteryx/lib/downgrades
PSQL

Hope that helps!

permanent link

answered 02 Jan '11, 21:50

ryans ♦♦
5.0k103960
accept rate: 43%

edited 02 Jan '11, 23:56

Thanks, but I had already made the same changes and "make install" worked fine.

The problem is the next part of the install process which is running ~/apps/archiveopteryx/lib/installer.

It wants to be run as root which is the problem I was asking for help with. Can you run it as root for me?

Thanks,

Mark

(02 Jan '11, 22:10) Mark B

We can't run an arbitrary binary as root. Instead, we're seeing if modifying the program source code to not check for root privileges is a feasible alternative. Will update this post when completed.

Sorry for misunderstanding your original question!

(02 Jan '11, 22:15) ryans ♦♦

Thanks. FYI, from the readme file:

  1. Run "lib/installer" to create a Unix user and group, a PostgreSQL user, the necessary database tables, and to generate an initial configuration file.

See installer(8) for details, or run "lib/installer -n" to see what commands the installer would run, without running them.

(02 Jan '11, 22:19) Mark B

The installer is written to require database server superuser access, so it seems we have to compile PostgreSQL from source. I have done so and updated the Original Post.

That said, archiveopteryx seems to have been written assuming that it would be installed to /usr/local with root privileges. We can't guarantee it will actually work. But we hope that this post has helped in case it does!

(02 Jan '11, 23:50) ryans ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×5

question asked: 02 Jan '11, 21:32

question was seen: 2,461 times

last updated: 03 Jan '11, 00:01

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM