You are not logged in.

#1 2015-02-14 22:11:38

jonancm
Member
Registered: 2015-02-14
Posts: 1

Install script is not executed during installation of homemade package

I'm working on my first PKGBUILD for the AUR, trying to create a package to install dphys-swapfile on Arch.

Here are the files that I'm using to create this package:

The installation of dphys-swapfile as specified in the PKGBUILD works perfectly, i.e. it is actually installed to the right location and you can use it without any problems at all.

The systemd unit file is copied to the right location as well and you can enable and start the service with systemctl.

The problem arises with the install script. I wrote dphys-swapfile.install so that the service would be automatically enabled and started right after the installation of the package, but this is not working, i.e. the service is neither being enabled not being started, and I don't know what is causing this issue.

Any insight on what could be failing, as well as general tips on how to improve this package, will be very much appreciated.

Last edited by jonancm (2015-02-14 22:13:38)

Offline

#2 2015-02-14 22:39:22

jsteel
Package Maintainer (PM)
From: England
Registered: 2008-03-18
Posts: 119

Re: Install script is not executed during installation of homemade package

Maybe it's self-aware, that it shouldn't be automatically enabling and starting itself smile - the user should do this.


PGP key: F40D2072
Key fingerprint: 8742 F753 5E7B 394A 1B04  8163 332C 9C40 F40D 2072

Offline

#3 2015-02-14 22:44:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: Install script is not executed during installation of homemade package

I don't have any specifics to offer on why it might fail - but I'm happy to hear that it would.  As noted above, you should definitely not do such things in an install script (or anywhere for that matter).  If anything you could have the install script echo a message suggesting the user enable the service - but even this would be a bit odd.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2015-02-15 01:43:43

apg
Developer
Registered: 2012-11-10
Posts: 211

Re: Install script is not executed during installation of homemade package

When you are testing this are you removing the package first?  post_install does not run when upgrading or reinstalling a package.

Offline

#5 2015-02-15 03:10:33

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Install script is not executed during installation of homemade package

It looks like presets are the appropriate way to do this:

systemctl preset is used by the post install scriptlets of RPM packages (or other OS package formats), to enable/disable specific units by default on package installation...


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

Board footer

Powered by FluxBB