You are not logged in.

#1 2017-04-05 07:36:22

socialloser1
Member
Registered: 2017-04-04
Posts: 32

where is the .install script in a pacman package?

according to archwiki:
Pacman has the ability to store and execute a package-specific script when it installs, removes, or upgrades a package. This allows a package to configure itself after installation and perform an opposite action upon removal.

-------------------
where is this script file located in the final package ? I can't find it.

Offline

#2 2017-04-05 07:59:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: where is the .install script in a pacman package?

Install scripts do not ship with every package. The kernel has one: https://git.archlinux.org/svntogit/pack … ages/linux


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-04-05 08:03:19

a821
Member
Registered: 2012-10-31
Posts: 381

Re: where is the .install script in a pacman package?

To add, the install files (if any) are stored in pacman's database (or look at the package sources in the git web interface).

Offline

#4 2017-04-05 08:20:44

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: where is the .install script in a pacman package?

jasonwryan wrote:

Install scripts do not ship with every package. The kernel has one: https://git.archlinux.org/svntogit/pack … ages/linux

I know how to write install scripts in PKGBUILD, I just can't find where it is in the final pkg.tar.xz package.  it just 'disapeared'.

take the example of the package "privoxy". it has a install script acconpany with PKGBUILD to create system user to run service , but when I uncompressed the pkg.tar.xz file , there is no file containing the contents of this script. where is it ?

Offline

#5 2017-04-05 08:24:35

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: where is the .install script in a pacman package?

a821 wrote:

To add, the install files (if any) are stored in pacman's database (or look at the package sources in the git web interface).

I don't understand, if a package install script it is stored in the database, if you copy pkg.tar.xz file to other machine, and use pacman -U to install it , it will not work correctly, right ?

Offline

#6 2017-04-05 08:28:46

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,093

Re: where is the .install script in a pacman package?

It's called '.INSTALL' on the top-level dir. Of course you won't see it unless you enable showing hidden files

Offline

#7 2017-04-05 08:39:00

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: where is the .install script in a pacman package?

arojas wrote:

It's called '.INSTALL' on the top-level dir. Of course you won't see it unless you enable showing hidden files

I know how to view hidden files , but there is only 3 hidden file in the privoxy package:

.BUILDINFO
.MTREE
.PKGINFO

while in the ABS source it certainly contains an install script.
maybe I should see more packages first, I will do some experiment and will reply later.

Offline

#8 2017-04-05 08:57:23

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: where is the .install script in a pacman package?

To have the .install file included in the package, it should be stated in the PKGBUILD (see https://wiki.archlinux.org/index.php/PKGBUILD#install).

The privoxy package does not appear to do that, so there is not .INSTALL file in the resulting package. I'm not sure why, though - to me, this looks like a packaging bug: either it should be included, or the (unused) .install file should be removed.

... or I'm missing something about packaging with makepkg.

Last edited by ayekat (2017-04-05 08:58:04)


pkgshackscfgblag

Offline

#9 2017-04-05 09:05:59

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: where is the .install script in a pacman package?

ayekat wrote:

To have the .install file included in the package, it should be stated in the PKGBUILD (see https://wiki.archlinux.org/index.php/PKGBUILD#install).

The privoxy package does not appear to do that, so there is not .INSTALL file in the resulting package. I'm not sure why, though - to me, this looks like a packaging bug: either it should be included, or the (unused) .install file should be removed.

... or I'm missing something about packaging with makepkg.

you're right. after some investigate , I get it now.  there is a .install file in the directory to create a user to run service, but it is not used in the PKGBUILD. but it still created the user with the final package. so the author must changed to another way to do this, leaving the useless .install file there. this post is solved.

Offline

#10 2017-04-05 09:12:39

a821
Member
Registered: 2012-10-31
Posts: 381

Re: where is the .install script in a pacman package?

socialloser1 wrote:
a821 wrote:

To add, the install files (if any) are stored in pacman's database (or look at the package sources in the git web interface).

I don't understand, if a package install script it is stored in the database, if you copy pkg.tar.xz file to other machine, and use pacman -U to install it , it will not work correctly, right ?

The install file in a pkg.tar.xz file is called .INSTALL, these files are stored in the pacman's database in /var/lib/pacman (there they're called simply "install"). I don't see why it wouldn't work.

Last edited by a821 (2017-04-05 09:14:27)

Offline

#11 2017-04-05 09:25:43

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: where is the .install script in a pacman package?

socialloser1 wrote:

you're right. after some investigate , I get it now.  there is a .install file in the directory to create a user to run service, but it is not used in the PKGBUILD. but it still created the user with the final package. so the author must changed to another way to do this, leaving the useless .install file there. this post is solved.

The "other way" is actually installing a configuration file for sysusers.d, so that systemd creates the user during boot time. But to create the user the moment the package is installed (rather than having to reboot the machine or running `systemd-sysusers` manually), the .install file is needed.

So the .install file is not useless - not including it properly to the package is a bug, IMHO (although not very severe).

a821 wrote:

The install file in a pkg.tar.xz file is called .INSTALL, these files are stored in the pacman's database in /var/lib/pacman (there they're called simply "install"). I don't see why it wouldn't work.

The problem here is that the .INSTALL file is not there.


pkgshackscfgblag

Offline

#12 2017-04-05 09:28:21

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: where is the .install script in a pacman package?

a821 wrote:
socialloser1 wrote:
a821 wrote:

To add, the install files (if any) are stored in pacman's database (or look at the package sources in the git web interface).

I don't understand, if a package install script it is stored in the database, if you copy pkg.tar.xz file to other machine, and use pacman -U to install it , it will not work correctly, right ?

The install file in a pkg.tar.xz file is called .INSTALL, these files are stored in the pacman's database in /var/lib/pacman (there they're called simply "install"). I don't see why it wouldn't work.

I understand how it works now. I see those files in /var/lib/pacman too.  thank you for the reply.

Offline

#13 2017-04-05 09:40:11

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: where is the .install script in a pacman package?

ayekat wrote:

The "other way" is actually installing a configuration file for sysusers.d, so that systemd creates the user during boot time. But to create the user the moment the package is installed (rather than having to reboot the machine or running `systemd-sysusers` manually), the .install file is needed.

So the .install file is not useless - not including it properly to the package is a bug, IMHO (although not very severe).

when I was experimenting with it, I removed the package, deleted the user, confirmed the user is deleted by looking at the /etc/passwd file,  cleared the cache, delete all remaining files in the cache directory,  without reboot, I reinstalled privoxy with 'pacman -S'. without reboot , I looked the /etc/passwd file, the 'privoxy' user appeared again in the /etc/passwd file.

I'm not familiar systemd yet so I don't have the knowledge for further discussion  on this topic with you. I will learn it later, but I post the experiment  above here maybe it will be useful to you since it created the user without reboot smile

Last edited by socialloser1 (2017-04-05 09:41:53)

Offline

#14 2017-04-05 09:49:43

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: where is the .install script in a pacman package?

Ah, I just took a look at the hooks directory (/usr/share/libalpm/hooks), and I saw that there is a systemd-sysusers.hook that runs `systemd-sysusers` everytime something happens in /usr/lib/sysusers.d. So indeed, the .install file is not needed anymore. I learned something new today smile

So the packaging bug is that the .install file is no longer needed (and only causes confusion).


pkgshackscfgblag

Offline

#15 2017-04-05 09:57:31

socialloser1
Member
Registered: 2017-04-04
Posts: 32

Re: where is the .install script in a pacman package?

ayekat wrote:

Ah, I just took a look at the hooks directory (/usr/share/libalpm/hooks), and I saw that there is a systemd-sysusers.hook that runs `systemd-sysusers` everytime something happens in /usr/lib/sysusers.d. So indeed, the .install file is not needed anymore. I learned something new today smile

So the packaging bug is that the .install file is no longer needed (and only causes confusion).

yep , I'm the guy being confused this time tongue

Offline

#16 2017-04-05 10:03:15

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: where is the .install script in a pacman package?

socialloser1 wrote:
ayekat wrote:

So the packaging bug is that the .install file is no longer needed (and only causes confusion).

yep , I'm the guy being confused this time tongue

You could file a bug report to avoid further people from getting confused smile


pkgshackscfgblag

Offline

#17 2017-04-05 10:42:20

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: where is the .install script in a pacman package?

There is already a TODO list

Offline

#18 2017-04-05 11:25:33

a821
Member
Registered: 2012-10-31
Posts: 381

Re: where is the .install script in a pacman package?

ayekat wrote:
a821 wrote:

The install file in a pkg.tar.xz file is called .INSTALL, these files are stored in the pacman's database in /var/lib/pacman (there they're called simply "install"). I don't see why it wouldn't work.

The problem here is that the .INSTALL file is not there.

Yes, but I was talking in general...  the discussion shifted from a pacman package (see thread title) to the privoxy package...

Offline

#19 2017-04-05 11:50:55

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: where is the .install script in a pacman package?

Allan wrote:

There is already a TODO list

Didn't know that, thanks! However, the only TODO I found related to sysusers was this one, and privoxy seems to be marked as "complete" there...

a821 wrote:

Yes, but I was talking in general...  the discussion shifted from a pacman package (see thread title) to the privoxy package...

Ah yes, makes sense then.


pkgshackscfgblag

Offline

Board footer

Powered by FluxBB