Skip to content

Commit

Permalink
[upstart] Remove upstart appsync support
Browse files Browse the repository at this point in the history
Upstart is being obsoleted, so no use to keep this support in.
Systemd is our new evil overlord.

Author: Thomas Perl <m@thp.io>
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Apr 28, 2015
1 parent 0d87604 commit a98aac6
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 231 deletions.
8 changes: 0 additions & 8 deletions configure.ac
Expand Up @@ -56,14 +56,6 @@ AC_ARG_ENABLE([app_sync_dbus], AS_HELP_STRING([--enable-app-sync-dbus], [Enable
esac],[app_sync_dbus=false])
AM_CONDITIONAL([APP_SYNC_DBUS], [test x$app_sync_dbus = xtrue])

AC_ARG_ENABLE([upstart], AS_HELP_STRING([--enable-upstart], [Enable upstart interface for appsync @<:@default=false@:>@]),
[case "${enableval}" in
yes) upstart=true ; CFLAGS="-DUPSTART $CFLAGS" ;;
no) upstart=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-upstart]) ;;
esac],[upstart=false])
AM_CONDITIONAL([UPSTART], [test x$upstart = xtrue])

AC_ARG_ENABLE([connman], AS_HELP_STRING([--enable-connman], [Enable connman support for usb tethering @<:@default=false@:>@]),
[case "${enableval}" in
yes) connman=true ; CFLAGS="-DCONNMAN $CFLAGS" ;;
Expand Down
10 changes: 1 addition & 9 deletions docs/usb_moded-doc.txt
Expand Up @@ -209,7 +209,7 @@ Only condition is that it can be activated by dbus and that (preferably) it will
notify usb_moded that it is ready by ready_method call on the session bus.
This ready method call is just calling the regular usb_moded interface, but now
on the session bus, with as argument the program name as defined in the config file.
Systemd and upstart are also supported.
Systemd is also supported.

To achieve this you need to have a config file in /etc/usb-moded/run.
Best practice would be giving it a descriptive name followed by .ini
Expand All @@ -231,14 +231,6 @@ systemd = 1

The name here is the service name used when launching it for example with systemctl

For upstart:
[info]
name = foo
mode = foo_mode
upstart = 1

Here the name is service name used by upstart.

Those files will be read on start and usb_moded will keep a list of apps to launch
for a certain mode. This also means that if you change the files or add/remove some
you need to restart usb_moded. Later when the mode is activated, usb_moded will start
Expand Down
6 changes: 0 additions & 6 deletions src/Makefile.am
Expand Up @@ -61,12 +61,6 @@ usb_moded_SOURCES += \
usb_moded-appsync-dbus-private.h
endif

if UPSTART
usb_moded_SOURCES += \
usb_moded-upstart.h \
usb_moded-upstart.c
endif

usb_moded_util_CPPFLAGS = \
$(USB_MODED_CFLAGS)

Expand Down
27 changes: 0 additions & 27 deletions src/usb_moded-appsync.c
Expand Up @@ -38,7 +38,6 @@
#include "usb_moded-appsync-dbus-private.h"
#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, int diag);
Expand Down Expand Up @@ -152,8 +151,6 @@ static struct list_elem *read_file(const gchar *filename, int diag)
log_debug("Launch = %s\n", list_item->launch);
list_item->mode = g_key_file_get_string(settingsfile, APP_INFO_ENTRY, APP_INFO_MODE_KEY, NULL);
log_debug("Launch mode = %s\n", list_item->mode);
list_item->upstart = g_key_file_get_integer(settingsfile, APP_INFO_ENTRY, APP_INFO_UPSTART_KEY, NULL);
log_debug("Upstart control = %d\n", list_item->upstart);
list_item->systemd = g_key_file_get_integer(settingsfile, APP_INFO_ENTRY, APP_INFO_SYSTEMD_KEY, NULL);
log_debug("Systemd control = %d\n", list_item->systemd);
list_item->post = g_key_file_get_integer(settingsfile, APP_INFO_ENTRY, APP_INFO_POST, NULL);
Expand Down Expand Up @@ -250,15 +247,6 @@ int activate_sync(const char *mode)
else
goto error;
}
#ifdef UPSTART
else if(data->upstart)
{
if(!upstart_control_job(data->name, UPSTART_START))
mark_active(data->name);
else
goto error;
}
#endif /* UPSTART */
else if(data->launch)
{
/* skipping if dbus session bus is not available,
Expand Down Expand Up @@ -319,13 +307,6 @@ int activate_sync_post(const char *mode)
if(systemd_control_service(data->name, SYSTEMD_START))
goto error;
}
#ifdef UPSTART
else if(data->upstart)
{
if(upstart_control_job(data->name, UPSTART_START))
goto error;
}
#endif /* UPSTART */
else if(data->launch)
{
/* skipping if dbus session bus is not available,
Expand Down Expand Up @@ -432,14 +413,6 @@ int appsync_stop(void)
if(!systemd_control_service(data->name, SYSTEMD_STOP))
log_debug("Failed to stop %s\n", data->name);
}
#ifdef UPSTART
else if(data->upstart)
{
log_debug("Stopping %s\n", data->launch);
if(upstart_control_job(data->name, UPSTART_STOP))
log_debug("Failed to stop %s\n", data->name);
}
#endif /* UPSTART */
}

return(0);
Expand Down
2 changes: 0 additions & 2 deletions src/usb_moded-appsync.h
Expand Up @@ -26,7 +26,6 @@
#define APP_INFO_MODE_KEY "mode"
#define APP_INFO_NAME_KEY "name"
#define APP_INFO_LAUNCH_KEY "launch"
#define APP_INFO_UPSTART_KEY "upstart"
#define APP_INFO_SYSTEMD_KEY "systemd"
#define APP_INFO_POST "post"

Expand All @@ -40,7 +39,6 @@ typedef struct list_elem
char *mode; /* mode in which to launch the app */
char *launch; /* dbus launch command/address */
int active; /* marker to check if the app has started sucessfully */
int upstart; /* marker to know if we start it with upstart or not */
int systemd; /* marker to know if we start it with systemd or not */
int post; /* marker to indicate when to start the app */
/*@}*/
Expand Down
1 change: 0 additions & 1 deletion src/usb_moded-modesetting.c
Expand Up @@ -40,7 +40,6 @@
#include "usb_moded-config.h"
#include "usb_moded-modesetting.h"
#include "usb_moded-network.h"
#include "usb_moded-upstart.h"
#include "usb_moded-android.h"

static void report_mass_storage_blocker(const char *mountpoint, int try);
Expand Down
145 changes: 0 additions & 145 deletions src/usb_moded-upstart.c

This file was deleted.

33 changes: 0 additions & 33 deletions src/usb_moded-upstart.h

This file was deleted.

0 comments on commit a98aac6

Please sign in to comment.