jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.16k stars 1.07k forks source link

Start service installed with pleaserun #1573

Open nicolasbeauvais opened 5 years ago

nicolasbeauvais commented 5 years ago

Hello,

I made a package using pleaserun that work perfectly but do not start the service as stated in the documentation:

% systemctl status redis-server
● redis-server.service - redis-server
   Loaded: loaded (/etc/systemd/system/redis-server.service; disabled; vendor pr
   Active: inactive (dead)

# It is inactive and disabled because fpm does not start it by default

But I couldn't find any parameters in the CLI or something else to start the service after installation. Did I miss something? If no such parameter exists, is there a distribution agnostic way to start the service?

Thank you for your help :smile:

mathieu-aubin commented 5 years ago

maybe have a script run after install with something like

systemctl enable --now service_name
nicolasbeauvais commented 5 years ago

But the whole point of pleaserun it to work on multiple service system (launchd, upstart, systemd...) so that I don't have to know which one is installed.

Writing a script to check what service system pleaserun has chosen in order to start it doesn't feel very developer friendly. Unless there already is a system agnostic way to start a service for launchd, upstart, or systemd easily?

mathieu-aubin commented 5 years ago

i was under the impression that pleaserun was a generator only as per README.md

I do understand what you mean, altho i must say i do not have any experience running this combination so please forgive my ignorance

nicolasbeauvais commented 5 years ago

No worries any help is appreciated :+1:

mathieu-aubin commented 5 years ago

The best would be to add a message (post install) that explicitly tells the user the service is disabled by default.

I feel that its best to let the user choose/take actions when it comes to services. Most services (at least under redhat) are disabled by default and this behavior is desireable to ensure full compatibility - requiring user’s action ensure that if something doesnt go according to plan, it can be quickly taken care of