Fpm: Questions: fpm + pleaserun: how-to use the .rpm or .deb generated

Created on 26 Oct 2017  路  4Comments  路  Source: jordansissel/fpm

Just for clarity how do we use the .rpm and .deb files generated with the help of fpm+pleaserun combine.

  • after installing them, they are placed in the /usr/local/<app> folder
  • this folder also contains the .../pleaserun/... with systemd, init.d scripts
  • can we configure the rpm and deb packages to instantly execute the available systemd or init.d scripts inside the moment we install it ?
  • or it is installed only by manually going into the pleaserun folder and running the respective script?
  • your response will help with instructions to the end users of the packages

Most helpful comment

So for a user, they'll typically do this:

% yum install your-service
% systemctl enable your-service
% systemctl start your-service

Install, enable, start.

By way of example, Logstash uses fpm+pleaserun for this kind of thing, and we document:

All 4 comments

Good question --

fpm does two things:
1) uses pleaserun to generate all possible service definitions (systemd, etc)
2) Adds an after-install and before-remove script to add (and remove) the service when the package is installed

Here's what it looks like when you install:

% sudo rpm -i my-service-1.0-1.x86_64.rpm
Platform systemd (default) detected. Installing service.
To start this service, use: systemctl start my-service

# And removal
% sudo rpm -e my-service
Running cleanup to remove service for package my-service

^^ The output "Platform systemd ..." is output by the after-install script

You can look at the scripts in the generated rpm, for example:

% rpm -qp my-service-1.0-1.x86_64.rpm --scripts
postinstall scriptlet (using /bin/sh):
#!/bin/sh

source="/usr/share/pleaserun/my-service"
exec sh "$source/install.sh"

So service installation is automatic. It won't be enabled or started by default, though.

Does this make sense? Let me know if I missed anything.

So for a user, they'll typically do this:

% yum install your-service
% systemctl enable your-service
% systemctl start your-service

Install, enable, start.

By way of example, Logstash uses fpm+pleaserun for this kind of thing, and we document:

Thanks for the explanation I understand it, that the scripts will be installed (placed in the right place for execution) but will not be triggered to start the first time or automatically start each other. The latter will have to be done by the user (one who installs it) itself. I will look out for these messages when testing rpm on Centos or RHEL systems.

How does this work for deb packages, I'm afraid I didn't see these messages show up for these types of packages. What do kind of messages should I look out for to ensure the installation has taken place?

Possibly related to #1529

Was this page helpful?
0 / 5 - 0 ratings