Logo Search packages:      
Sourcecode: jobservice version File versions  Download package

def JobService::backends::upstart_0_6::ServiceBackend::start_service (   self,
  name 
)
If a job is given, try to start its instance first if it has one.
If it doesn't have one, start via job.
If an instance is given, start it directly.

Reimplemented from JobService::backends::ServiceBase.

Definition at line 100 of file upstart_0_6.py.

                                 :
        """
        If a job is given, try to start its instance first if it has one.
        If it doesn't have one, start via job.
        If an instance is given, start it directly.
        """
        job_name, inst_name = self._split_job(name)
        # no instances, start the job
        if not self.instpaths[self.jobpaths[job_name]]:
            job_obj = self.bus.get_object('com.ubuntu.Upstart',
                    self.jobpaths[job_name])
            job = Interface(job_obj, 'com.ubuntu.Upstart0_6.Job')
            job.Start([], True)
        # one or more instances available
        else:
            inst_obj, inst_props = self._get_inst(job_name, inst_name)
            inst_obj.Start(True, dbus_interface='com.ubuntu.Upstart0_6.Instance')
        # reload
        self.get_all_services()
        

Generated by  Doxygen 1.6.0   Back to index