Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to specify shutdown for PM2 #442

Closed
npburns224 opened this issue Jan 6, 2020 · 2 comments
Closed

Option to specify shutdown for PM2 #442

npburns224 opened this issue Jan 6, 2020 · 2 comments
Labels

Comments

@npburns224
Copy link

npburns224 commented Jan 6, 2020

Describe The Bug:
Homebridge Config UI X not honoring custom shutdown command specified in the config.json file. Pressing the "Shutdown" button on the web interface runs the specified custom reboot command.

To Reproduce:

  1. Insert "linux": { "shutdown": "pm2 stop", "restart": "pm2 restart" } into config.json.
  2. Restart Homebridge instance.
  3. Press "Shutdown" button on web interface.

Expected behavior:
pm2 stops Homebridge instance.

Snippit from pm2 Log:
| Homebridge-MQTT | [Config] Shutting down linux server with command: "pm2 restart"
| Homebridge-MQTT | [Config] Got SIGINT, shutting down Homebridge...
| Homebridge-MQTT | [Config] Loaded config.json with 0 accessories and 3 platforms.
[Homebridge continues to run from this point]

Homebridge Config:

{
            "platform": "config",
            "name": "Config",
            "port": 8084,
            "auth": "form",
            "theme": "dark-mode",
            "linux": {
                "shutdown": "pm2 stop",
                "restart": "pm2 restart"
            },
            "temp": "/sys/class/thermal/thermal_zone0/temp",
            "tempUnits": "c",
            "sudo": false,
            "log": {
                "method": "custom",
                "command": "pm2 logs --out --lines 50"
            }
        }

Environment:

  • Node.js Version: v13.5.0
  • NPM Version: v6.13.4
  • Homebridge Version: v0.4.50
  • Homebridge Config UI X Version: v4.6.7
  • Operating System: Raspbian
  • Process Supervisor: pm2
@npburns224 npburns224 added the bug label Jan 6, 2020
@oznu
Copy link
Member

oznu commented Jan 6, 2020

Hi @npburns224,

I can confirm this is a bug. Thanks for reporting this. It will be fixed in the next release.

https://github.com/oznu/homebridge-config-ui-x/blob/4.6.7/src/modules/platform-tools/linux/linux.service.ts#L39

@oznu
Copy link
Member

oznu commented Jan 8, 2020

This bug is fixed in the @test release. Thanks again for raising this.

#443

@oznu oznu closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants