diff --git a/internal/cache/index.go b/internal/cache/index.go index b4a5847c..610df8a2 100644 --- a/internal/cache/index.go +++ b/internal/cache/index.go @@ -348,7 +348,7 @@ func (s *Scanner) scanSingleFile(filePath string) error { if strings.Contains(includePath, "*") { // If it's a relative path, make it absolute based on nginx config dir if !filepath.IsAbs(includePath) { - configDir := filepath.Dir(nginx.GetConfPath("", "")) + configDir := filepath.Dir(nginx.GetConfPath()) includePath = filepath.Join(configDir, includePath) } @@ -373,7 +373,7 @@ func (s *Scanner) scanSingleFile(filePath string) error { // Handle single file include // If it's a relative path, make it absolute based on nginx config dir if !filepath.IsAbs(includePath) { - configDir := filepath.Dir(nginx.GetConfPath("", "")) + configDir := filepath.Dir(nginx.GetConfPath()) includePath = filepath.Join(configDir, includePath) } @@ -413,7 +413,7 @@ func (s *Scanner) ScanAllConfigs() error { }() // Get the main config file - mainConfigPath := nginx.GetConfPath("", "nginx.conf") + mainConfigPath := nginx.GetConfEntryPath() err := s.scanSingleFile(mainConfigPath) if err != nil { logger.Error("Failed to scan main config:", err) diff --git a/internal/performance/config_info.go b/internal/performance/config_info.go index d1ddfc6b..02d80538 100644 --- a/internal/performance/config_info.go +++ b/internal/performance/config_info.go @@ -51,7 +51,7 @@ func GetNginxWorkerConfigInfo() (*NginxConfigInfo, error) { }, } - confPath := nginx.GetConfPath("nginx.conf") + confPath := nginx.GetConfEntryPath() if confPath == "" { return nil, errors.New("failed to get nginx.conf path") } diff --git a/internal/performance/perf_opt.go b/internal/performance/perf_opt.go index 45b0df5d..039ca41d 100644 --- a/internal/performance/perf_opt.go +++ b/internal/performance/perf_opt.go @@ -53,7 +53,7 @@ type PerfOpt struct { // UpdatePerfOpt updates the Nginx performance optimization settings func UpdatePerfOpt(opt *PerfOpt) error { - confPath := nginx.GetConfPath("nginx.conf") + confPath := nginx.GetConfEntryPath() if confPath == "" { return errors.New("failed to get nginx.conf path") } diff --git a/resources/services/nginx-ui.init b/resources/services/nginx-ui.init index 5139a520..2bd56308 100644 --- a/resources/services/nginx-ui.init +++ b/resources/services/nginx-ui.init @@ -17,13 +17,15 @@ CONFIG="/usr/local/etc/nginx-ui/app.ini" start() { echo "Starting $NAME..." - start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --exec $DAEMON -- $CONFIG + # BusyBox compatible syntax + start-stop-daemon -S -b -p $PIDFILE -m -x $DAEMON -- $CONFIG echo "$NAME started" } stop() { echo "Stopping $NAME..." - start-stop-daemon --stop --pidfile $PIDFILE --retry 10 + # BusyBox compatible syntax + start-stop-daemon -K -p $PIDFILE -R 10 rm -f $PIDFILE echo "$NAME stopped" }