I am running Ubuntu 14.04.
I am trying to make a service capable of deploying an application. The process is very simple:
- I have a node script listening on port
2133
for aPOST
request - When this script gets a request, it triggers a bash script that has to clone a git repository
- The bash script should run a
composer install
command to install the dependencies of the application.
When I launch my script with node index.js
, everything works fine.
I then made an upstart service, defined with the following config file:
description "Service permettant le déploiement d'une application depuis bitbucket"
author "Mathieu Marteau"
start on filesystem runlevel [2345]
stop on shutdown
respawn
setuid mmarteau
exec /usr/bin/node /home/mmarteau/deploy/index.js
The service works fine, all of my bash file is running, except for the one command composer install
.
I've got nothing in the /var/log/upstart/myservice.log
.
I also tried to replace the composer install
command with the full path: /usr/local/bin/composer install;
but this has no effect either.
Where should I look to solve my problem?
Thank you very much for your help!
EDIT: My problem is solved when I replace the composer install
by sudo composer install
.
I don't understand because everything works when I launch my node script logged as mmarteau
but it does need a sudo
with the upstart service. I thought that the setuid mmarteau
was the necessary line...