Discussion:
Documentation suggestion for ARCHIVA_BASE and 'Installing as a Service on Linux'
Thad Humphries
2015-03-10 15:40:58 UTC
Permalink
I installed Archiva 2.1.1 standalone on Linux (openSUSE) with a separate
ARCHIVA_BASE, and ran it about a month with nohup. After upgrading to
2.2.0, I decided to run it as a service. I followed the directions at at
http://archiva.apache.org/docs/2.2.0/adminguide/standalone.html, including
adding myself as the RUN_AS_USER environment variable. The service started,
but it did not pick up my ARCHIVA_BASE environment variable, which I had
assumed to be the purpose of uncommenting bin/archiva's
RUN_AS_USER environment variable.

When I searched for this problem, the first hit I got was
http://mail-archives.apache.org/mod_mbox/archiva-users/201406.mbox/%3CDE946284-8A9F-4919-9D17-B1683B1700F7%40apache.org%3E
That pointed me to the solution: In conf/wrapper.conf, about 14 lines down,
edit "set.default.ARCHIVA_BASE=." to your ARCHIVA_BASE environment
variable, *not* the current directory (so in my case,
"set.default.ARCHIVA_BASE=/u3/archiva").

Unless bin/archiva is modified to pick up the RUN_AS_USER's
ARCHIVA_BASE, *strongly
recommend* that instruction above be added to "Installing as a Service on
Linux" in docs/2.2.0/adminguide/standalone.html
--
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)
Olivier Lamy
2015-03-11 00:41:03 UTC
Permalink
Thanks a lot for your investigations!!

I wonder if you could simply create a pull request for that here
https://github.com/apache/archiva ?
The file is located here
https://github.com/apache/archiva/blob/master/archiva-docs/src/site/apt/adminguide/standalone.apt.vm

Olivier
Post by Thad Humphries
I installed Archiva 2.1.1 standalone on Linux (openSUSE) with a separate
ARCHIVA_BASE, and ran it about a month with nohup. After upgrading to
2.2.0, I decided to run it as a service. I followed the directions at at
http://archiva.apache.org/docs/2.2.0/adminguide/standalone.html, including
adding myself as the RUN_AS_USER environment variable. The service started,
but it did not pick up my ARCHIVA_BASE environment variable, which I had
assumed to be the purpose of uncommenting bin/archiva's
RUN_AS_USER environment variable.
When I searched for this problem, the first hit I got was
http://mail-archives.apache.org/mod_mbox/archiva-users/201406.mbox/%3CDE946284-8A9F-4919-9D17-B1683B1700F7%40apache.org%3E
That pointed me to the solution: In conf/wrapper.conf, about 14 lines down,
edit "set.default.ARCHIVA_BASE=." to your ARCHIVA_BASE environment
variable, *not* the current directory (so in my case,
"set.default.ARCHIVA_BASE=/u3/archiva").
Unless bin/archiva is modified to pick up the RUN_AS_USER's
ARCHIVA_BASE, *strongly
recommend* that instruction above be added to "Installing as a Service on
Linux" in docs/2.2.0/adminguide/standalone.html
--
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)
--
Olivier Lamy
http://twitter.com/olamy | http://linkedin.com/in/olamy
Thad Humphries
2015-03-11 16:20:39 UTC
Permalink
Well, I may have spoken too soon. I'm missing something since Archiva is
*not* running on startup.

I set the ownership of /opt/apache-archiva-2.2.0/bin/archiva to root:root
and softlinked that to /etc/init.d/archiva. I can run `sudo
/etc/init.d/archiva start` and archiva starts (and sees my repositories
with the change to conf/wrapper.conf described earlier). However if I
restart the server, when it comes up Archiva is *not* running. I must
always start Archiva myself.

I even added a BEGIN INIT to the archiva script:

### BEGIN INIT INFO
# Provides: archiva
# Required-Start: $local_fs $remote_fs
# X-UnitedLinux-Should-Start: $named $syslog $time
# Required-Stop: $local_fs $remote_fs
# X-UnitedLinux-Should-Stop: $named $syslog $time
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start Archiva, a build artifact repository manager
from ASF.
### END INIT INFO

but to no effect.

Maybe this is a systemd thing since the machine is openSUSE 12.3. Any
ideas? Has anyone crafted a service script that can be started with
systemctl?
Post by Olivier Lamy
Thanks a lot for your investigations!!
I wonder if you could simply create a pull request for that here
https://github.com/apache/archiva ?
The file is located here
https://github.com/apache/archiva/blob/master/archiva-docs/src/site/apt/adminguide/standalone.apt.vm
Olivier
Post by Thad Humphries
I installed Archiva 2.1.1 standalone on Linux (openSUSE) with a separate
ARCHIVA_BASE, and ran it about a month with nohup. After upgrading to
2.2.0, I decided to run it as a service. I followed the directions at at
http://archiva.apache.org/docs/2.2.0/adminguide/standalone.html,
including
Post by Thad Humphries
adding myself as the RUN_AS_USER environment variable. The service
started,
Post by Thad Humphries
but it did not pick up my ARCHIVA_BASE environment variable, which I had
assumed to be the purpose of uncommenting bin/archiva's
RUN_AS_USER environment variable.
When I searched for this problem, the first hit I got was
http://mail-archives.apache.org/mod_mbox/archiva-users/201406.mbox/%3CDE946284-8A9F-4919-9D17-B1683B1700F7%40apache.org%3E
Post by Thad Humphries
That pointed me to the solution: In conf/wrapper.conf, about 14 lines
down,
Post by Thad Humphries
edit "set.default.ARCHIVA_BASE=." to your ARCHIVA_BASE environment
variable, *not* the current directory (so in my case,
"set.default.ARCHIVA_BASE=/u3/archiva").
Unless bin/archiva is modified to pick up the RUN_AS_USER's
ARCHIVA_BASE, *strongly
recommend* that instruction above be added to "Installing as a Service on
Linux" in docs/2.2.0/adminguide/standalone.html
--
"Hell hath no limits, nor is circumscrib'd In one self-place; but where
we
Post by Thad Humphries
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)
--
Olivier Lamy
http://twitter.com/olamy | http://linkedin.com/in/olamy
--
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)
Loading...