mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(config): check pid for container startup (#1589)
fix(config): check pid for container startup
This commit is contained in:
parent
2881314ad4
commit
4f0e2d82b3
1 changed files with 5 additions and 0 deletions
|
@ -116,6 +116,11 @@ func (c *AppConfig) writeConfig(configPath string, configFile string) error {
|
|||
// if this file exists then the viewer is running
|
||||
// from inside a lxc container so return true
|
||||
host = "0.0.0.0"
|
||||
} else if os.Getpid() == 1 {
|
||||
// if we're running as pid 1, we're honoured.
|
||||
// but there's a good chance this is an isolated namespace
|
||||
// or a container.
|
||||
host = "0.0.0.0"
|
||||
} else if pd, _ := os.Open("/proc/1/cgroup"); pd != nil {
|
||||
defer pd.Close()
|
||||
b := make([]byte, 4096)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue