Nuxeo Server

Configuring the Nuxeo Platform as a Daemon with SysVinit

Updated: September 22, 2017 Page Information Edit on GitHub

This page is scheduled for review and update. Check back soon for updated content!

The procedure described here is targeted for the Debian Wheezy distribution, and should be valid for any Debian-based GNU/Linux distribution such as Ubuntu. In other GNU/Linux distributions some commands may be different.

Here is a sample script based on the one used in the Debian package.

/etc/init.d/nuxeo

#!/bin/sh
### BEGIN INIT INFO
# Provides:          nuxeo
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop Nuxeo
### END INIT INFO

DESC="Nuxeo"

NUXEO_USER=nuxeo
NUXEOCTL="/var/lib/nuxeo/server/bin/nuxeoctl"
NUXEO_CONF="/etc/nuxeo/nuxeo.conf"
export NUXEO_CONF

. /lib/init/vars.sh
. /lib/lsb/init-functions

create_pid_dir() {
    mkdir -p /var/run/nuxeo
    chown $NUXEO_USER:$NUXEO_USER /var/run/nuxeo
}

# Change ulimit to minimum needed by Nuxeo
ulimit -n 2048

case "$1" in
  start)
        log_daemon_msg "Starting" "$DESC\n"
        create_pid_dir
        su $NUXEO_USER -c "$NUXEOCTL --quiet startbg"
        ES=$?
        log_end_msg $ES
        ;;
  stop)
        log_daemon_msg "Stopping" "$DESC\n"
        su $NUXEO_USER -c "$NUXEOCTL --quiet stop"
        ES=$?
        log_end_msg $ES
        ;;
  restart)
        create_pid_dir
        su $NUXEO_USER -c "$NUXEOCTL --quiet restart"
        ES=$?
        log_end_msg $ES
        ;;
  force-reload)
        create_pid_dir
        su $NUXEO_USER -c "$NUXEOCTL --quiet restart"
        ES=$?
        log_end_msg $ES
        ;;
  status)
        su $NUXEO_USER -c "$NUXEOCTL --quiet status"
        exit $?
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
        exit 3
        ;;
esac

  1. Copy the shell script to /etc/init.d/nuxeo, replacing paths to match your installation.
  2. Enable the autostart creating the links in the rcX.d directories running the command (as root):

    $ update-rc.d nuxeo defaults
    
  3. Restart the machine and verify that the Nuxeo Platform is started automatically looking at the log file.

If you want to remove the automatic startup use the command (as root):

$ update-rc.d -f nuxeo remove

You can manage the service with the following command:

/etc/init.d/nuxeo [status|start|stop|...]
Other Linux-Related Documentation
 
3 days ago manonlumeau NXDOC-1323: Update BDE doc
2 years ago Julien Carsique 24
2 years ago Julien Carsique 23
3 years ago Solen Guitter 22
3 years ago Solen Guitter 21
4 years ago Solen Guitter 20
5 years ago Mathieu Guillaume 19
5 years ago Mathieu Guillaume 18
6 years ago Mathieu Guillaume 16 | Updated with current script
6 years ago Mathieu Guillaume 17 | Migrated to Confluence 4.0
6 years ago Solen Guitter 15
6 years ago Julien Carsique 14
6 years ago Julien Carsique 13
6 years ago Julien Carsique 12 | changed "nuxeo" with "$NUXEO_USER"
6 years ago Julien Carsique 10 | Point to source code of init.d scripts
6 years ago Julien Carsique 11
7 years ago Solen Guitter 9
7 years ago Benjamin Jalon 8
7 years ago Benjamin Jalon 7
7 years ago Benjamin Jalon 5
7 years ago Benjamin Jalon 6
7 years ago Benjamin Jalon 4
7 years ago Benjamin Jalon 2
7 years ago Benjamin Jalon 3
7 years ago Benjamin Jalon 1
History: Created by Benjamin Jalon