New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pleaserun support #1112

Closed
jordansissel opened this Issue May 13, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@jordansissel
Owner

jordansissel commented May 13, 2016

Example invocation:

fpm -s pleaserun -n httpd-service -t deb /usr/bin/httpd

The above would use pleaserun to create any necessary init/systemd/upstart/etc files and after-install steps and produce a .deb package called 'httpd-service' that, upon install, would select the "best" available service runtime (systemd, etc) and install the service.

Ideally this would produce a deb (as example above) that could install on any deb-using platform and would select upstart, systemd, sysvinit, or whatever, upon install, for whatever is right for the target machine.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 13, 2016

To allow fpm -s pleaserun -t rpm /path/to/program --some --program=flags --here, the following are blockers:

@untergeek

This comment has been minimized.

untergeek commented May 13, 2016

👍

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 15, 2016

Progress underway! Weeeeee.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 16, 2016

Current status - package installation creates the service, and package removal deletes it.

Tested on a stock CentOS 6.7 with an rpm built on Fedora 23.

% sudo initctl status example
initctl: Unknown job: example
% sudo rpm -i example-service-1.0-1.x86_64.rpm
Platform upstart (0.6.5) detected. Installing service.
To start this service, use: initctl start example
% sudo initctl status example
example stop/waiting
% sudo initctl start example
example start/running, process 1849
% sudo initctl status example
example start/running, process 1849
% sudo initctl stop example
example stop/waiting
% sudo rpm -e example-service
Running cleanup to remove service for package example-service
% sudo initctl status example
initctl: Unknown job: example

😸 😸 😸

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 16, 2016

Lots of shell scripts in this patch (because some of the implementation is executed during package installation, so we can really rely on /bin/sh). I need to think about how to write tests for this.

@liger1978

This comment has been minimized.

Contributor

liger1978 commented May 19, 2016

I'm not sure I understand this. Would this create a package that just creates the service definition files (but does not contain any other files)? For me a more useful option would be for fpm to make use of pleaserun to augment a package with an appropriate service definition file.

Example:

Lets say we have a rubygem that runs a WEBrick web server (r10k_gitlab_webook_server is a good example). When we convert the gem to an RPM for use on (e.g.) CentOS 7 it would be very useful if one could supply arguments to fpm that allowed the resulting RPM to include a systemd unit file that allowed one to start and stop the WEBrick web server using standard EL7 systemctl command.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 26, 2016

@liger1978 the fpm cli only does one transformation (source to target package). However, the FPM ruby API lets you do multiple, so you can create one rpm with both the service definitions and the artifacts for your application.

Allowing fpm to do multiple transformations (say, pleaserun + dir to rpm) would be lovely, but as a new feature, it is out of scope for this PR.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented May 26, 2016

#1119 implements this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment