I have an RHEL7 system that needs to start an lmgrd license file for some autodesk software. And since RHEL7 now uses systemd, I have to change my old sysinit scripts to work here. So here’s what I did.

In /etc/systemd/system, create autodesk_license.service

[Unit]
Description=Autodesk Flexnet License Server
After=default.target

[Service]
Type=forking
ExecStart=/usr/lib/systemd/scripts/autodesk_license_start
ExecStop=/usr/lib/systemd/scripts/autodesk_license_stop

[Install]
Alias=autodesk
WantedBy=default.target

Make the autodesk_license_start/stop scripts in /usr/lib/systemd/scripts

autodesk_license_start

#!/bin/bash

/opt/flexnetserver/lmgrd -l /opt/flexnetserver/autodesk.log -c /opt/flexnetserver/autodesk.lic

autodesk_license_stop

#!/bin/bash

/opt/flexnetserver/lmutil lmdown -q -c /opt/flexnetserver/autodesk.lic

Start it with:

# systemctl start autodesk_license

Enable it with:

# systemctl enable autodesk_license