On install it already changes from:
drwxr-xr-x 2 root root 2 Sep 9 19:47 localhost/
(unpack)
to
drwxr-xr-x 2 root tomcat8 2 Sep 9 19:47 localhost/
(after postinst and service start)
This is confirmed by doing it without postinst:
root@b:~# apt download tomcat8
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 tomcat8 all 8.5.39-1ubuntu1~18.04.3 [46.4 kB]
Fetched 46.4 kB in 0s (449 kB/s)
root@b:~# sudo dpkg --unpack tomcat8_8.5.39-1ubuntu1~18.04.3_all.deb
Selecting previously unselected package tomcat8.
(Reading database ... 42649 files and directories currently installed.)
Preparing to unpack tomcat8_8.5.39-1ubuntu1~18.04.3_all.deb ...
Unpacking tomcat8 (8.5.39-1ubuntu1~18.04.3) ...
Processing triggers for systemd (237-3ubuntu10.38) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for rsyslog (8.32.0-1ubuntu4) ...
On install it already changes from:
drwxr-xr-x 2 root root 2 Sep 9 19:47 localhost/
(unpack)
to
drwxr-xr-x 2 root tomcat8 2 Sep 9 19:47 localhost/
(after postinst and service start)
This is confirmed by doing it without postinst: archive. ubuntu. com/ubuntu bionic- updates/ universe amd64 tomcat8 all 8.5.39- 1ubuntu1~ 18.04.3 [46.4 kB]
root@b:~# apt download tomcat8
Get:1 http://
Fetched 46.4 kB in 0s (449 kB/s)
root@b:~# sudo dpkg --unpack tomcat8_ 8.5.39- 1ubuntu1~ 18.04.3_ all.deb 8.5.39- 1ubuntu1~ 18.04.3_ all.deb ... 1ubuntu1~ 18.04.3) ...
Selecting previously unselected package tomcat8.
(Reading database ... 42649 files and directories currently installed.)
Preparing to unpack tomcat8_
Unpacking tomcat8 (8.5.39-
Processing triggers for systemd (237-3ubuntu10.38) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for rsyslog (8.32.0-1ubuntu4) ...
root@b:~# sudo mv /var/lib/ dpkg/info/ tomcat8. postinst /root/tomcat8- manual. postinst
root@b:~# sudo dpkg --configure tomcat8 1ubuntu1~ 18.04.3) ...
Setting up tomcat8 (8.5.39-
Processing triggers for systemd (237-3ubuntu10.38) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for rsyslog (8.32.0-1ubuntu4) ...
root@b:~# ll /var/lib/ tomcat8/ conf/Catalina/
total 3
drwxr-xr-x 3 root root 3 Feb 27 07:47 ./
drwxr-xr-x 4 root root 11 Feb 27 07:48 ../
drwxr-xr-x 2 root root 2 Sep 9 19:47 localhost/
root@b:~#
Lets take apart the rather complex postinst which command will change the ownership