error message when stopping with debian service script

Description

When stopping the idempiere server with the debian start/stop script the server is stopped but there is an error message. This message is wrong and confusing.

root@freibier:~# /etc/init.d/idempiere stop Stopping iDempiere ERP: Setting myEnvironment .... [warn] Trying direct kill with signal -15 ... (warning). /etc/init.d/idempiere: 93: kill: No such process [ ok ] Service stopped with kill -15.

Environment

debian linux server

Attachments

1

discovered while testing

Activity

Thomas Bayen 
January 7, 2014 at 3:44 PM

Please review this patch. It works well on my debian system. I expect it to work too in Ubuntu but can not test it myself.

Thomas Bayen 
January 7, 2014 at 3:33 PM

The patch of https://idempiere.atlassian.net/browse/IDEMPIERE-646#icft=IDEMPIERE-646 works but still gives an error message. I opened a separate issue as IDEMPIERE-1677.

Thomas Bayen 
January 7, 2014 at 3:31 PM

In the said line 93 a special commandline is used to get the pid of the process group's main process to stop. This commandline creates one pid for every process in the group. So as a result the same pid is created more than one time.

kill -15 -`ps ax o pgid,command | grep -v grep | grep $IDEMPIERE_HOME | sed -e 's/^ *//g' | cut -f 1 -d " "`

Example (to clarify what happens):

root@freibier:~# ps ax o pgid,command | grep -v grep | grep /home/idempiere/idempiere.gtk.linux.x86_64/idempiere-server 23156 /bin/sh /home/idempiere/idempiere.gtk.linux.x86_64/idempiere-server/idempiere-server.sh 23156 /usr/lib/jvm/java-6-openjdk-amd64/bin/java -Dosgi.compatibility.bootdelegation=true -Dosgi.noShutdown=true -Dosgi.framework.activeThreadType=normal -XX:MaxPermSize=192m -jar /home/idempiere/idempiere.gtk.linux.x86_64/idempiere-server/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -console 12612 -application org.adempiere.server.application root@freibier:~# ps ax o pgid,command | grep -v grep | grep /home/idempiere/idempiere.gtk.linux.x86_64/idempiere-server | sed -e 's/^ *//g' | cut -f 1 -d " " 23156 23156

My proposal is to let this commandline end with "| uniq".

Fixed

Details

Assignee

Reporter

Labels

Affects versions

Priority

Created January 7, 2014 at 3:25 PM
Updated June 6, 2014 at 2:27 PM
Resolved January 8, 2014 at 1:21 PM