My app has one executable ，it can run as non-gui or gui mode.When it runs as a daemon,I did uninstall the app in the application manager,but the daemon still running in the memory.
I create a prerm file like this.
exec /usr/bin/aegis-exec -s -u user -l "killall MyDaemon"it doesn't work too.Even more,I reinstall the app ,if there is no process named MyDaemon,it reports some errors.So i changed the sentences like this:
count='ps -ef|grep MyDaemon'It doesn't work too.The dpkg report that 'ps' not found.
if [$count -gt 1];then
exec /usr/bin/aegis-exec -s -u user -l "killall MyDaemon"