Welcome!
Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

how to keep an app from running more than one instance(SOLVED)

Help for Current Versions of MX
Post Reply
arky217
Forum Novice
Forum  Novice
Posts: 86
Joined: Mon Jun 19, 2017 6:00 pm

how to keep an app from running more than one instance(SOLVED)

#1

Post by arky217 » Sat May 18, 2019 9:32 pm

Not sure what section this question should go under; please move if needed.

I maintain several computers at a senior center; they're all running MX 18.1
on older Core 2 duo desktops.

The problem is that the users will click to start the browser, in this case Slimjet,
and because it doesn't appear instantly, they will click again and again and again.
Sometimes I have found as many as twenty some instances of the browser running.

My knowledge of scripting is very limited, but I tried making a launcher
to run a file to start the browser with the following script in the file:

#!/bin/bash
killall slimjet
sleep 3s
/usr/bin/flashpeak-slimjet %U
exit 0

The script is supposed to kill all instances of the browser that are
currently running and then start a new instance.

The script works as long as the user doesn't get trigger happy
and just go click, click, click, etc.
When the user does that, it's as if the script isn't there and
many instances of the browser are started.
Tried reducing the delay from 3 sec to 1 sec but didn't make a difference.

Any idea how I can stop the users from starting a dozen or more
instances of the browser.
I tried many times to explain to the users to be patient and give
the browser more time to start, but to no avail.
Last edited by arky217 on Sat May 18, 2019 10:37 pm, edited 1 time in total.

User avatar
JayM
Forum Regular
Forum Regular
Posts: 980
Joined: Tue Jan 08, 2019 4:47 am

Re: how to keep an app from running more than one instance

#2

Post by JayM » Sat May 18, 2019 9:50 pm

This is talking about multiple instances of a shell script rather than an application, but it may be useful:
https://www.golinuxcloud.com/check-if-s ... ell-linux/
New users: Please read this first, and don't forget to add system and hardware information (Quick System Info) to posts!

arky217
Forum Novice
Forum  Novice
Posts: 86
Joined: Mon Jun 19, 2017 6:00 pm

Re: how to keep an app from running more than one instance

#3

Post by arky217 » Sat May 18, 2019 10:37 pm

JayM wrote:
Sat May 18, 2019 9:50 pm
This is talking about multiple instances of a shell script rather than an application, but it may be useful:
https://www.golinuxcloud.com/check-if-s ... ell-linux/
Thank you JayM !
I went to that link and used method one and added the code to
the beginning of my script and it worked like a charm.

Post Reply

Return to “MX Help”