launch_daemon: Added basic ability to stop/start jobs via API.

* Stopping a job is very simplistic right now, and will have to be
  extended considerably, probably with its own job.
This commit is contained in:
Axel Dörfler
2015-11-07 21:58:12 +01:00
parent de0e15ae8c
commit 5860caae39
6 changed files with 194 additions and 58 deletions
+2
View File
@@ -26,6 +26,8 @@ namespace BPrivate {
enum {
B_GET_LAUNCH_DATA = 'lnda',
B_LAUNCH_TARGET = 'lntg',
B_LAUNCH_JOB = 'lnjo',
B_STOP_LAUNCH_JOB = 'lnsj',
B_LAUNCH_SESSION = 'lnse',
B_REGISTER_SESSION_DAEMON = 'lnrs',
B_REGISTER_LAUNCH_EVENT = 'lnre',
+6
View File
@@ -34,6 +34,9 @@ public:
const BMessage* data = NULL,
const char* baseName = NULL);
status_t Start(const char* name);
status_t Stop(const char* name, bool force = false);
status_t StartSession(const char* login);
status_t RegisterEvent(const BMessenger& source,
@@ -56,6 +59,9 @@ private:
friend class Private;
void _InitMessenger();
status_t _SendRequest(BMessage& request);
status_t _SendRequest(BMessage& request,
BMessage& reply);
status_t _UpdateEvent(uint32 what,
const BMessenger& source, const char* name,
uint32 flags = 0);