Rohit Bajaj
asked on
Stopping flocksnippet: Killed (core dumped) on doing kill -9
Hi,
I am getting the following output of running a command on linux :
Although my application does stop but i want to understand why this [FAILED] is coming. Is this something to be handled ?
Here is my init script used to stop and start the application:
Thanks
I am getting the following output of running a command on linux :
[robinsu@olympus101 ~]$ sudo service snippet stop
Stopping flocksnippet: Killed (core dumped)
[FAILED]
Although my application does stop but i want to understand why this [FAILED] is coming. Is this something to be handled ?
Here is my init script used to stop and start the application:
#!/bin/bash
# chkconfig: 3 99 99
# description: code snippet app
# processname: snippet
prog="flocksnippet"
user="flocksnippet"
snippet="/opt/flock-snippets"
. /etc/init.d/functions
lockfile=/var/lock/subsys/$prog
start() {
PATH="$PATH:/bin"
FLOCK_APPS_CONFIG=$(cat /etc/env)
exec="/usr/java/default/bin/java -DFLOCK_APPS_CONFIG=${FLOCK_APPS_CONFIG} -jar snippet.jar"
cd $snippet
daemon --user=$user $exec &
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
PATH="$PATH:/bin"
echo -n $"Stopping $prog: "
exec="pgrep -u flocksnippet | xargs kill -9"
daemon --user=$user $exec
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart()
{
stop
start
}
case "$1" in
start)
$1
;;
stop)
$1
;;
restart)
$1
;;
*)
exit 2
esac
exit $?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I created the init script...
The daemon function which i am using is inside /etc/init.d/functions
There are no other process for the user flocksnippet.
My initscript is only createing process for this particular user
functions file you can look at :
http://bash.cyberciti.biz/guide//etc/init.d/functions
Its same as i have on my linux machine
The daemon function which i am using is inside /etc/init.d/functions
There are no other process for the user flocksnippet.
My initscript is only createing process for this particular user
functions file you can look at :
http://bash.cyberciti.biz/guide//etc/init.d/functions
Its same as i have on my linux machine
ASKER
I can remove the -9 .. But since still this error happens i guess there must be something wrong with the way i am killing using daemon
ASKER
Its not getting reproduced if i do kill -9 <pid>
I tried exec="pgrep -u flocksnippet | xargs kill"
But still getting :
Open in new window