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

Restart Pixelated server after package installation #918

Closed thaissiqueira closed 7 years ago

thaissiqueira commented 7 years ago

Description

When a new Pixelated package is installed I want to have the Pixelated server restarted automatically So I can use all the new features delivered with this new package

Acceptance Criteria

Given a new pixelated package is available When the cron job runs and updates the pixelated package Then the new features should be available for the users on this updated instance.

thaissiqueira commented 7 years ago

We changed the last step of acceptance criteria to bring the view of user value.

From:

Then the pixelated service should be restarted

To:

Then the new features should be available for the users on this updated instance.

anikarni commented 7 years ago

@deniscostadsc , we came up with two ideas for how to manage the pixelated-server if the pixelated-user-agent is updated:

  1. Create a postinst for pixelated that kills the process

If the pixelated-user-agent is updated, it will kill any existing process (pkill). When we use systemd with the pixelated-server, it will restart the service automatically. This way, we won't be concerned with wether we are running the agent as multi-user or single-user.

  1. Move the pixelated-server scripts into the user agent

This would involve a bit of redesigning our deploy process to remove the necessity for the pixelated-server, making the agent independent. We can then take advantage of this approach to create a service for multi-user and one for single-user. Plus, one less repo to maintain.

Thoughts? Suggestions?

varac commented 7 years ago

@anikarni: I like the second approach!

varac commented 7 years ago

On second thought - well, ppl use the pixelated-user-agent debian package standalone on their laptop/vagrant box in activist mode without having pixelated-server installed. It should not be a background service in this case. So having both packages split up makes sense actually. See also https://github.com/pixelated/pixelated-user-agent/pull/949#issuecomment-276080632

anikarni commented 7 years ago

We can have more than one service, one for single-user, one for multi-user. But there are a lot of advantages of having the debian packaged by itself. One of them being that this story wouldn't have been necessary, since the package would know to update itself.

varac commented 7 years ago

@anikarni: Ok, I just want to make sure that we make a service optional for those ppl who install it on their laptop for activist mode and don't want to have it running 24/7. But there are a lot of packages that do this, where you can actually choose to run it as a daemon or not by configuring i.e. /etc/default/pixelated-user-agent or sth like this.