How t kill process in Raspbian Jessie with PIXEL?
I have a desktop script MyPiAutostart.desktop with content:
Code: Select all
[Desktop Entry]
Type=Application
Name=MyPiAutostart
Exec=sudo python2 /home/pi/myPiConfig/PirMotionDetected.py
StartupNotify=false
Name[hr_HR]=MyPiAutostart
Script is in /home/pi/.config/autostart and if I reboot computer i found process in Task manager. If I terminate or kill this process from task manager, it disappear for a few moments and came up again and continues to work. Why I cannot kill this process, it raise again and again in task manager?
I create script for killing but unsuccessfully.
Script is:
Code: Select all
import subprocess
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
PIR_PIN = 7 #GPIO7
GPIO.setup(PIR_PIN, GPIO.IN)
GPIO.cleanup()
proc = subprocess.Popen(["pkill", "-f", "PirMotionDetected.py"], stdout=subprocess.PIPE)
proc.wait()
Thanx,
Faramon