×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Stoping AIX subsystem

Stoping AIX subsystem

Stoping AIX subsystem

(OP)
I am trying to stop a subsystem. Here how the subsystem is defined:

mkssys -s mytest -p "/home/tester/testServices/bin/test/script.sh" -a "start" -u 0 -R -Q -d -S -n 9 -f 15

Now the `script.sh` is the following script:
```
#!/bin/bash


PRINT_SCRIPT=/home/tester/testServices/Screen.sh
LOG_FILE="/home/tester/testServices/bin/test/log.txt"


echo "Begin script" >> "$LOG_FILE"



trap sigquit 9 15
sigquit()
{
# set -x

echo "Stop case" >> "$LOG_FILE"
exit 0
}



case "$1" in

start)
echo "Starting screen.sh" >> "$LOG_FILE"
$PRINT_SCRIPT

;;
stop)
echo "Stopping screen.sh" >> "$LOG_FILE"
PID=`ps -ef | grep screen.sh | grep -v grep | awk '{print $2}'`
kill -9 $PID
;;
*)
echo "USAGE " >> "$LOG_FILE"

echo "Usage: {start|stop}" >&2
exit 1
;;
esac
exit 0
```

My question is when the subsystem is started via `startsrc -s mytest` and then `stopsrc -s mytest` is called, why isn't `sigquit()` function or the stop) case invoked. It starts successfully (via `startsrc -s mytest`) and it logs "Starting screen.sh", however it seems that the the `stopsrc -s myservice` doesn't invoke the `script.sh`. Any ideas why? If someone can explain how the shell script understands from the stopsrc -s <service-name> to stop it will be perfect !


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close