fpm icon indicating copy to clipboard operation
fpm copied to clipboard

Missing `--rpm-systemd` flag?

Open mjulian opened this issue 8 years ago • 15 comments

There are flags for --rpm-init, --deb-init, and --deb-systemd, but --rpm-systemd seems to be missing from this list.

mjulian avatar Jul 21 '16 19:07 mjulian

I'd honestly like to remove all of these in favor of somehow integrating the new pleaserun support into this, though I'm not sure how to do it just yet.

I am +1 in favor of adding --rpm-systemd until we have the above integration availble.

jordansissel avatar Jul 21 '16 20:07 jordansissel

I too would like to +1 to include an --rpm-systemd option to FPM. I need this functionality and wondered why there was a --deb-systemd and nothing for RPM.

Thanks for all of your work with the project.

ndobbs avatar Aug 16 '16 20:08 ndobbs

+1 - Is this on the roadmap anywhere? I've not looked through the source but I imagine most of it will be a duplicate of --deb-systemd.

monokal avatar Aug 26 '16 14:08 monokal

@jordansissel, Hello! Have there been any updates on this? Would be glad to help in any way I can.

dmjio avatar Mar 22 '17 01:03 dmjio

There aren't any updates, but pull requests are welcome :)

josegonzalez avatar Mar 22 '17 02:03 josegonzalez

Your situation may vary, however, the following is a workaround if you're generating a package from a directory:

  1. Convert your directory to a deb package and use --deb-systemd
  2. Convert that deb package to rpm (e.g. fpm -s deb -t rpm *.deb)
  3. Inspect the rpm and you should see the .service file in /lib/systemd/system

Thank you to all the contributors on fpm. Great work!

unsaturated avatar Aug 03 '17 15:08 unsaturated

I've opened pull request #1405 for this.

mohd-akram avatar Aug 26 '17 10:08 mohd-akram

@jordansissel Could you please consider keeping the init and systemd flags (along with merging #1045), instead of deprecating them in favor of pleaserun?

This way it would be possible to use custom systemd units or sysv services, which is helpful when using FPM to ship a multi-platform package.

s1na avatar Oct 17 '17 13:10 s1na

I am OK with your proposal to keep the flags.

On Tue, Oct 17, 2017 at 3:05 PM Sina Mahmoodi [email protected] wrote:

@jordansissel https://github.com/jordansissel Could you please consider keeping the init and systemd flags (along with merging #1045 https://github.com/jordansissel/fpm/pull/1405), instead of deprecating them in favor of pleaserun?

This way it would be possible to use custom systemd units or sysv services, which is helpful when using FPM to ship a multi-platform package.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jordansissel/fpm/issues/1163#issuecomment-337224909, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIC6mt6ZAlYt-f4fOQ2BFV2UE6y_kAvks5stKYegaJpZM4JSKE7 .

jordansissel avatar Oct 17 '17 19:10 jordansissel

for RPM pkg workaround,

  1. place your systemd startup script into the dir that you will be packaging as RPM,
  2. run FPM with -s dir, provide a --after-install script that will move your systemd startup from the install dir to /etc/systemd/system
  3. when you install the RPM, the after install script moves the system script over to the right location,

for example,

packaging scriipt,

echo "....CREATING Bitbucket RPM from stage dir" /usr/local/bin/fpm -s dir -t rpm
--after-install additionals/after-install
-C stage/
--name $app
--version ${version}
--iteration "1"
--workdir $(pwd)
--architecture x86_64
--maintainer "Atlassian"
--description "Atlassian $app"
--url "www.atlassian.com"
--package $(pwd)/RPM/${app}-${version}-1.x86_64.rpm
-d $db_name

"after-install" script

# move systemd startup
mv /opt/atlassian/$app/$app.service /etc/systemd/system/
systemctl enable $app.service

its hacky but it works.

perfecto25 avatar Nov 22 '17 20:11 perfecto25

@jordansissel As you plan to keep the flags, would you consider merging my PR for --rpm-systemd?

mohd-akram avatar Jan 16 '18 21:01 mohd-akram

@mohd-akram yes indeed! I will follow up with you on https://github.com/jordansissel/fpm/pull/1405

jordansissel avatar Jan 16 '18 23:01 jordansissel

why not merged yet? i need this!!! :(

ericrange avatar Apr 29 '19 08:04 ericrange

@ericrange In the meantime, you can (ab)use the --config-files option to mark a systemd unit file as a config file, and include. The unit file can either be in a relative path mirroring it's root destination (./etc/systemd/system/file) or an absolute path (/etc/systemd/system/file).

The advantage of this method over the above methods, is that the file will be tracked by RPM and be removed when the package is removed - no scripts required.

Varriount avatar May 14 '19 03:05 Varriount

Unexpectedly find out that the --rpm-systemd flag is missing. Is there any news about this?

hertznsk avatar Jun 13 '23 00:06 hertznsk