I have a deb package for my application. Sometimes when I install or remove some software (e.g. synaptic or openssh-server) with command
sudo apt-get install (or remove) synaptic
it executes postinst script for my program with args "configure 1.1.123.0", where 1.1.123.0 is version of my app installed.
Why might this happen? My program has nothing to do with synaptic, openssh-server and other software. How can I debug the cause of this?
Here is the output from terminal:
user@ubuntu:~/tmp$ sudo apt-get remove synaptic
[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package synaptic is not installed, so not removed
The following packages were automatically installed and are no longer required: # This list does not contain myapp
libdpkg-perl fakeroot gir1.2-ubuntuoneui-3.0 libalgorithm-merge-perl g++-4.6 cmake-data dh-apparmor libalgorithm-diff-xs-perl g++ libstdc++6-4.6-dev
linux-headers-3.5.0-23-generic linux-headers-3.5.0-23 libubuntuoneui-3.0-1 thunderbird-globalmenu html2text libqt3-mt libalgorithm-diff-perl libxmlrpc-core-c3
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up myapp:i386 (1.1.777.0) ...
/var/lib/dpkg/info/myapp.postinst configure 1.1.777.0 # This is debug string from my postinst script
update-rc.d: warning: /etc/init.d/myapp missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
System start/stop links for /etc/init.d/myapp already exist.
myapp already installed # <-- message and error from my postinst script
dpkg: error processing myapp:i386 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
myapp:i386
E: Sub-process /usr/bin/dpkg returned an error code (1)
The outputs of sudo dpkg --configure -a
user@ubuntu:~$ sudo dpkg --configure -a
Setting up myapp:i386 (1.1.777.0) ...
=/var/lib/dpkg/info/myapp.postinst=configure 1.1.777.0=
update-rc.d: warning: /etc/init.d/myapp missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
System start/stop links for /etc/init.d/myapp already exist.
starting...
myapp already running.
rc from agent = 1
dpkg: error processing myapp:i386 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
myapp:i386