我升级到Ubuntu16.04,现在有一个服务问题。
[Unit]
Description=Conan - dong sliders to MAX
After=syslog.target network.target
[Service]
ExecStart=/home/conan/exiles/start_conan.sh
User=conan
Type=simple
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target日志:
systemd[1]: conan.service: Service hold-off time over, scheduling restart.
systemd[1]: Stopped Conan - dong sliders to MAX.
systemd[1]: Started Conan - dong sliders to MAX.
conan : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/xvfb-run --auto-servernum --server-args=-screen 0 640x480x24:32 wine /home/conan/exiles/ConanSandboxServer.exe -log
sudo[5115]: pam_unix(sudo:session): session opened for user root by (uid=0)
sudo[5115]:start_conan.sh[5113]: wine: /home/conan/.wine is not owned by you
systemd[1]: conan.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: conan.service: Unit entered failed state.
systemd[1]: conan.service: Failed with result 'exit-code'.我的第一个想法是,start_conan.sh[5113]: wine: /home/conan/.wine is not owned by you是问题所在。但是.wine是用户"conan“拥有的。
启动脚本:
#!/bin/sh
export WINEARCH=win64
export WINEPREFIX=/home/conan/.wine64
sudo xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine /home/conan/exiles/ConanSandboxServer.exe -log发布于 2017-03-06 15:44:23
您正在尝试以根用户的身份打开它(因为sudo),该文件由conan拥有。尝试:
# chown root:root /home/conan/.wine如果您想以conan的形式打开它,请在脚本中的sudo命令之后添加-u conan。
https://unix.stackexchange.com/questions/349509
复制相似问题