Κλείσιμο του dhclient
Christos Ricudis
ricudis at itc.auth.gr
Fri May 30 10:10:23 EEST 2008
George Notaras wrote:
> Giorgos Keramidas wrote:
>
> [...]
>
>> : for pid in ${pidlist} ; do
>> : kill -TERM "${pid}"
>> : if [ $? -ne 0 ]; then
>> : # Cannot kill this process, try the next one.
>> : echo "${progname}: kill ${pid}: cannot TERM
>> process." >&2
>> : continue
>> : fi
>> : echo "SIGTERM sent to pid ${pid}"
>> : ps xauww | fgrep -v grep | grep -q
>> "${pid}.*${dhclient}.*${ifname}"
>> : if [ $? -eq 0 ]; then
>> : # Wait a bit for the running dhclient process to exit.
>> : sleep 3
>> : fi
>> : kill -9 "${pid}"
>> : if [ $? -ne 0 ]; then
>> : echo "${progname}: kill ${pid}: cannot KILL
>> process." >&2
>> : else
>> : echo "SIGKILL sent to pid ${pid}"
>> : fi
>> :
>
> Μια ερώτηση έχω. Στέλνονται δύο signals στην κάθε process του
> dhclient, ένα SIGTERM κι ένα SIGKILL. Όσες φορές το δοκίμασα το
> process του dhclient παύει να υπάρχει με το SIGTERM. To SIGKILL γιατί
> το στέλνουμε; Sorry, αν είναι προφανές, αλλά δεν έχω καταλάβει γιατί
> γίνεται αυτό.
Synh8ismenh kalh praktikh.
Ena programma mporei na kanei catch to SIGTERM, kai na ektelesei tis
cleanup routines tou prin termatisei. Makari na to ekanan perissotera
programmata. To SIGTERM isodynamei me to "Sas parakalw, mhpws 8a
mporousate na pate sth gwnia sas kai na psofhsete hsyxa kai diakritika
xwris na enoxlhsete tous geitones, mia kai einai wra koinhs hsyxias?"
To gegonos omws oti ena programma mporei na kanei catch to SIGTERM,
shmainei oti mporei poly aneta kai na to agnohsei, h na to kanei catch
kai na pesei se ena atermono loop, h kati paromoio. Gi ayto, ei8istai
afou tou steiloume to SIGTERM, na tou dinoume ena xroniko peri8wrio (me
th grammh sleep x pou den yparxei metaksy twn grammwn 2 kai 3 sto
parapanw script), kai meta na tou stelnoume ena SIGKILL, to opoio
isodynamei me sfaira sto kefali - to process termatizei ekei pou
brisketai, xwris kammia dynatothta na kanei catch h ignore to signal.
More information about the Linux-greek-users
mailing list