From 5c7cfeeb3f8d7e3596dc10f556fbe26fe935164b Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Sat, 26 Jun 2021 12:31:34 -0600 Subject: [PATCH] Change terminate to kill --- install.sh | 4 ++-- jarvis.service | 1 + run.py | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 778a67b..2bb219f 100644 --- a/install.sh +++ b/install.sh @@ -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. diff --git a/jarvis.service b/jarvis.service index 7a4470c..cc14c02 100644 --- a/jarvis.service +++ b/jarvis.service @@ -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" diff --git a/run.py b/run.py index bf3beb0..48d6d97 100644 --- a/run.py +++ b/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.")