From f82d3f7fa9588ad0f20d0b84a4dd7f2400a4ea22 Mon Sep 17 00:00:00 2001 From: Petr Svoboda Date: Fri, 13 Sep 2013 16:26:11 +0200 Subject: [PATCH] Fix traceback in service module when svc_cmd is None (2nd fix) When service module is used on unsupported Linux system where init script is used directly, LinuxService.svc_cmd is None so .endswith() fails. This extends fix from e2f20db53481128553d876109d5fbdab9f43dd5b also for state=restarted. Fixes issue #3533 --- system/service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/service b/system/service index d7cd47afcd4..6d4aec6cd82 100644 --- a/system/service +++ b/system/service @@ -677,7 +677,7 @@ class LinuxService(Service): else: # SysV rc_state, stdout, stderr = self.execute_command("%s %s %s" % (self.action, self.name, arguments), daemonize=True) - elif self.svc_cmd.endswith('rc-service'): + elif self.svc_cmd and self.svc_cmd.endswith('rc-service'): # All services in OpenRC support restart. rc_state, stdout, stderr = self.execute_command("%s %s %s" % (svc_cmd, self.action, arguments), daemonize=True) else: