pixelated / pixelated-user-agent

User facing components of Pixelated: a JavaScript single page app and a RESTful service.
GNU Affero General Public License v3.0
159 stars 72 forks source link

Adds postinstall scritp to restart pixelated-server #949

Closed deniscostadsc closed 7 years ago

deniscostadsc commented 7 years ago

After upgrading Pixelated User Agent package this script will restart the server in order to have the newest code running.

This change makes explicit the relationship between pixelated-user-agent and pixelated-server. It is not necessarily good, so we are planning to unify pixelated-service and pixelated-user-agent on the feature to make pixelated-user-agent as a service. For now it will solve our current problem about restart pixelated-service after the pixelated-user-agent updated package.

varac commented 7 years ago

Please consider that ppl use the pixelated-user-agent debian package standalone on their laptop/vagrant box in activist mode without having pixelated-server installed. So pixelated-server should only get restarted when it's actually installed.

anikarni commented 7 years ago

@varac , @deniscostadsc , @thaissiqueira , I added a commit for only restarting the pixelated-server if it's active. What do you think?

We can remove the if, if we assume it'll always run on debian and our users will be using it.

deniscostadsc commented 7 years ago

Please consider that ppl use the pixelated-user-agent debian package standalone on their laptop/vagrant box in activist mode without having pixelated-server installed. So pixelated-server should only get restarted when it's actually installed.

We are considering this. The if @anikarni inserted, solves the cases when systemd is not used and the logic is inside the if just stop pixelated-server if it is installed, up and running.

thaissiqueira commented 7 years ago

We tested the upgrade with if suggested by @anikarni and it doesn't broke.

So we are merging this change and for the next issue we should consider restart pixelated-user-agent on single user mode.