1

I need to modify a dpkg installer, since one file does not run correctly after being installed, and it needs to be owned by root but run with caller user id.

I tried to put the commands required in a postinst file, but nothing happens.

#!/bin/sh

chown root /data/usr/bin/TheApp
chgrp root /data/usr/bin/TheApp
chmod +s /data/usr/bin/TheApp

exit 0

Where should I place the commands such that they are performed during dpkg -i ?
I have seen similar questions, most say to put in postinst - if that is correct, something must be wrong with the postinst file.

I noticed that the postinst file exists in the folder created - but not in the compressed .deb file.

What can be keeping the postinst file from being copied over to the debian package when calling dpkg -b ?

Thalia
  • 333
  • 1
    @K7AAY Removed reference to debian installer. It is pure ubuntu. – Thalia Mar 11 '20 at 17:24
  • 1
    @Melebius: I am trying to modify the options when creating a package. It is common when writing software. Has nothing to do with using published packages. – Thalia Mar 11 '20 at 18:02

1 Answers1

0

The postinst file was correct - but it did not get copied in the installer.

Reasons -

Seems all 4 files are needed (postinst, postrm, preinst, prerm) - and their permission must be set (must be >=0555 and <=0775) `

Thalia
  • 333