RE: Script not terminating properly
"Geoffrey Scott" <[email protected]>
| Newsgroups | gmane.org.user-groups.mlug.main |
|---|---|
| Message-ID | <[email protected]> |
Tony Langdon wrote: > At 05:30 PM 11/3/2005, you wrote: > >> So the --stop part of the script successfully completes, then the >> rsync, then the --start part to start the services again, then it >> hangs and never hands the shell prompt back to the backup server. >> >> unfortunatley I tried your suggestion and it still hangs......... > > Hmm notice you're using SSH remotely. Are you putting the service in > the background yourself, or is it a proper daemon? Reason I'm asking I'm not consciously backgrounding anything. I wanted each process to successfully complete before the next runs. But from what I am seeing everything works except for the "fi" : " /etc/init.d/openexchange start echo `date` echo "all done" # it hangs just after this fi " At this point on the backup server I ctrl-C and then the main script completes. The annoying thing is that is I shut down all the services that would normally get shut down with this script and then pass the --start argument to it, it works fine, starts the services and hands the prompt back... > is I'm wondering if you're encountering that OpenSSH annoyance where > the session can hang onm closing if a process is started in the > background during the session. There's an explanation of exactly > what the issue is on the OpenSSH site if I recall... Not sure if this answers your question.....: root@mail:~/scripts # ps ax | grep -i ssh 3825 ? Ss 0:00 /usr/sbin/sshd 24160 ? Ss 0:01 sshd: root@pts/0 13048 ? Ss 0:00 sshd: root@notty 13164 pts/0 S+ 0:00 grep -i ssh Regards Geoff Scott