Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved fix to assure only one instance is running. #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patrickludwig
Copy link

@patrickludwig patrickludwig commented Mar 7, 2018

The command 'pgrep -o -f "$APPNAME"' is not safe, as it might return,
e.g. a running editor session where something with $APPNAME is edited!

Also, some users might want to run two backups simultaneously:

rsync-time-backup => DEST1 (oldest PID)
rsync-time-backup => DEST2 (2nd oldest PID)

In that case, simply comparing the oldest PID of APPNAME with RUNNINGPID
will not prevent starting of several instances of the backup to DEST2.

Instead one should check, as done for cygwin (some lines above), whether
the process currently running under RUNNINGPID is identical with $APPNAME.

The command 'pgrep -o -f "$APPNAME"' is not safe, as it might return,
e.g. a running editor session were something with $APPNAME is edited!

Also, some users might want to run two backups simultaneously:

   rsync-time-backup => DEST1 (oldest PID)
   rsync-time-backup => DEST2 (2nd oldest PID)

In that case, simply comparing the oldest PID of APPNAME with RUNNINGPID
will not prevent starting of several instances of the backup to DEST2.

Instead one should check, as done for cygwin (some lines above), whether
the process currently running under RUNNINGPID is identical with $APPNAME.
@SimonHeimberg
Copy link
Contributor

Pr #129 fixes the same (did not see before, sorry), with less tools and the same way as netbsd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants