Creating a Linux systemd service to start the Atom

Document created by rich_patterson Employee on Sep 28, 2016Last modified by Adam Arrowsmith on Jan 24, 2018
Version 4Show Document
  • View in full screen mode

After installing a Linux Atom/Molecule, it is recommended to configure the system, to start that service automatically at boot time.

 

Previous Unix/Linux distributions used init.d/sysv type installations.  Ubuntu 14 uses Upstart.  RedHat 7, CentOS 7, and now Ubuntu 15 use a service manager called systemd.

 

As a best practice, the Atom should be installed as a service user, and not as root.  During the Atom installation, it is also recommended to decline the option to "Create Symlinks."  After the install, follow these steps to set up the service.

 

First, create the following file, owned by root, substituting the atomName, serviceUserName, pathToInstall, and installDirMountPoint appropriately:

( note: RequresMountsFor, is only needed for Molecule or Cloud installs, and can be omitted for Atom installations.  For installDirMountPoint, use the absolute path to the mount point for your NFS drive )

 

File Name: /etc/systemd/system/[atomName].service 

 

Contents:

[Unit]
Description=Dell Boomi [atomName]
After=network.target
RequiresMountsFor=[installDirMountPoint]
[Service]
Type=forking
User=[serviceUserName]
ExecStart=[pathToInstall]/bin/atom start
ExecStop=[pathToInstall]/bin/atom stop
ExecReload=[pathToInstall]/bin/atom restart
[Install]
WantedBy=multi-user.target

 

Next, from the command window, execute the following command:

sudo systemctl enable [atomName]

 

The atom can then be stopped, started, etc, with the following commands:

sudo systemctl start [atomName]

sudo systemctl restart [atomName]

sudo systemctl stop [atomName]

sudo systemctl status -l [atomName]

 

Run the following command, and verify that the Atom service is running as the correct user:

ps -ef | grep java

 

Reboot the machine, and verify that the service comes back online as expected.

 

Reference Links:

2 people found this helpful

Attachments

    Outcomes