debian: debconf-clean-admin-password / postinst
1. The file is not executable...
- @grantma `chmod +x debian/debconf-clean-admin-password` ?
2. The hook looks a bit off as it will be triggered by every apt call?
```
gromox-3.7.223.xe13fed5 % cat debian/98zz-gromox.conf
// Clear shared/grommunio/admin-password et al in debconf after apt run
DPkg::Post-Invoke { "/usr/share/gromox/scripts/debconf-clean-admin-password"; };
```
> might it be better to do this via gromox.postinst instead?
```
root@grom-deb:/tmp/tmp.tmhoUfEGEJ# apt reinstall vim
Installing:
vim
Suggested packages:
ctags vim-doc vim-scripts
Summary:
Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 0
Download size: 1,670 kB
Space needed: 4,024 kB / 14.6 GB available
Get:1 http://deb.debian.org/debian trixie/main amd64 vim amd64 2:9.1.1230-2 [1,670 kB]
Fetched 1,670 kB in 0s (7,810 kB/s)
Selecting previously unselected package vim.
(Reading database ... 76672 files and directories currently installed.)
Preparing to unpack .../vim_2%3a9.1.1230-2_amd64.deb ...
Unpacking vim (2:9.1.1230-2) ...
Setting up vim (2:9.1.1230-2) ...
sh: 1: /usr/share/gromox/scripts/debconf-clean-admin-password: Permission denied
Error: Problem executing scripts DPkg::Post-Invoke '/usr/share/gromox/scripts/debconf-clean-admin-password'
Error: Sub-process returned an error code
```
I mean i used this for a while just to see if it works...
`/etc/apt/apt.conf.d/99moo`
```
DPKG::Post-Invoke {
"AUDIO=/usr/lib/libreoffice/share/gallery/sounds/cow.wav; if [ -n $SUDO_USER ] && [ -f "$AUDIO" ] && [ -x /usr/bin/pw-play ]; then sudo -i -u $SUDO_USER /usr/bin/pw-play --volume 0.1 "$AUDIO" ; fi ";
}
DPKG::Post-Invoke { "if [ -n $SUDO_USER ]; then systemd-run --user --machine=$SUDO_USER@.host notify-send DPKG "$(export)"; fi ";}
```
6 条评论