Data Backup and Recovery

snapcreator 3.3.0 scAgent for AIX cannot be killed with SIGTERM

pascalc
5,529 Views

Just a quick message to describe a little bug on snapcreator agent 3.3.0 for AIX.

Once snapcreator agent is running, it cannot be stopped by a simple kill. I had to issue a 'kill -9' in order to stop the agent.

So I updated scAgent shell to include this fix.

It seems to me that snapcreator (agent) is ignoring SIGTERM signal.

I am running AIX 5.3TL11SP4.

Don't know if this is fixed in 3.4.0.

8 REPLIES 8

ktenzer
5,531 Views

Fixed in SC 3.4.0

You can kill agent in 3.3.0 just need to use a kill -9 as you mention

Regards,

Keith

pascalc
5,531 Views

Mmm, as an Unix engineer, I don't really like things beeing killed with SIGKILL.

The best practice is that the agent should not ignore SIGTERM (the normal kill) signal, and terminate properly with it.

Terminating properly would be for example to trap SIGTERM signal at start of agent, so that the agent can, upon receiving a SIGTERM :

1. give up accepting new agent commands

2. wait for xxx seconds until all current job terminate (multithreaded agent)

3. terminate itself

SIGKILL is reserved for extreme case where a process cannot terminate itself, then the system terminates the process, without the process beeing aware of that.

ktenzer
5,531 Views

I agree however with SC 3.3.0 we ignored SIG{TERM} so the only way to kill 3.3.0 agent was kill -9. In 3.4.0 we are no longer doing this.

Keith

pascalc
5,530 Views

Hummm I disagree Keith

from scAgent3.4.0/bin/scAgent :

stop)

        echo "Shutting down scAgent: "

        sleep 1

        PROC=`ps -ef |grep snapcreator |grep -v grep |awk {'print $2'}`

        if test -z "$PROC"; then

                echo "scAgent failed to stop, not running!"

                exit 1

        else

               kill -9 $PROC

        fi

        RESULT=$?

ktenzer
5,530 Views

I am talking about scAgent inside the code not the start script. The start script does a kill -9, you can not use start script or change it, up to you

Keith

pascalc
5,530 Views

I am confused here, how do you start and stop scAgent in AIX without using init script ?

ktenzer
5,531 Views

snapcreator --start-agent <port> &

ps -ef |grep snapcreator

kill <process id for snapcreator>

OR you can use the bin/scAgent start script

bin/scAgent start

bin/scAgent stop

bin/scAgent restart

In order to use bin/scAgent start script you must have run a "./snapcreator --profile setup", selected no to server and yes to agent this sets up start script based on install path.

You can also change bin/scAgent start script to not do a "kill -9" if you dont want that to be done, a normal kill should sufice with SC 3.4.0.

pascalc
5,531 Views

that is super clear now. Thanks Keith.

Public