To create a service for Nexus artifact repository:
As root, copy Artifact-Repository-Nexus-VA.B.C.D.E/nexus-A.B.C-D/bin/nexus to /etc/init.d.
Make the nexus script executable by running the following command:
# chmod 755 /etc/init.d/nexus
Edit the nexus script by changing the following values:
Change NEXUS_HOME to the absolute folder location, for example NEXUS_HOME="usr/local/nexus".
Set the RUN_AS_USER option to a user with restricted rights that you want to use to run the service. Note that you should not be running Nexus as root.
Change PIDDIR to a directory where the user has read/write permissions, for example ./.
Change the owner and group of your Nexus-related directories to the user that you want to use to run the service.
From the commandline, browse to /etc/init.d.
Install the service by running the following command:
# update-rc.d nexus defaults