I have a file package.init that is placed in /etc/init.d/. Having this file and building with "dpkg-buildpackage -us -uc" dh_installinit creates the postinst file
#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ -x "/etc/init.d/package" ] || [ -e "/etc/init/package.conf" ]; then
if [ ! -e "/etc/init/package.conf" ]; then
update-rc.d package defaults >/dev/null
fi
invoke-rc.d package start || exit $?
fi
# End automatically added section
Also, I have an rsyslogd file that needs to be places in /etc/rsyslog.d. I managed to put the new file in the directory, but for rsyslogd to get the new configuration it needs to restart. So, I thought of creating the postinst file
service rsyslog restart
If I add this file, then the former postinst file gets overridden completely, and all it contains is "service rsyslog restart"
I am trying to avoid editing postinst manually. I was hopping that the contents of my postinst file would be appended to the the one created by dh_installinit, but that's not the case.
Here is my question: How can I append another rule to the postinst that is created by dh_installinit.