diff --git a/Makefile.am b/Makefile.am
index 5e0a5be..9902ac7 100644
--- a/Makefile.am
+++ b/Makefile.am
$(attrib_sources) $(btio_sources) \
src/bluetooth.ver \
src/main.c src/log.h src/log.c \
+ src/systemd.h src/systemd.c \
src/rfkill.c src/hcid.h src/sdpd.h \
src/sdpd-server.c src/sdpd-request.c \
src/sdpd-service.c src/sdpd-database.c \
diff --git a/src/main.c b/src/main.c
index 0b2809a..f985332 100644
--- a/src/main.c
+++ b/src/main.c
#include "agent.h"
#include "manager.h"
#include "mgmt.h"
+#include "systemd.h"
#define BLUEZ_NAME "org.bluez"
__btd_log_init(option_debug, option_detach);
+ sd_notify(0, "STATUS=Starting up");
+
config = load_config(CONFIGDIR "/main.conf");
parse_config(config);
DBG("Entering main loop");
+ sd_notify(0, "STATUS=Running");
+ sd_notify(0, "READY=1");
+
g_main_loop_run(event_loop);
+ sd_notify(0, "STATUS=Quitting");
+
g_source_remove(signal);
plugin_cleanup();
diff --git a/src/systemd.c b/src/systemd.c
new file mode 100644
index 0000000..4bb2f1c
--- /dev/null
+++ b/src/systemd.c
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "systemd.h"
+
+int sd_listen_fds(int unset_environment)
+{
+ return 0;
+}
+
+int sd_notify(int unset_environment, const char *state)
+{
+ return 0;
+}
diff --git a/src/systemd.h b/src/systemd.h
new file mode 100644
index 0000000..0ef7c82
--- /dev/null
+++ b/src/systemd.h
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#define SD_LISTEN_FDS_START 3
+
+int sd_listen_fds(int unset_environment);
+
+int sd_notify(int unset_environment, const char *state);