Compare commits
6 Commits
863ca34383
...
v1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b573aa169 | ||
|
|
7474028b82 | ||
|
|
120b7c995a | ||
|
|
301c22be02 | ||
|
|
1d76fd9920 | ||
|
|
d6f56dc569 |
@@ -1,10 +1,11 @@
|
|||||||
run:
|
run:
|
||||||
tests: false
|
tests: false
|
||||||
skip-dirs:
|
|
||||||
- vendor
|
|
||||||
modules-download-mode: readonly
|
modules-download-mode: readonly
|
||||||
allow-parallel-runners: true
|
allow-parallel-runners: true
|
||||||
go: '1.21'
|
go: '1.21'
|
||||||
|
issues:
|
||||||
|
skip-dirs:
|
||||||
|
- vendor
|
||||||
output:
|
output:
|
||||||
sort-results: true
|
sort-results: true
|
||||||
linters:
|
linters:
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ daemon: true
|
|||||||
# PID file for daemon.
|
# PID file for daemon.
|
||||||
pidfile: /var/run/reniced.pid
|
pidfile: /var/run/reniced.pid
|
||||||
|
|
||||||
# Delay between addition and execution of tasks to task pool, to lower cpu load peaks.
|
|
||||||
cmd_delay: 20
|
|
||||||
|
|
||||||
# Delay among iterations.
|
# Delay among iterations.
|
||||||
loop_delay: 5000
|
loop_delay: 5000
|
||||||
|
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -81,6 +81,16 @@ The lower priority value means higher priority and process will eat more io.
|
|||||||
|
|
||||||
RealTime prio is not available for regular users but for root only.
|
RealTime prio is not available for regular users but for root only.
|
||||||
|
|
||||||
|
## Note #2 on ionice operation on Mac OS / Darwin
|
||||||
|
|
||||||
|
The only working official method for Apple OS is via taskpolicy utility that comes with Mac OS itself. (Unlimited kernel
|
||||||
|
API calls requires that calling binary being signed by Apple Inc itself) In context of this program such method is
|
||||||
|
inefficient and beacuse of that mostly likely io task policy for Mac OS will not be implemented.
|
||||||
|
|
||||||
|
## *BSD porting help needed :)
|
||||||
|
|
||||||
|
Indeed. If you have some time and will to add this functionality PRs are welcome!
|
||||||
|
|
||||||
## Special "thanks"
|
## Special "thanks"
|
||||||
|
|
||||||
To security assholes that disrupt workflows and make this world worse.
|
To security assholes that disrupt workflows and make this world worse.
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -157,8 +157,6 @@ func reniced(cnf Config) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
log.Printf("Unable to add task to pool")
|
log.Printf("Unable to add task to pool")
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(time.Millisecond * time.Duration(cnf.CmdDelay))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(time.Millisecond * time.Duration(cnf.LoopDelay))
|
time.Sleep(time.Millisecond * time.Duration(cnf.LoopDelay))
|
||||||
|
|||||||
3
types.go
3
types.go
@@ -10,9 +10,6 @@ type Config struct {
|
|||||||
// LoopDelay in milliseconds - whole set of action delay period.
|
// LoopDelay in milliseconds - whole set of action delay period.
|
||||||
LoopDelay int `yaml:"loop_delay,omitempty"`
|
LoopDelay int `yaml:"loop_delay,omitempty"`
|
||||||
|
|
||||||
// CmdDelay in milliseconds - delay between each change application.
|
|
||||||
CmdDelay int `yaml:"cmd_delay,omitempty"`
|
|
||||||
|
|
||||||
// Whether to print debug info on stdout.
|
// Whether to print debug info on stdout.
|
||||||
Debug bool `yaml:"debug,omitempty"`
|
Debug bool `yaml:"debug,omitempty"`
|
||||||
|
|
||||||
|
|||||||
11
util.go
11
util.go
@@ -34,7 +34,11 @@ func readConf() (Config, error) {
|
|||||||
|
|
||||||
cnf, err = readConfFile(os.Getenv("HOME") + "/.reniced.yaml")
|
cnf, err = readConfFile(os.Getenv("HOME") + "/.reniced.yaml")
|
||||||
} else {
|
} else {
|
||||||
cnf, err = readConfFile("/etc/reniced.yaml")
|
if runtime.GOOS == "freebsd" {
|
||||||
|
cnf, err = readConfFile("/usr/local/etc/reniced.yaml")
|
||||||
|
} else {
|
||||||
|
cnf, err = readConfFile("/etc/reniced.yaml")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cnf, err
|
return cnf, err
|
||||||
@@ -69,11 +73,6 @@ func readConfFile(path string) (Config, error) {
|
|||||||
return Config{}, err
|
return Config{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.CmdDelay == 0 {
|
|
||||||
cfg.CmdDelay = 20
|
|
||||||
log.Printf("cmd_delay can not be 0, setting to %d milliseconds", cfg.CmdDelay)
|
|
||||||
}
|
|
||||||
|
|
||||||
if cfg.LoopDelay == 0 {
|
if cfg.LoopDelay == 0 {
|
||||||
cfg.LoopDelay = 2000
|
cfg.LoopDelay = 2000
|
||||||
log.Printf("loop_delay set to %d milliseconds", cfg.LoopDelay)
|
log.Printf("loop_delay set to %d milliseconds", cfg.LoopDelay)
|
||||||
|
|||||||
Reference in New Issue
Block a user