Add per-user locking option to portmaster-start run cmds

This commit is contained in:
Daniel
2022-09-27 15:01:47 +02:00
committed by Daniel Hovie
parent a5f916f047
commit 2bd701e9fd
2 changed files with 20 additions and 3 deletions

View File

@@ -46,6 +46,7 @@ type Options struct {
Identifier string // component identifier
ShortIdentifier string // populated automatically
LockPathPrefix string
LockPerUser bool
PIDFile bool
SuppressArgs bool // do not use any args
AllowDownload bool // allow download of component if it is not yet available
@@ -73,6 +74,7 @@ func init() {
{
Name: "Portmaster Notifier",
Identifier: "notifier/portmaster-notifier",
LockPerUser: true,
AllowDownload: false,
AllowHidingWindow: true,
PIDFile: true,
@@ -162,7 +164,7 @@ func run(opts *Options, cmdArgs []string) (err error) {
// check for duplicate instances
if opts.PIDFile {
pid, err := checkAndCreateInstanceLock(opts.LockPathPrefix, opts.ShortIdentifier)
pid, err := checkAndCreateInstanceLock(opts.LockPathPrefix, opts.ShortIdentifier, opts.LockPerUser)
if err != nil {
return fmt.Errorf("failed to exec lock: %w", err)
}