benj.david
October 22nd, 2009, 03:59 AM
Hi all,
I'm currently packaging program in deb archives and I would like to activate triggers when other deb are installed.
Actually I would like to do the same as man-db or ufw do when ssh is installed : (sorry it's in French)
$ sudo aptitude install ssh
...
Les NOUVEAUX paquets suivants vont être installés*:
openssh-server{a} ssh
...
Préconfiguration des paquets...
Sélection du paquet openssh-server précédemment désélectionné.
(Lecture de la base de données... 234142 fichiers et répertoires déjà installés.)
Dépaquetage de openssh-server (à partir de .../openssh-server_1%3a5.1p1-5ubuntu1_i386.deb) ...
Sélection du paquet ssh précédemment désélectionné.
Dépaquetage de ssh (à partir de .../ssh_1%3a5.1p1-5ubuntu1_all.deb) ...
Traitement des actions différées («*triggers*») pour « ufw »...
Traitement des actions différées («*triggers*») pour « man-db »...
Paramétrage de openssh-server (1:5.1p1-5ubuntu1) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
* Restarting OpenBSD Secure Shell server sshd [ OK ]
Paramétrage de ssh (1:5.1p1-5ubuntu1) ...
...
$
(initramfs-tools does the same when is kernel or grub is installed)
The only clue I've found is in postinst script :
$ cat /var/lib/dpkg/info/man-db.postinst
#!/bin/sh -e
...
if [ "$1" = triggered ]; then
# We don't print a status message here, as dpkg already said
# "Processing triggers for man-db ...".
run_mandb -pq
exit 0
fi
...
but how this script is linked with the installation of SSH ??
(not found in any ssh/openssh scripts)
Many thanks for your help.
Ben
I'm currently packaging program in deb archives and I would like to activate triggers when other deb are installed.
Actually I would like to do the same as man-db or ufw do when ssh is installed : (sorry it's in French)
$ sudo aptitude install ssh
...
Les NOUVEAUX paquets suivants vont être installés*:
openssh-server{a} ssh
...
Préconfiguration des paquets...
Sélection du paquet openssh-server précédemment désélectionné.
(Lecture de la base de données... 234142 fichiers et répertoires déjà installés.)
Dépaquetage de openssh-server (à partir de .../openssh-server_1%3a5.1p1-5ubuntu1_i386.deb) ...
Sélection du paquet ssh précédemment désélectionné.
Dépaquetage de ssh (à partir de .../ssh_1%3a5.1p1-5ubuntu1_all.deb) ...
Traitement des actions différées («*triggers*») pour « ufw »...
Traitement des actions différées («*triggers*») pour « man-db »...
Paramétrage de openssh-server (1:5.1p1-5ubuntu1) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
* Restarting OpenBSD Secure Shell server sshd [ OK ]
Paramétrage de ssh (1:5.1p1-5ubuntu1) ...
...
$
(initramfs-tools does the same when is kernel or grub is installed)
The only clue I've found is in postinst script :
$ cat /var/lib/dpkg/info/man-db.postinst
#!/bin/sh -e
...
if [ "$1" = triggered ]; then
# We don't print a status message here, as dpkg already said
# "Processing triggers for man-db ...".
run_mandb -pq
exit 0
fi
...
but how this script is linked with the installation of SSH ??
(not found in any ssh/openssh scripts)
Many thanks for your help.
Ben