Forum Discussion
Ionut_Turturic1
Mar 05, 2010Historic F5 Account
System.Services.set_service not working with HTTPD
Any idea why the System.Services.set_service has absolutely no effect with SERVICE_HTTPD ? No exception is thrown, no error messages in logs.
It does work for mostly all other services!
action = pc.System.Services.typefactory.\
create('System.Services.ServiceAction').\
SERVICE_ACTION_REINIT
service = pc.System.Services.typefactory.\
create('System.Services.ServiceType').\
SERVICE_HTTPD
print pc.System.Services.set_service([service], action)
Where pc is an instance of pycontrol2.BIGIP.
Thanks.
5 Replies
- L4L7_53191
Nimbostratus
I haven't had time to test this, but for sure you're missing some kwargs in your set_service call - it expects two: services and service_action. Your call should look something like:pc.System.Services.set_service(services=[service], service_action=action)
- Ionut_Turturic1Historic F5 AccountThe kwargs would only improve readability in this case.
Mar 5 09:44:05 local/bp6800-121 notice logger: /usr/local/www/iControl/iControlPortal.cgi ==> /usr/bin/bigstart reinit ntpd
- L4L7_53191
Nimbostratus
Sure enough. I see the exact same behavior. This works:s.set_service(services=[svc.SERVICE_NOKIASNMPD],service_action=action.SERVICE_ACTION_RESTART) producing: local/bigip1 notice logger: /usr/local/www/iControl/iControlPortal.cgi ==> /usr/bin/bigstart restart nokiasnmpd
s.set_service(services=[svc.SERVICE_HTTPD],service_action=action.SERVICE_ACTION_RESTART)
- I'm looking through the sources and it seems that any request for START, STOP, REINIT, AND RESTART for SERVICE_HTTPD is silently ignored. This should probably thrown an exception to let you know that it didn't work. I can understand the reasoning for disabling it though as a restart or reinit will break the current iControl request and the call will return a transport error.
for (unsigned int i = 0; i < services.size(); i++) { // we will silently ignore request to start/stop/reinit/restart httpd // since that would be BAD ! if (services[ i ] == System::Services::SERVICE_HTTPD && (action == System::Services::SERVICE_ACTION_START || action == System::Services::SERVICE_ACTION_STOP || action == System::Services::SERVICE_ACTION_REINIT || action == System::Services::SERVICE_ACTION_RESTART)) { continue; } ... }
- L4L7_53191
Nimbostratus
Thanks Joe. Still seems a bit odd we can't restart at the very least but at least we know.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects