Custom Service in Service Manager

kbisignani

Member
Jan 29, 2012
19
0
51
cPanel Access Level
Root Administrator
Good afternoon,

I'm looking to add a new service to WHM's Service Manager. I've dug through the forums and found some helpful posts, namely:

* http://forums.cpanel.net/f5/how-add-services-monitored-tailwatch-128829.html
(But the PDF doesn't exist, but I found it here: http://web.archive.org/web/20120518...esources/TrainingSlides08/Troubleshooting.pdf)

* http://forums.cpanel.net/f5/how-add-services-service-monitor-17721.html

I've added a file to the directory as instructed "/etc/chkserv.d" named cwirkinit with the following contents:

Code:
service[cwirkinit]=x,x,x,/root/cwirk/cwirkinit,cwirkinit,root


It looks like everything is working except for two things:

1. If I go to WHM > Service Configuration > Service Manager, I see cwirkinit under Additional Services (yay!) but when I hit Save, I get the following:
This looks good...
Saving Changes to cwirkinit (enabled) using custom (/etc/chkserv.d/cwirkinit) driver......Done
This does not...
The “cwirkinit” service is not a known service.
at /usr/local/cpanel/Cpanel/Exception.pm line 102.
Cpanel::Exception::new("Cpanel::Exception::Services::Unknown", HASH(0x9bf62c0)) called at /usr/local/cpanel/Cpanel/Exception.pm line 53
Cpanel::Exception::create("Services::Unknown", HASH(0x9bf62c0)) called at /usr/local/cpanel/scripts/restartsrv line 404
Scripts::restartsrv::_lookup_service_restart_info(Scripts::restartsrv=HASH(0x9bf05d4), "cwirkinit") called at /usr/local/cpanel/scripts/restartsrv line 42
Scripts::restartsrv::script("Scripts::restartsrv", "--wait", "cwirkinit") called at /usr/local/cpanel/scripts/restartsrv line 21

2. If I kill off the process, the service never gets restarted.

// edit - added this
I've also just noticed under Server Status > Service Status that I have cwirkinit showing up there (pretty cool - didn't expect it there, but I'll gladly take it) but it shows as running, even though I know it really isn't. I've even checked ps -A and confirmed that the process really isn't there.
// end edit

I'm assuming I've done something wrong here, but just not sure what. Any thoughts?

Thank you,
~ Kyle
 
Last edited:

kbisignani

Member
Jan 29, 2012
19
0
51
cPanel Access Level
Root Administrator
Just to follow up...

The error when saving the Service Manager continues to show up. I'm assuming something new needs to be configured that either hasn't been documented or is located in documentation I cannot find. But the functionality does work. Just this morning I killed off the service "cwirkinit" I created in order to update the program. After about 5 minutes, I got notification that the service had failed, and within another 5 minutes I got notification that the service was successfully restarted.

So I'm not sure what that error means and what the impact is, current or future, but for the time being it still seems to be doing it's job.

Thank you,
~ Kyle
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Hello :)

The following thread is a more recent example of how to setup monitoring for a custom service:

Monitoring with Chkservd

Internal case number 148429 is open to address the issue where the service manager generates an error when saving if third party services are installed. The resolution is currently scheduled for cPanel version 11.48.

Thank you.