Auto startup script for Sametime Community and proxy | ST 11.0 FP1 | Linux - RHEL 8.1 ( Solutions shared )

Hello, I need a Linux auto startup script for Sametime Community and proxy servers. I tried this below script for proxy, it stops the proxy service properly however it is unable to start it automatically. Please do help. Thank you in advance.

useradd -m -U -d /opt/hcl/sametimeproxy/ -s /bin/false tomcat
chown -R tomcat: /opt/hcl/sametimeproxy/

vim /etc/systemd/system/tomcat.service
[Unit]
Description=ST Proxy Tomcat 9 servlet container
After=network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
Environment=“JAVA_HOME=/opt/hcl/sametimeproxy/jdk8u222-b10-jre”
Environment=“CATALINA_BASE=/opt/hcl/sametimeproxy”
Environment=“CATALINA_HOME=/opt/hcl/sametimeproxy”
Environment=“CATALINA_PID=/opt/hcl/sametimeproxy/temp/tomcat.pid”
Environment=“CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC”
ExecStart=/opt/hcl/sametimeproxy/bin/startup.sh
ExecStop=/opt/hcl/sametimeproxy/bin/shutdown.sh
[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable tomcat
systemctl stop tomcat

Sametime proxy auto startup script - https://hclpnpsupport.hcltech.com/csm?id=kb_article&sys_id=39195edf1bbeccdcc13e748edc4bcbbb

Regards,

Elango

This seems to be a correct service file.

As it is not able to start the server I assume that you have changed the ports of the proxy server to be in the protected range below 1024. Most probably you chose ports 80 and 443 as this is what users most times expect.

But linux does not allow non- root- users to use so called "Priviledged Ports".

One possible solution for this would be to change back the ports to something above 1024 and then setup a port forwarding via iptables or an nginx server that redirects the "expected" ports to the ones the tomcat is listening on.

Here on Stackoverflow you can read all about multiple ways to do this and why use some and not others. Attention: It's lot of stuff to read...

Hi Torsten, Yes I got your point.

I already changed the port from default to 443 in the ST proxy server. Is there any other solutions for this apart from the port forwarding or using a reverse proxy in front of the ST proxy server.

I did not find a working solution for me to circumvent this linux security restrictions. I am not a linux professional and therefor had to google a lot.

And if you read about solutions like "authbind" or "setcap" you find a lot of reasons to NOT use them...

Thats why I changed back the ports to the original ones and for my server used an nginx reverse proxy...

Of course my solution was just to "play around" a little bit. At our customers I work close with the linux admins there, and they set up this stuff as they know exactly what they are doing...

Since this is FP1 - Check the JAVA_HOME variable in your startup script - it changed in FP1 compared to the TN that was written for 11.0.

Hi Anthony, Thanks for the response. I don't see jdk file in the /opt/hcl/sametimeproxy folder. I have installed Sametime proxy in the /opt/hcl/sametimeproxy.

[root@im sametimeproxy]# find. -name jdk*


[root@im sametimeproxy]# find /opt/hcl/sametimeproxy -name jdk*

[root@im sametimeproxy]# pwd
/opt/hcl/sametimeproxy

[root@im sametimeproxy]# ls
bin CONTRIBUTING.md HCL-README keygen.sh logs openjdk RUNNING.txt stproxy_optionalLib work
BUILDING.txt HCL-LICENSE install.sh lib NOTICE README.md setenv.sh temp
conf HCL-NOTICES javasharedresources LICENSE offlinedbsetup.jar RELEASE-NOTES stproxylogs.zip webapps
[root@im sametimeproxy]#

its located @ /opt/hcl/sametimeproxy/openjdk

Hi Tony, Thanks for the response. Yes I replaced the JAVA_HOME=/opt/hcl/sametimeproxy/openjdk then reload the systemctl but still doesn't start the service .to /opt/hcl/sametimeproxy/bin/startup.sh

It stops the proxy automatically but unable to start it. Please do help. Thank you in advance.

[root@hklsmt ~]# grep JAVA_HOME /etc/systemd/system/tomcat.service
Environment="JAVA_HOME=/opt/hcl/sametimeproxy/openjdk"
[root@hklsmt ~]#
[root@hklsmt ~]# netstat -tulpn |grep 443
[root@hklsmt ~]#
[root@hklsmt ~]# systemctl start tomcat
[root@hklsmt ~]#
[root@hklsmt ~]# netstat -tulpn |grep 443
[root@hklsmt ~]#
[root@hklsmt ~]# /opt/hcl/sametimeproxy/bin/startup.sh
Using CATALINA_BASE: /opt/hcl/sametimeproxy
Using CATALINA_HOME: /opt/hcl/sametimeproxy
Using CATALINA_TMPDIR: /opt/hcl/sametimeproxy/temp
Using JRE_HOME: /opt/hcl/sametimeproxy/openjdk
Using CLASSPATH: /opt/hcl/sametimeproxy/bin/bootstrap.jar:/opt/hcl/sametimeproxy/bin/tomcat-juli.jar
Tomcat started.
[root@hklsmt ~]# netstat -tulpn |grep 443
tcp6 0 0 :::443 :::* LISTEN 605973/java
[root@hklsmt ~]# systemctl stop tomcat
[root@hklsmt ~]# netstat -tulpn |grep 443
[root@hklsmt ~]#

Also kindly share the auto startup script for Sametime Community service in Linux - RHEL 8.1

Does anyone have an idea of the startup issue?

I have logged a case with HCL, the case is with the Extended team.

Sametime proxy auto startup | CentOS 8.1 | Sametime 11.0 FP1 | ST proxy port 443
===========================================================

chown -R root:root /opt/hcl/sametimeproxy/

vim /etc/systemd/system/tomcat.service
[Unit]
Description=ST Proxy Tomcat 9 servlet container
After=network.target
[Service]
Type=forking
User=root
Group=root
Environment=“JAVA_HOME=/opt/hcl/sametimeproxy/openjdk”
Environment=“CATALINA_BASE=/opt/hcl/sametimeproxy”
Environment=“CATALINA_HOME=/opt/hcl/sametimeproxy”
Environment=“CATALINA_PID=/opt/hcl/sametimeproxy/temp/tomcat.pid”
Environment=“CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC”
ExecStart=/opt/hcl/sametimeproxy/bin/startup.sh
ExecStop=/opt/hcl/sametimeproxy/bin/shutdown.sh
[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl enable tomcat
systemctl start tomcat

Sametime Community auto startup | CentOS 8.1 | ST 11.0 FP1 | Using Daniel's script

Download and extract Daniel script - start_script.tar
Install the script using this command - ./install_script

Edit this file - vim /opt/nashcom/startscript/rc_domino_script

Please search this - LD_LIBRARY_PATH=$Notes_ExecDirectory:$LD_LIBRARY_PATH

Please append this - ( :$Notes_ExecDirectory/sticc)
LD_LIBRARY_PATH=$Notes_ExecDirectory:$LD_LIBRARY_PATH:$Notes_ExecDirectory/sticc

From This:

if [ ${LARCH} = “sunspa” ]; then
LD_LIBRARY_PATH=$Notes_ExecDirectory:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
fi

if [ ${LARCH} = “linux” ]; then
LD_LIBRARY_PATH=$Notes_ExecDirectory
export LD_LIBRARY_PATH
fi

Modify like this:

if [ ${LARCH} = “sunspa” ]; then
LD_LIBRARY_PATH=$Notes_ExecDirectory:$LD_LIBRARY_PATH:$Notes_ExecDirectory/sticc
export LD_LIBRARY_PATH
fi

if [ ${LARCH} = “linux” ]; then
LD_LIBRARY_PATH=$Notes_ExecDirectory:$LD_LIBRARY_PATH:$Notes_ExecDirectory/sticc
export LD_LIBRARY_PATH
fi

Save and close the file.

systemctl daemon-reload
systemctl enable domino.service
systemctl start domino

Thanks to @Anthony Payne