Restarting Lucee Remotely on Linux


#1

I very rarely have to restart lucee, but it does happen :slight_smile:

I am trying to setup a script so I can remotely restart it over ssh if I am at home.
I tested this with apache and it works with starting and stopping HTTPD , but I can’t seem to get Lucee to start. I can stop it, but I can’t restart or start it remotely.

example :

ssh user@myserver.com 'sudo service lucee_ctl restart'
ssh user@myserver.com 'sudo /opt/lucee/lucee_ctl restart'

Both fail even though it says they worked.

Oddly this works

ssh user@myserver.com 'sudo service lucee_ctl stop'
ssh user@myserver.com 'sudo service /opt/lucee/lucee_ctl stop'

It seems there is something in the startup script that keeps it from starting the server this way.

If I ssh user@myserver.com then run sudo service lucee_ctl restart it always works then I can exit.

I am on Amazon Linux. Any help would be appreciated I am probably just missing something simple.


#2

What output do you get?
What’s in the remote log files?


#3

From the command line of the other machine :

 sh -i /home/ec2-user/key.pem -t ec2-user@myserver.com 'sudo /opt/lucee/lucee_ctl start'

* Starting Lucee: . . . [DONE]
--------------------------------------------------------
It may take a few moments for Lucee to start processing
CFML templates. This is normal.
------------------------------------------------------
Connection to myserver.com closed.

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
28-Aug-2018 10:20:17.825 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxPosrSize' to '67589953' did not find a matching property.
28-Aug-2018 10:20:17.896 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.28
28-Aug-2018 10:20:17.896 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Oct 7 2015 18:25:21 UTC
28-Aug-2018 10:20:17.896 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.28.0
28-Aug-2018 10:20:17.896 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
28-Aug-2018 10:20:17.896 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.9.77-31.58.amzn1.x86_64
28-Aug-2018 10:20:17.896 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
28-Aug-2018 10:20:17.896 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /opt/lucee/jdk/jre/jre
28-Aug-2018 10:20:17.897 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_66-b17
28-Aug-2018 10:20:17.897 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
28-Aug-2018 10:20:17.897 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/lucee/tomcat
28-Aug-2018 10:20:17.897 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/lucee/tomcat
28-Aug-2018 10:20:17.898 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/lucee/tomcat/conf/logging.properties
28-Aug-2018 10:20:17.898 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
28-Aug-2018 10:20:17.898 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms256m
28-Aug-2018 10:20:17.899 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx3048m
28-Aug-2018 10:20:17.899 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xss256K
28-Aug-2018 10:20:17.899 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxPermSize=128m
28-Aug-2018 10:20:17.899 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:lib/lucee-inst.jar
28-Aug-2018 10:20:17.899 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/opt/lucee/tomcat/endorsed
28-Aug-2018 10:20:17.899 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/lucee/tomcat
28-Aug-2018 10:20:17.900 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/lucee/tomcat
28-Aug-2018 10:20:17.900 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/lucee/tomcat/temp
28-Aug-2018 10:20:17.900 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/l$
28-Aug-2018 10:20:18.047 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8888"]
28-Aug-2018 10:20:18.062 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Aug-2018 10:20:18.063 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
28-Aug-2018 10:20:18.066 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Aug-2018 10:20:18.071 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 647 ms
28-Aug-2018 10:20:18.080 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
28-Aug-2018 10:20:18.080 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.28

#4

If I start it from the actual machine here is the log:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
28-Aug-2018 10:23:38.780 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxPosrSize' to '67589953' did not find a matching property.
28-Aug-2018 10:23:38.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.28
28-Aug-2018 10:23:38.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Oct 7 2015 18:25:21 UTC
28-Aug-2018 10:23:38.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.28.0
28-Aug-2018 10:23:38.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
28-Aug-2018 10:23:38.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.9.77-31.58.amzn1.x86_64
28-Aug-2018 10:23:38.839 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
28-Aug-2018 10:23:38.839 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /opt/lucee/jdk/jre/jre
28-Aug-2018 10:23:38.839 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_66-b17
28-Aug-2018 10:23:38.839 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
28-Aug-2018 10:23:38.839 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/lucee/tomcat
28-Aug-2018 10:23:38.840 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/lucee/tomcat
28-Aug-2018 10:23:38.840 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/lucee/tomcat/conf/logging.properties
28-Aug-2018 10:23:38.840 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
28-Aug-2018 10:23:38.840 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms256m
28-Aug-2018 10:23:38.841 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx3048m
28-Aug-2018 10:23:38.841 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xss256K
28-Aug-2018 10:23:38.841 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxPermSize=128m
28-Aug-2018 10:23:38.841 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:lib/lucee-inst.jar
28-Aug-2018 10:23:38.841 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/opt/lucee/tomcat/endorsed
28-Aug-2018 10:23:38.842 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/lucee/tomcat
28-Aug-2018 10:23:38.842 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/lucee/tomcat
28-Aug-2018 10:23:38.842 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/lucee/tomcat/temp
28-Aug-2018 10:23:38.842 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/$
28-Aug-2018 10:23:38.972 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8888"]
28-Aug-2018 10:23:38.987 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Aug-2018 10:23:38.989 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
28-Aug-2018 10:23:38.994 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Aug-2018 10:23:38.994 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 559 ms
28-Aug-2018 10:23:39.004 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
28-Aug-2018 10:23:39.004 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.28
28-Aug-2018 10:23:43.603 INFO [dev-a.furnishweb.com-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Sk$
lucee-server-root:/opt/lucee/lib/lucee-server
===================================================================
SERVER CONTEXT
-------------------------------------------------------------------
- config:/opt/lucee/lib/lucee-server/context
- loader-version:4.3
===================================================================


#5

No one has tried to do this?


#6

you’re running very old versions of java and tomcat, which version of lucee are you running?

does the problem occur with the latest stable release?


#7

I am in the class of if it isn’t broken don’t fix it, but I guess in this case I’ll need to spin up a new server to test it out. I was just hoping to get it fixed on the current server. I’ll spin up a new instance when I get time.


#8

Newest Version of Lucee works. So I guess there is no hope of correcting it for my version. I’ll just work on upgrading and testing my application on the newer version at least for this part of the application.