systemd não pode encontrar o arquivo do usuário na inicialização

1

Estou tentando executar um script na inicialização no Ubuntu 16.04.

Estou usando o systemd com o seguinte comando.

[Unit]
Description=ether miner
Requires=network.target
After=syslog.target network.target

[Service]
ExecStartPre=/usr/bin/amdcovc fanspeed:0,1,2,3,4,5=70
ExecStart=/bin/bash /home/moe/Desktop/claymore_ether/start.bash

[Install]
WantedBy=multi-user.target

Eu posso executar o arquivo com sudo systemctl start ether depois de fazer login no usuário.

No entanto, ele não executa o arquivo na reinicialização porque ainda não fiz login no sistema.

Estou recebendo o seguinte erro.

● ether.service - ether miner
   Loaded: loaded (/etc/systemd/system/ether.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since တေး 2018-01-25 14:22:48 +0630; 5min ago
  Process: 1165 ExecStart=/bin/bash /home/moe/Desktop/claymore_ether/start.bash (code=exited, status=127)
  Process: 1142 ExecStartPre=/usr/bin/amdcovc fanspeed:0,1,2,3,4,5=70 (code=exited, status=0/SUCCESS)
 Main PID: 1165 (code=exited, status=127)

ဇန် 25 14:22:48 miner1.local amdcovc[1142]: Setting fanspeed to 70% for adapter 1 at thermal controller 0
ဇန် 25 14:22:48 miner1.local amdcovc[1142]: Setting fanspeed to 70% for adapter 2 at thermal controller 0
ဇန် 25 14:22:48 miner1.local amdcovc[1142]: Setting fanspeed to 70% for adapter 3 at thermal controller 0
ဇန် 25 14:22:48 miner1.local amdcovc[1142]: Setting fanspeed to 70% for adapter 4 at thermal controller 0
ဇန် 25 14:22:48 miner1.local amdcovc[1142]: Setting fanspeed to 70% for adapter 5 at thermal controller 0
ဇန် 25 14:22:48 miner1.local systemd[1]: Started ether miner.
ဇန် 25 14:22:48 miner1.local bash[1165]: /bin/bash: /home/moe/Desktop/claymore_ether/start.bash: No such file or director
ဇန် 25 14:22:48 miner1.local systemd[1]: ether.service: Main process exited, code=exited, status=127/n/a
ဇန် 25 14:22:48 miner1.local systemd[1]: ether.service: Unit entered failed state.
ဇန် 25 14:22:48 miner1.local systemd[1]: ether.service: Failed with result 'exit-code'.

E /home/moe/Desktop/claymore_ether/start.bash existe porque posso executar /bin/bash /home/moe/Desktop/claymore_ether/start.bash sem problemas.

Como posso ter certeza de que o systemd tem acesso à pasta /home/moe ?

Parece que a pasta /home/moe não foi montada no momento em que o systemd executou o comando.

Obrigado.

    
por moeseth 25.01.2018 / 09:19

0 respostas