From 4559e3e27d0a38141a83ffc70eb04628dc150b47 Mon Sep 17 00:00:00 2001
From: Duncan Sommerville <duncan.sommerville@gmail.com>
Date: Thu, 8 Jan 2015 10:48:54 -0500
Subject: [PATCH] More work on running upstart services as non-privileged user

---
 installer/install          | 5 +++--
 installer/lib/Upstart.conf | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/installer/install b/installer/install
index 9873ff0d3..0281fa058 100755
--- a/installer/install
+++ b/installer/install
@@ -317,8 +317,8 @@ loud "\n-----------------------------------------------------"
 loud "          * Installing Airtime Services *            "
 loud "-----------------------------------------------------"
 
-verbose "\n * Installing liquidsoap and python..."
-loudCmd "apt-get -y --force-yes install liquidsoap python python-pip"
+verbose "\n * Installing necessary service binaries..."
+loudCmd "apt-get -y --force-yes install liquidsoap python python-pip dbus"
 loudCmd "pip install setuptools"
 verbose "...Done"
 
@@ -375,6 +375,7 @@ ln -sf /usr/bin/liquidsoap /usr/bin/airtime-liquidsoap
 verbose "...Done"
 
 sed "s@WEB_USER@${web_user}@g" ${SCRIPT_DIR}/lib/Upstart.conf > /etc/dbus-1/system.d/Upstart.conf
+chmod 644 /etc/init/airtime*
 
 service dbus restart
 initctl reload-configuration
diff --git a/installer/lib/Upstart.conf b/installer/lib/Upstart.conf
index 408eaf369..2c59dc380 100644
--- a/installer/lib/Upstart.conf
+++ b/installer/lib/Upstart.conf
@@ -55,7 +55,7 @@
        send_type="method_call" send_member="GetAllInstances" />
   </policy>
   
-  <!-- Permit the root user to invoke all of the methods on Upstart, its jobs
+  <!-- Permit the web user to invoke all of the methods on Upstart, its jobs
        or their instances, and to get and set properties. -->
   <policy user="WEB_USER">
     <allow send_destination="com.ubuntu.Upstart"