Skip to content
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

[Documentation] Relationship between "pleaserun" and "fpm" #130

Open
ghost opened this issue Jul 28, 2017 · 2 comments
Open

[Documentation] Relationship between "pleaserun" and "fpm" #130

ghost opened this issue Jul 28, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 28, 2017

Hello Jordan (and everyone else),

Today (just now, really) I noiced pleaserun.

Would it be possible to add a subsection about the relationship between fpm and pleaserun, if possible? Right now I am trying to figure this out.

Thanks anyway!

@jordansissel
Copy link
Owner

jordansissel commented Jul 28, 2017

Certainly! I am actually working on new release of fpm that will include some pleaserun+fpm docs today.

Until there's a longer-form document, here is what I can tell you:

  • fpm: I want FPM to be the easiest way to satisfy this statement, "I want to create an installable package"

  • pleaserun: I want pleaserun to be the easiest way to satsify the statement, "I want to create a service I can start and stop"

Since pleaserun is newer, I'll give you an example.

With fpm sometimes I have given an example using redis. To elaborate, you can make a redis package like this:

  • download redis source code
  • build redis from source (./configure, make, whatever)
  • use fpm to package: fpm -s dir -t rpm -n redis ...

The next step with something like redis is to actually make it a service you can start, stop, restart, and enable on system boot. To achieve this, you need to know what service manager your OS is using. On newer Fedora, CentOS 7, etc, you need to know to use systemd; on Ubuntu (16.04, etc), CentOS 6, and Amazon Linux, you need to know to use upstart. On older systems, you may need to use sysv. On OSX you use launchd.

I was overwhelmed and frustrated with packaging, so I started working on fpm years ago. Similarly, I was overwhelmed and frustrated by service managers (systemd, upstart, etc), so I wrote pleaserun.

for pleaserun, you can quickly say Install a service called "redis" that runs /usr/bin/redis-server:

pleaserun --name redis /usr/bin/redis-service`

And for the above, pleaserun will detect your platform and install the correct thing. On my fedora vm, it does this:

% pleaserun --name redis /usr/bin/redis-server
No platform selected. Autodetecting... {:platform=>"systemd", :version=>"231", :level=>:warn}
Writing file {:destination=>"/etc/default/redis"}
Writing file {:destination=>"/etc/systemd/system/redis.service"}

And without caring whether systemd, upstart, etc are correct, or even learning how to write systemd configurations, I now have a redis service. :)


Now, you can actually use pleaserun+fpm together! And it's a good timing you asked about this because I wrote some pleaserun+fpm docs a few minutes ago -- http://fpm.readthedocs.io/en/latest/source/pleaserun.html

@josegonzalez
Copy link
Contributor

This can probably be closed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants