Skip to content

Commit

Permalink
terminal-run: add error cases for /tmp bad permissions or missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Botspot committed Apr 2, 2024
1 parent 92e25c0 commit 72ca3cd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions etc/terminal-run
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,18 @@ fi
#A terminal should now be launching and in a few seconds the pid file should appear
if [ ! -z "$temp_pid_file" ];then
#echo "Waiting for terminal to close..."
#wait until pid file exists and give up in 5 seconds
#wait until pid file exists and give up in 10 seconds
attempts=0
while [ ! -f "$temp_pid_file" ];do

if [ "$attempts" -gt 10 ];then
error "terminal-run: No terminal detected as it never created the pid file within 5 seconds."
if [ ! -d /tmp ];then
error "terminal-run: Terminal failed to launch because your /tmp directory is missing. Please create the directory and set the permissions to 1777."
elif ! touch "$temp_pid_file" ;then
error "terminal-run: Terminal failed to launch due to bad permissions in your /tmp directory. Please ensure that the folder's permissions are set to 1777. (Current permission value is $(stat -c %a /tmp))"
else
error "terminal-run: No terminal detected as it never created the pid file within 10 seconds."
fi
fi
sleep 1
attempts=$((attempts + 1))
Expand Down

0 comments on commit 72ca3cd

Please sign in to comment.