Lucee service on boot for SLES15 systemctl

OS: SLES 15 (Suse)
Lucee Version: 5.3.10

I’m trying to get lucee to start on boot - SLES15 appears to insist on systemctl and ignores lucee_ctl in /etc/init.d

I’ve created a lucee.service in /usr/lib/systemd/system/ and symlinked it from /etc/systemd/system, then tried

systemctl daemon-reload
systemctl enable lucee
systemctl start lucee

However, this appears to just start the lucee service and then immediately exit it.

Contents of lucee.service:

[Unit]
Description=Apache Tomcat Lucee
After=network.target

[Service]
Type=forking

User=lucee
Group=lucee

ExecStart=/opt/lucee/lucee_ctl start
ExecStop=/opt/lucee/lucee_ctl stop
ExecReload=/opt/lucee/lucee_ctl reload
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Where am I going wrong?

Do you see anything written in the catalina logs? Have you tried switching to the user “lucee” and starting lucee_ctl from there?

Easiest way is to install Tomcat 9 then install lucee as a WAR or JAR

However, if you want to break your teeth on this

lucee.service should be a symlink to /usr/lib/systemd/system/lucee.service
disable app armor

Your service file should look like this

# Systemd unit file for default tomcat
# 
# To create clones of this service:
# DO NOTHING, use tomcat@.service instead.

[Unit]
Description=Apache Tomcat Lucee Web Application Container
After=syslog.target network.target

[Service]
TasksMax=576
LimitNOFILE=8192
Type=simple
EnvironmentFile=/etc/lucee/lucee.conf
Environment="NAME="
EnvironmentFile=-/etc/sysconfig/lucee
ExecStart=/usr/libexec/lucee/server start
ExecStop=/usr/libexec/lucee/server stop
SuccessExitStatus=143
User=lucee
Group=tomcat


[Install]
WantedBy=multi-user.target
~                         

SuSe/SES requires you to properly init services via rewriteing everything the SLES way.

mkdir /usr/libexec/lucee
install lucee as normal
do not install connector or run at boottime
cp -R /opt/lucee/ to /etc/lucee
vi /etc/lucee/lucee.conf

tomcat conf should be

LUCEE_CFG_LOADED="1"
LUCEE_BASE="/opt/lucee"
# Where your java installation lives
#JAVA_HOME="/usr/libi64/jvm/jre"

# Where your tomcat installation lives
CATALINA_HOME="/opt/lucee/tomcat/lib"

# System-wide tmp
CATALINA_TMPDIR="/var/cache/lucee/temp"

JAVA_OPTS="-Djava.library.path=/usr/lib"

# You can change your tomcat locale here
#LANG="en_US"

# Run tomcat under the Java Security Manager
SECURITY_MANAGER="false"

cp /opt/lucee/lucee_ctrl t /usr/libexec/lucee

You might have to change around catalina and java_opts depending on how lucee is installed, how java is installed, but this will put you down the correct path.

2 Likes

Thanks Terry for the detailed response. I shall play with it and report back! (bit of a pain, not my decision to use SLES…)