Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ubuntu Startup Script - Not Working #289
I was able to fix the problem. It seems that I was in the wrong directory while running the command to setup the init script. Everything works fine after setting the correct path to the user's home directory in
I hope this helps.
referenced this issue
Feb 24, 2014
If it helps, I think I have a repro of this issue that can be created easily in vagrant: https://github.com/fschwiet/helloVagrant/tree/pm2-issue42900019
Here is a snippet from the Vagrantfile:
For reference to those running into this kind of issue, to keep pm2 running after reboot, I am using crontab:
Where provision.sites.sh is something like:
Seems like I've found issue why it does fail with vagrant.
Have not found a solution yet. But anyway it has nothing to do with
added a commit
Jun 16, 2014
@kompot a solution for the vagrant + pm2 start on reload is to add an upstart script that takes care of restarting you app after vagrant has mounted the source.
This is what I use:
# /etc/init/vagrant-mounted.conf description "Start pm2 on vagrant mounted" author "Me" start on vagrant-mounted expect fork setgid vagrant setuid vagrant script export HOME=/home/vagrant export PATH=/usr/local/node/node-default/bin:/usr/local/bin:/bin cd /home/vagrant pm2 start app.js end script
I'm having the same issue: