You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Systemd Config for Alfresco Content-Services (ACS)
Systemd Unit file located at
/etc/systemd/system/acs.service
[Unit]
Description=Alfresco Content Services (ACS)
Requires=network.target local-fs.target
After=network.target local-fs.target
Before=ass.service
[Service]
Type=forking
User=alfresco01
Group=alfresco
LimitNOFILE=65536
WorkingDirectory=/home/alfresco01/log
ExecStart={{ tomcat_home }}/bin/startup.sh
ExecStop={{ tomcat_home }}/bin/shutdown.sh
# After ExecStart check whether alfresco is started (prevents ass-service to start to early)
ExecStartPost={{ tomcat_home }}/bin/check_acs_startup.sh
# PID File required for Monitoring
PIDFile=/home/alfresco01/content-services/tomcat/catalina.pid
Restart=no
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=600
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
The check_acs_startup.sh is a best practise to prevent the ASS service to start before ACS is up and running and therefore produces ERROR messages in the solr.log
Check_acs_startup.sh - Option wait for /alfresco url"
In this case the check_acs_startup.sh* checks for the /alfresco url to become availble...
#!/usr/bin/bash# Check Startup from ACS Tomcat for port 8080 so that alfresco webapp is loaded# echo "check tomcat server startup"until curl --silent --fail http://127.0.0.1:8080/alfresco/ > /dev/null;do# echo "wait...";
sleep 10;done#echo "jeepi, Tomcat server with Alfresco is ready"exit 0;
Check_acs_startup.sh - Option wait for "Server startup""
In this case the check_acs_startup.sh* checks for the "Server statup" message in the catalina.log file and ensures that all webapps are loaded until ASS service starts.
This can be useful in case there are bootstrap mechanism of custom webapps that can lead to indexing problems if solr starts to early bevore alfresco does.
If the check_acs_startup.sh* Script can't find the "Server statup" message in a certain amount of time it makes finishes itself to let ass start anyways.
Bootstrap problems of 3rd party webapps who are done after alfresco start can be handled that way.
#!/usr/bin/bash# Check Startup by Searching for "Server startup" in catalina.log
catalina_log_file="{{ tomcat_log_dir }}/catalina.log"
search_string="Server startup"
retries="{{ tomcat_check_startup_retries | default('15') }}"
delay_seconds="{{ tomcat_check_startup_delay_seconds | default('20') }}"for((i=1; i<=$retries; i++));doif tail -n200 "$catalina_log_file"| grep "$search_string";thenecho"Server startup message found in catalina.log"breakelseecho"Server startup message not found in catalina.log (Retry $i of $retries)"if [ $i-eq$retries ];thenecho"Maximum retries reached. Exiting..."exit 1
fi
sleep "$delay_seconds"fidone
Systemd Config for Alfresco Transform Services (ATS) Option 2
This is my perfered way and shows approach to handle Alfresco Transform Services with a separate Systemd Unit File
for each ATS Component like Transform-Core, Transform-Router, Shared-File-Store
#!/bin/bash# Scripts starts Transform-Services - Alfresco-Transform-Core-AIO (ATR)# AIO = All in Oneif [ $(id -u)-eq 0 ];thenecho"This script must not be executed by root"exitfi# Source Variables."{{ ats_home }}/transform-services_env.sh"### ATS - T-Engine AIO (All in One) Configs: #### Alfresco PDF Rendererexport JAVA_OPTS="${JAVA_OPTS} -DPDFRENDERER_EXE={{ ats_alfresco_pdf_renderer_exe }}"# Libreoffice Configsexport JAVA_OPTS="${JAVA_OPTS} -DLIBREOFFICE_HOME=${LIBREOFFICE_HOME}\ -DLIBREOFFICE_PORT_NUMBERS=${LIBREOFFICE_PORT_NUMBERS}\ -DLIBREOFFICE_MAX_TASKS_PER_PROCESS=${LIBREOFFICE_MAX_TASKS_PER_PROCESS}\ -DLIBREOFFICE_TIMEOUT=${LIBREOFFICE_TIMEOUT}"# ImageMagick Configsexport JAVA_OPTS="${JAVA_OPTS} -DIMAGEMAGICK_ROOT=${IMAGEMAGICK_HOME}\ -DIMAGEMAGICK_DYN=${IMAGEMAGICK_DYN}\ -DIMAGEMAGICK_EXE=${IMAGEMAGICK_EXE}\ -DIMAGEMAGICK_CONFIG=${IMAGEMAGICK_CONFIG}\ -DIMAGEMAGICK_CODERS=${IMAGEMAGICK_CODERS}"# ActiveMQ#export JAVA_OPTS="${JAVA_OPTS} -DACTIVEMQ_URL=failover:(tcp://10.0.2.15:61616)?timeout=3000"export JAVA_OPTS="${JAVA_OPTS} -DACTIVEMQ_URL=${ACTIVEMQ_URL}"# Shared File Storeexport JAVA_OPTS="${JAVA_OPTS} -DFILE_STORE_URL={{ ats_sfs_url }}/alfresco/api/-default-/private/sfs/versions/1/file"# Temp Directory AIO for Libreoffice, Imagemagick & Tika transformationsexport JAVA_OPTS="$JAVA_OPTS -Djava.io.tmpdir={{ ats_sfs_data }}"# Log Level:export JAVA_OPTS="$JAVA_OPTS -Dlogging.level.org.alfresco.transformer.metadataExtractors=warn"# JAVA Environment Settings:export JAVA_OPTS="${JAVA_OPTS} {{ ats_aio_java_opts }}"cd"${ATS_HOME}"||exit# Starting Transformer AIO# exec = Java process directly take over the shell process and have signals like SIGINT (Ctrl+C) forwarded to the Java processexec${JAVA_HOME}/bin/java ${JAVA_OPTS} -jar ${ATS_HOME}/alfresco-transform-core-aio-boot-*.jar >>${ATS_LOG_DIR}/ats-ate-aio.log
Reminder:
Don't forget to adjust the german LANG Settings for Libreoffice in .bashrc
to have correct Date Format in Alfresco Renditions (Document Previews)
# Language settings for Libreofficeexport LANG=de_DE.UTF-8
ats-ate-aio-exec-stop-post.sh
#!/bin/bash# ExecStopPost Script for Transform-Services - Alfresco-Transform-Core-AIO# AIO = All in One# This Scripts handles the termination of the AIO Child processes.# In particular it terminates all soffice.bin processesif [ $(id -u)-eq 0 ];thenecho"This script must not be executed by root"exitfi# Function to kill all soffice.bin child processeskill_soffice_processes() {
soffice_pids=$(ps -ef | egrep "soffice.bin"| grep -v grep | sed 's|^[^ ]*[ ]*\([0-9]*\) .*$|\1|g')forsoffice_pidin$soffice_pids;do
soffice_pid_name=$(ps -p "${soffice_pid}" -o comm=)echo"killing process ${soffice_pid_name} with process id ${soffice_pid}"kill"${soffice_pid}"done
}
kill_soffice_processes
exit 0
==> The Script ats-ate-aio_exec_stop_post.sh is my best practise to ensure that all libreoffice "soffice.bin" child processes which are generated by alfresco-transform-core-aio-boot-*.jar are terminated once the systemd service for transform-core AIO receives the SIGTERM signal (shutdown).