Page 1 of 1

Starting CmapServer as a (systemd) service

Posted: Thu Jul 07, 2016 9:59 am
by khanal
Hi,
I've successfully installed CmapServer v6.04.01 on Suse Linux Enterprise Server (SLES) 12.
I managed to create a systemd service unit file to have it run as a service, and am sharing the instructions below, in case it helps anyone else. It required some trial and error because the advice out there for starting a Tomcat server (on which CmapServer runs) says to use Type=forking, which does not work correctly. (The correct Type=simple). And to stop the server, a delay is necessary (which I've set to 180 seconds, 90 seconds was too short) to allow the necessary time to shutdown gracefully.

To have it run as a service (using systemd), I have created the following service unit file and placed it in /etc/systemd/system/CmapServer.service

Code: Select all

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

[Service]
Type=simple
TimeoutStopSec=180
SuccessExitStatus=143
ExecStart=/srv/CmapServer/bin/CmapServer
ExecStop=/bin/kill -15 $MAINPID

[Install]
WantedBy=multi-user.target
To start it, as root:
systemctl start CmapServer.service
And to have it start automatically when the server starts:
systemctl enable CmapServer.service

Re: Starting CmapServer as a (systemd) service

Posted: Thu Jul 07, 2016 1:21 pm
by cmapadmin
Thanks. We'll use this to update our manual at:

http://cmap.ihmc.us/docs/cmapserver-ins ... manual.php