diff --git a/build-deb/Makefile b/build-deb/Makefile index f92c0fc..12897c9 100644 --- a/build-deb/Makefile +++ b/build-deb/Makefile @@ -7,11 +7,12 @@ man: man/flaskapp.1.md deb: man ../requirments.txt ../run.py ../flaskapp ../LICENSE cp -r ../flaskapp/* flaskapp/var/flaskapp/flaskapp/ cp ../run.py flaskapp/var/flaskapp/ + cp ../init_db.py flaskapp/var/flaskapp/ cp ../LICENSE flaskapp/var/flaskapp/ chmod -w flaskapp/DEBIAN/* chmod +w flaskapp/DEBIAN/control dpkg-deb --build flaskapp - chmod -w flaskapp/DEBIAN/* + chmod +w flaskapp/DEBIAN/* clean: rm -f flaskapp.deb rm -f man/flaskapp.1 diff --git a/build-deb/flaskapp/DEBIAN/postinst b/build-deb/flaskapp/DEBIAN/postinst index 6f104c8..dc2e190 100755 --- a/build-deb/flaskapp/DEBIAN/postinst +++ b/build-deb/flaskapp/DEBIAN/postinst @@ -1,3 +1,4 @@ #!/bin/sh /usr/bin/systemctl enable flaskapp.service +/var/flaskapp/init_db.py /sbin/service flaskapp start diff --git a/build-deb/flaskapp/DEBIAN/prerm b/build-deb/flaskapp/DEBIAN/prerm index ab24d80..8d8b4fe 100755 --- a/build-deb/flaskapp/DEBIAN/prerm +++ b/build-deb/flaskapp/DEBIAN/prerm @@ -1,3 +1,3 @@ #!/bin/sh /sbin/service flaskapp stop -/usr/bin/systemdctl disable flaskapp.service +/usr/bin/systemctl disable flaskapp.service