Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Actually call systemd starters
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Jun 5, 2013
1 parent 468c399 commit bea81c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/usb_moded-appsync.c
Expand Up @@ -39,6 +39,7 @@
#include "usb_moded-modesetting.h"
#include "usb_moded-log.h"
#include "usb_moded-upstart.h"
#include "usb_moded-systemd.h"

static struct list_elem *read_file(const gchar *filename);
static gboolean enumerate_usb(gpointer data);
Expand Down Expand Up @@ -205,6 +206,8 @@ int activate_sync(const char *mode)
log_debug("launching app %s\n", data->launch);
if(data->systemd)
{
if(!systemd_control_service(data->name, SYSTEMD_START))
mark_active(data->name);
}
#ifdef UPSTART
else if(data->upstart)
Expand Down Expand Up @@ -306,6 +309,8 @@ int appsync_stop(void)

if(data->systemd)
{
if(!systemd_control_service(data->name, SYSTEMD_STOP))
mark_active(data->name);
}
#ifdef UPSTART
else if(data->upstart)
Expand Down
3 changes: 3 additions & 0 deletions src/usb_moded-systemd.h
Expand Up @@ -19,4 +19,7 @@
02110-1301 USA
*/

#define SYSTEMD_STOP "StopUnit"
#define SYSTEMD_START "StartUnit"

int systemd_control_service(const char *name, const char *method);

0 comments on commit bea81c7

Please sign in to comment.