API: "Specified service does not exist"

000

Well-Known Member
Jun 3, 2008
436
19
68
hello,

this URL Return service status · cPanel & WHM Developer Portal show:

1631001631433.png
then if you run
Code:
$query = "https://IP:2087/json-api/servicestatus?api.version=1&service=crond";
result is

1631001779186.png

but if you run
Code:
$query = "https://IP:2087/json-api/servicestatus?api.version=1&service=tomcat";
you get
1631001879268.png
and of course!, TOMCAT is running and enabled.

why this error?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,494
1,009
313
cPanel Access Level
Root Administrator
Hey hey! I did some testing on my end and confirmed that since the modern implementation of Tomcat is per-user and not server-wide, that option should be removed from the API call. Our team will get that API documentation page updated soon. Thanks for pointing this out!
 

000

Well-Known Member
Jun 3, 2008
436
19
68
Hey hey! I did some testing on my end and confirmed that since the modern implementation of Tomcat is per-user and not server-wide, that option should be removed from the API call. Our team will get that API documentation page updated soon. Thanks for pointing this out!
oh master but: the REAL IMPROV is: add option to restart tomcat,not remove from documentation.

:rolleyes:
 

000

Well-Known Member
Jun 3, 2008
436
19
68
Tomcat no longer runs as a server daemon, so there is no way to globally restart the service, which means the documentation is no longer relevant.
then how we can run
Code:
su - USERCP -s /bin/bash -c 'ubic restart ea-tomcat85'
from PHP ??
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,494
1,009
313
cPanel Access Level
Root Administrator
A server daemon is a process that runs in the background, and usually can be restarted by calling the script in the /etc/init.d directory.

Running the ubic command doesn't invoke a daemon at all - it's a different type of process.
 

000

Well-Known Member
Jun 3, 2008
436
19
68
thanks master,
some option to do that using PHP ? (in this case we can create a CONSOLE to restart TomCat)