我正在尝试将守望者设置为用户服务。
我已尽可能密切关注他们的文档。这就是我所拥有的:
套接字文件:
[Unit]
Description=Watchman socket for user %i
[Socket]
ListenStream=/usr/local/var/run/watchman/%i-state/sock
Accept=false
SocketMode=0664
SocketUser=%i
SocketGroup=%i
[Install]
WantedBy=sockets.target
服务文件:
[Unit]
Description=Watchman for user %i
After=remote-fs.target
Conflicts=shutdown.target
[Service]
ExecStart=/usr/local/bin/watchman --foreground --inetd --log-level=2
ExecStop=/usr/bin/pkill -u %i -x watchman
Restart=on-failure
User=%i
Group=%i
StandardInput=socket
StandardOutput=syslog
SyslogIdentifier=watchman-%i
[Install]
WantedBy=multi-user.target
Systemd 尝试运行 watchman 但卡在重启循环中。
这些是我得到的错误:
Apr 16 05:41:00 debian systemd[20894]: [email protected]: Failed to determine supplementary groups: Operation not permitted
Apr 16 05:41:00 debian systemd[20894]: [email protected]: Failed at step GROUP spawning /usr/local/bin/watchman: Operation not permitted
我 100% 确定我启用此服务和套接字的组和用户存在。我究竟做错了什么?