Change terminate to kill
This commit is contained in:
parent
5fcecde568
commit
5c7cfeeb3f
3 changed files with 5 additions and 5 deletions
|
@ -24,13 +24,13 @@ elif [ "$ID" -eq "arch" ] || [ "$ID" -eq "manjaro" ]; then
|
|||
pacman -Sy tmux python python-pip
|
||||
fi
|
||||
|
||||
pip3 install -r requirements.txt
|
||||
|
||||
if [ ! -d "/home/jarvis" ]; then
|
||||
echo Creating user jarvis...
|
||||
useradd -m jarvis
|
||||
fi
|
||||
|
||||
sudo -u jarvis pip3 install -r requirements.txt
|
||||
|
||||
if [ ! -d "/home/jarvis/j.a.r.v.i.s." ]; then
|
||||
echo Copying J.A.R.V.I.S. files...
|
||||
mkdir -p /home/jarvis/j.a.r.v.i.s.
|
||||
|
|
|
@ -5,6 +5,7 @@ Documentation=man:tmux(1)
|
|||
[Service]
|
||||
User=jarvis
|
||||
Group=jarvis
|
||||
WorkingDirectory=/home/jarvis/j.a.r.v.i.s./
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/tmux new-session -d -s jarvis "/home/jarvis/j.a.r.v.i.s./run.py"
|
||||
|
|
5
run.py
5
run.py
|
@ -17,7 +17,7 @@ def run():
|
|||
def restart():
|
||||
global jarvis_process
|
||||
Path(get_pid_file()).unlink()
|
||||
jarvis_process.terminate()
|
||||
jarvis_process.kill()
|
||||
jarvis_process = Process(target=run, name="jarvis")
|
||||
jarvis_process.start()
|
||||
|
||||
|
@ -109,6 +109,5 @@ if __name__ == "__main__":
|
|||
jarvis_process.start()
|
||||
cli()
|
||||
if jarvis_process.is_alive():
|
||||
jarvis_process.terminate()
|
||||
jarvis_process.join(30)
|
||||
jarvis_process.kill()
|
||||
print("All systems shut down.")
|
||||
|
|
Loading…
Add table
Reference in a new issue