apache directory server: do not start with systemctl

Bug #1676035 reported by Gaétan QUENTIN
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apache-directory-server (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Environment:
--------------

on ubuntu 16.04.2 TLS

Issue:
--------
systemctl start apacheds.service
Failed to start apacheds.service: Unit apacheds.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status apacheds.service' for details.

Steps to reproduce:
------------------

- install oracle jdk8 :
apt install oracle-java8-installer oracle-java8-unlimited-jce-policy oracle-java8-set-default
- install apacheds:
apt install apacheds
- start apacheds:
  systemctl enable apacheds.service
  systemctl start apacheds.service

Logs/output/files:
------------
root@security:~# systemctl status apacheds.service
● apacheds.service - Apache Directory Server
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

Mar 25 11:14:04 security systemd[1]: [/lib/systemd/system/apacheds.service:11] Executable path is not absolute, ignoring: ${JAVA_HOME}/bin/java ${JAVA_OPTS} -Dapacheds.controls=${ADS_CONTROLS}
Mar 25 11:14:04 security systemd[1]: apacheds.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.

Root cause
----------

 - first: apacheds.service contains syntax error
systemctl edit apacheds.service:

with won't work:
ExecStart=${JAVA_HOME}/bin/java ${JAVA_OPTS} \
            -Dapacheds.controls=${ADS_CONTROLS} \
            -Dapacheds.extendedOperations=${ADS_EXTENDED_OPERATIONS} \
            -Dlog4j.configuration=file:${ADS_INSTANCES}/${ADS_INSTANCE}/conf/log4j.properties \
            -Dapacheds.log.dir=${ADS_INSTANCES}/${ADS_INSTANCE}/log \
            -cp '${ADS_HOME}/lib/*' \
            org.apache.directory.server.UberjarMain \
            ${ADS_INSTANCES}/${ADS_INSTANCE}/

this works fine:
ExecStart=/bin/sh -c "${JAVA_HOME}/bin/java ${JAVA_OPTS} \
            -Dapacheds.controls=${ADS_CONTROLS} \
            -Dapacheds.extendedOperations=${ADS_EXTENDED_OPERATIONS} \
            -Dlog4j.configuration=file:${ADS_INSTANCES}/${ADS_INSTANCE}/conf/log4j.properties \
            -Dapacheds.log.dir=${ADS_INSTANCES}/${ADS_INSTANCE}/log \
            -cp '${ADS_HOME}/lib/*' \
            org.apache.directory.server.UberjarMain \
            ${ADS_INSTANCES}/${ADS_INSTANCE}/"

 - second:
   /usr/lib/jvm/default-java do not exists if oracle jdk is installed: i had to create it:
   cd /usr/lib/jvm/ && ln -s java-8-oracle default-java

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apache-directory-server (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.