mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Change default location of lock file for csaf aggregator and rephrase error message if lock is in use.
This commit is contained in:
parent
c3a80b9f52
commit
b0d7df69b8
4 changed files with 4 additions and 4 deletions
|
|
@ -32,7 +32,7 @@ const (
|
||||||
defaultWeb = "/var/www/html"
|
defaultWeb = "/var/www/html"
|
||||||
defaultDomain = "https://example.com"
|
defaultDomain = "https://example.com"
|
||||||
defaultUpdateInterval = "on best effort"
|
defaultUpdateInterval = "on best effort"
|
||||||
defaultLockFile = "/var/csaf_aggregator/run.lock"
|
defaultLockFile = "/var/lock/csaf_aggregator/lock"
|
||||||
)
|
)
|
||||||
|
|
||||||
type provider struct {
|
type provider struct {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ func lock(lockFile *string, fn func() error) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !locked {
|
if !locked {
|
||||||
return fmt.Errorf("cannot lock to file %s", *lockFile)
|
return fmt.Errorf("cannot aquire file lock at %s. Maybe the CSAF aggregator is already running?", *lockFile)
|
||||||
}
|
}
|
||||||
defer fl.Unlock()
|
defer fl.Unlock()
|
||||||
return fn()
|
return fn()
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ openpgp_private_key // OpenPGP private key (must have no passphrase set, if
|
||||||
// you want to be able to run unattended, e.g. via cron.)
|
// you want to be able to run unattended, e.g. via cron.)
|
||||||
openpgp_public_key // OpenPGP public key
|
openpgp_public_key // OpenPGP public key
|
||||||
passphrase // passphrase of the OpenPGP key
|
passphrase // passphrase of the OpenPGP key
|
||||||
lock_file // path to lockfile, to stop other instances if one is not done (default:/var/csaf_aggregator/run.lock, disable by setting it to "")
|
lock_file // path to lockfile, to stop other instances if one is not done (default:/var/lock/csaf_aggregator/lock, disable by setting it to "")
|
||||||
interim_years // limiting the years for which interim documents are searched (default 0)
|
interim_years // limiting the years for which interim documents are searched (default 0)
|
||||||
verbose // print more diagnostic output, e.g. https requests (default false)
|
verbose // print more diagnostic output, e.g. https requests (default false)
|
||||||
allow_single_provider // debugging option (default false)
|
allow_single_provider // debugging option (default false)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
workers = 2
|
workers = 2
|
||||||
folder = "/var/csaf_aggregator"
|
folder = "/var/csaf_aggregator"
|
||||||
lock_file = "/var/csaf_aggregator/run.lock"
|
lock_file = "/var/lock/csaf_aggregator/lock"
|
||||||
web = "/var/csaf_aggregator/html"
|
web = "/var/csaf_aggregator/html"
|
||||||
domain = "https://localhost:9443"
|
domain = "https://localhost:9443"
|
||||||
rate = 10.0
|
rate = 10.0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue