Back

klaros as a service ubuntu

Toggle
klaros as a service ubuntu
Answer
7/17/19 10:41 AM
I have created Klaros.service file in /etc/systemd/system and below id the file config. I am able to start stop klaros service.


Description=Klaros
After=network.target


Type=forking

ExecStart=/opt/klaros-testmanagement/bin/startup.sh
ExecStop=/opt/klaros-testmanagement/bin/shutdown.sh

When i am trying to enable klaros service by systemctl enable klaros i received below details.

 sudo systemctl enable klaros

The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.
0 (0 Votes)

RE: klaros as a service ubuntu
Answer
7/17/19 10:54 AM as a reply to Aditya Vijjan.
Haven't verified this yet, I think you are missing something like this:

12
[Install]
WantedBy=multi-user.target
I will check back later once verified.

Regards,

Torsten
0 (0 Votes)

RE: klaros as a service ubuntu
Answer
7/17/19 11:47 AM as a reply to Torsten Stolpmann.
Hello Aditya,

the following is a verified solution for systemd (/etc/systemd/system/klaros.service):

12345678910111213
[Unit]
Description=Klaros Testmanagement Service
After=syslog.target network.target

[Service]
Type=forking
User=klaros

ExecStart=/opt/klaros-testmanagement/bin/startup.sh
ExecStop=/opt/klaros-testmanagement/bin/shutdown.sh

[Install]
WantedBy=multi-user.target

Please note that the User=klaros setting requires the creation of a user and setting the correct ownership for /opt/klaros-testmanagement:

12
adduser klaros
chown -R klaros /opt/klaros-testmanagement

There is no need to run Klaros under a root account and we discourage users to do so.

Hope this helps, please  let me know if this works for you.

Torsten
0 (0 Votes)