Need to abort a perl script (make it die) - from a

2019-09-04 02:56发布

I need to abort a Perl script which is running in the background from another script.

Many perl scripts run on our machine. I need to abort one of the them on request. All I will know is the name of the perl script to abort. I need to abort that one particular script without affecting other processes.

I tried killing it using PID/Image Name but it did not work for the below reasons,

1)I do not know the PID of the script (as it runs from a trigger)

2)The script runs in the background, so the image name is always perl.exe and hence if image name is used , it kills all the other perl tasks as well.

I tried to get the perl script name from the 'windows title' and hence the corresponding PID, but it always shows 'NA'.

I even tried to delete the perl script(as I know the name and location) but it also did not work, as it runs the entire script from the memory (even though it is deleted)

Please help me with some options to kill the running perl, from another script.

标签: perl abort die
1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-09-04 03:13

Your script may write its pid to special file for another script to use.

查看更多
登录 后发表回答