Starting CmapServer as a (systemd) service

Having problems with IHMC CmapServer? Think you have found a bug? Let us know!
Forum rules
Before you post a problem or bug, please be sure you have included the version number of IHMC CmapServer, the operating system and version, the amount of RAM, and any other information that allows us to be able to replicate the problem you are having. (i.e. what were you doing when the problem occur? were you running another program (application) by the time you have the problem?)
Post Reply
khanal
Posts: 5
Joined: Mon Aug 24, 2015 6:56 am

Starting CmapServer as a (systemd) service

Post 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
cmapadmin
Site Admin
Posts: 793
Joined: Sat Dec 13, 2008 2:22 pm

Re: Starting CmapServer as a (systemd) service

Post by cmapadmin »

Thanks. We'll use this to update our manual at:

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