0

I create a .deb package for my app and postinst script is not running after installing . this is my postinst script under the the path of DEBIAN/myapp.postinst

#!/bin/sh
set -e
echo "start postinst packing"
#fix app process permission 
sudo chown root:root /opt/MyApp/myapp
sudo chmod 4755 /opt/MyApp/myapp
echo "finish set permissions"
exit 0
hani
  • 1
  • 2
  • Add verbosity when you install your package (are you doing with `dpkg` so that you have more control). In any case, you should read a lot more documentation and knowing better distribution and security implications. Why `sudo`? (it is wrong!, it is supposed you are already superuser). I'm scaried about permission too. – Giacomo Catenazzi Sep 06 '22 at 08:09

1 Answers1

1

in the DEBIAN/ directory create a file named postinst and copy your script into it, or change the name of myapp.postinst to postinst and you're ready to go

Amirreza
  • 153
  • 9