Just for clarity how do we use the .rpm and .deb files generated with the help of fpm+pleaserun combine.
/usr/local/<app> folder.../pleaserun/... with systemd, init.d scriptspleaserun folder and running the respective script?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
Most helpful comment
So for a user, they'll typically do this:
Install, enable, start.
By way of example, Logstash uses fpm+pleaserun for this kind of thing, and we document: