cron task to restart

Hi all,

I want to write a cron task to restart nuxeo each week. For that I have write a script called by the cron task.

When I execute the script myself, it works fine… But, when the script is executed by the cron task, all services (postgres, apache and shibboleth) are correctly restarted but not nuxeo.

It's stopped but not restarted. Do you have any idea ?

The cron task is executed as root user :

    # Arret Apache
    /Doc/apps/apache2/bin/apachectl stop

    # Arret Shibboleth (il y a p.e mieux ?)
    pkill -x shibd

    # Arret Postgres
    /etc/init.d/postgresql-9.5 stop

    # Arret Nuxeo
    export JAVA_HOME=/Doc/apps/jdk1.8.0_73/
    export LPATH=`/bin/cat /Doc/apps/PATH`
    export PATH=${LPATH}:${JAVA_HOME}/bin:${PATH}
    export NUXEO_CONF=/Doc/apps/ulr-config-nuxeo-71/nuxeo.conf
    /Doc/apps/nuxeo-cap-7.10-tomcat/bin/nuxeoctl stop

    # Demarrage Postgres
    export PGDATA=/Doc/Postgresql/9.5/data
    /etc/init.d/postgresql-9.5 start

    # Demarrage Nuxeo
    export LD_LIBRARY_PATH=/Doc/apps/shibboleth-sp/lib:/Doc/apps/apache2/lib:$LD_LIBRARY_PATH
    /Doc/apps/nuxeo-cap-7.10-tomcat/bin/nuxeoctl start

    # Lancement de shibboleth-sp
    /Doc/apps/shibboleth-sp/sbin/shibd -fc /Doc/apps/shibboleth-sp/etc/shibboleth/shibboleth2.xml
    # Lancement Apache
    /Doc/apps/apache2/bin/apachectl start
0 votes

0 answers

1601 views

ANSWER