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

[FEATURE] Add an option for where to write the init scripts #43

Closed
lookfirst opened this issue Apr 24, 2014 · 10 comments
Closed

[FEATURE] Add an option for where to write the init scripts #43

lookfirst opened this issue Apr 24, 2014 · 10 comments

Comments

@lookfirst
Copy link

By default, pleaserun seems to output to a temp file. I'd like to be able to specify a directory for where it should write the files.

@jordansissel
Copy link
Owner

There are currently 3 options:

  1. The temporary paths used by default.
  2. The 'standard' locations on disk that are most correct for the platform. This is usable with the --install flag.
  3. JSON output that includes all files and content as well as 'install actions'. This is usable with the --json flag.

Example:

% bin/pleaserun -p upstart --json --name foo httpd
{"files":[{"path":"/etc/init/foo.conf","content":"description     \"no description given\"\nstart on filesystem or runlevel [2345]\nstop on runlevel [!2345]\n\nrespawn\numask 022\n#nice \n#chroot /\nchdir /\n#limit core <softlimit> <hardlimit>\n#limit cpu <softlimit> <hardlimit>\n#limit data <softlimit> <hardlimit>\n#limit fsize <softlimit> <hardlimit>\n#limit memlock <softlimit> <hardlimit>\n#limit msgqueue <softlimit> <hardlimit>\n#limit nice <softlimit> <hardlimit>\n#limit nofile <softlimit> <hardlimit>\n#limit nproc <softlimit> <hardlimit>\n#limit rss <softlimit> <hardlimit>\n#limit rtprio <softlimit> <hardlimit>\n#limit sigpending <softlimit> <hardlimit>\n#limit stack <softlimit> <hardlimit>\nsetuid root\nsetgid root\nconsole log # log stdout/stderr to /var/log/upstart/\n\n\nexec httpd \n","perms":null},{"path":"/etc/init.d/foo","content":"#!/bin/sh\n\necho \"This job runs via upstart, invoking upstart now...\"\nexec initctl $1 foo\n","perms":493}],"install_actions":[]}

@jordansissel
Copy link
Owner

However, I'm still open to a 4th option of "put the files here..." but haven't writtne code to do that yet.

@lookfirst
Copy link
Author

I honestly just need the files in a directory. I package them up into an rpm in a separate process (using maven).

@thedrow
Copy link

thedrow commented Apr 26, 2014

@lookfirst Have a look into fpm & fpm-cookery then.
Pleaserun will be integreated in the future. bernd/fpm-cookery#68

@pgodel
Copy link

pgodel commented Jun 10, 2014

I am a big fan of fpm and just started using pleaserun, it would be very helpful to specify where to write the files so I can then run the fpm command to package the rpm/deb with the new shiny init scripts.

@eperdeme
Copy link

+1's etc.

Trying to package stuff up using fpm+jenkins+pleaserun and be easier if the output path was selectable.

I guess I could do some JSON wrapper to do this for me but its a bit harder than ./magick.

@spuder
Copy link

spuder commented Sep 16, 2014

+1

Also, it would be nice if it could output to multiple directories

pleaserun -p sysv -p upstart -d /tmp

tree /tmp 
|_sysv
|        |_foo.conf
|_upstart
         |_foo.conf

@jordansissel
Copy link
Owner

@spuder I am ... almost liking that proposal, though this would be the same as -p sysv -d /tmp/sysv repeated for each platform type.

jordansissel added a commit that referenced this issue Feb 10, 2015
These flags are used when --install is given.

--install-actions is boolean and determines whether or not to run
the installation actions (notify launchd, etc).
--install-prefix is a string letting you tell pleaserun
where to write files to. This is intended to help packagers.

This should satisfy #43
@jordansissel
Copy link
Owner

pleaserun 0.0.9 published with an --install-prefix flag:

% bin/pleaserun --install --install-prefix /tmp/fancy -p sysv -v lsb-3.1 --name apache /usr/bin/httpd -D
Writing file {:destination=>"/tmp/fancy/etc/init.d/apache"}
Writing file {:destination=>"/tmp/fancy/etc/default/apache"}

@lookfirst
Copy link
Author

👍

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

6 participants