如何为 snap 设置服务配置选项。具体来说,这是:
我试过了:
$ sudo snap get webhook
error: snap "webhook" has no configuration
$ sudo snap set webhook foo=bar
error: cannot perform the following tasks:
- Run configure hook of "webhook" snap (snap "webhook" has no "configure" hook)
我看到的唯一配置文件是,/snap/webhook/5/meta/snap.yaml
而且似乎服务没有指定配置(至少需要选项-hooks
)。此外,snap 配置选项似乎是key=value
,并且命令需要-option value
。
我想设置选项,因为如果我运行snap start webhook
然后snap logs webhook
我会看到:
2021-05-22T19:22:02Z webhook.webhook[2436]: aborting webhook execution since the -verbose flag is set to false.
2021-05-22T19:22:02Z webhook.webhook[2436]: If, for some reason, you want webhook to start without the hooks, either use -verbose flag, or -nopanic
2021-05-22T19:22:02Z systemd[1]: snap.webhook.webhook.service: Main process exited, code=exited, status=1/FAILURE
2021-05-22T19:22:02Z systemd[1]: snap.webhook.webhook.service: Failed with result 'exit-code'.
2021-05-22T19:34:40Z systemd[1]: Started Service for snap application webhook.webhook.
2021-05-22T19:34:40Z webhook.webhook[2647]: [webhook] 2021/05/22 19:34:40 couldn't load any hooks from file!
2021-05-22T19:34:40Z webhook.webhook[2647]: aborting webhook execution since the -verbose flag is set to false.
2021-05-22T19:34:40Z webhook.webhook[2647]: If, for some reason, you want webhook to start without the hooks, either use -verbose flag, or -nopanic
2021-05-22T19:34:40Z systemd[1]: snap.webhook.webhook.service: Main process exited, code=exited, status=1/FAILURE
2021-05-22T19:34:40Z systemd[1]: snap.webhook.webhook.service: Failed with result 'exit-code'.
我确信我遗漏了一些基本的东西但如果能提供任何帮助我将不胜感激。