Looks right. You may also want to specify the RUN_AS_USER environment variable 
to run as a particular account.

Given what you have below, you might prefer to symlink the bin file to to 
/etc/init.d/archiva rather than having a wrapper script.

- Brett

On 20/07/2011, at 12:09 AM, Cristiano Costantini wrote:

> Hi all,
> I've set-up Archiva as service in CentOS in the way I describe below, I
> would like to ask you if you trust this solution or have to suggest a better
> one ;-)
> 
> 0) First I've installed Archiva as a standalone, configured an tested it to
> until it runs way I want
> 1) I've created the file /etc/init.d/archivad
> 2) I've assigned execution rights chmod +x /etc/init.d/archivad
> 3) I've edited the content this way:
> 
> #!/bin/bash
> #
> #Script to start/stop/status/restart archiva
> # chkconfig: 35 20 80
> # description: Archiva
> 
> ARCHIVA_PATH=/usr/local/archiva/bin
> 
> case "$1" in
>       start)
>               ${ARCHIVA_PATH}/archiva start
>               ;;
>       stop)
>               ${ARCHIVA_PATH}/archiva stop
>               ;;
>        status)
>                ${ARCHIVA_PATH}/archiva status
>                ;;
>       restart)
>               ${ARCHIVA_PATH}/archiva restart
>               ;;
>       *)
>       echo $"Usage: $0 {start|stop|status|restart}"
>       exit 1
> esac
> 
> 
> 4) I've tested the commands "service archiva start", "service archiva stop",
> "service archiva status", "service archiva restart" to verify they work
> 5) added as a service at startup by using "chkconfig --add archivad"
> "chkconfig archivad on"
> 6) rebooted the system and my archiva was there ;-)
> 
> do you see any problem with this approach?
> 
> Anyway I also hope this can be of help to other people with similar needs.
> bye,
> Cristiano

--
Brett Porter
[email protected]
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter




Reply via email to