Debian 8의 systemd 서비스에서 "exec 형식 오류"가 발생합니다.
내 서비스 유닛 프로필입니다.
[Unit]
Description=testele
After=sinusbot9.service
[Service]
ExecStart=/home/runboti.sh
[Install]
WantedBy=default.target
이것은 /home/runboti.sh 스크립트입니다.
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
echo Files removed and starting bots sinusbot-sinusbot9
service sinusbot start
echo service sinusbot started
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
sleep 5
service sinusbot1 start
echo service sinusbot1 started
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
sleep 5
service sinusbot2 start
echo service sinusbot1 started
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
sleep 5
service sinusbot3 start
echo service sinusbot3 started
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
sleep 5
service sinusbot5 start
echo service sinusbot4 started
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
sleep 5
service sinusbot6 start
echo service sinusbot6 started
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
sleep 5
service sinusbot7 start
echo service sinusbot7 started
rm -fr /tmp/.sinusbot.lock
sleep 5
service sinusbot8 start
echo service sinusbot8 started
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
sleep 5
service sinusbot9 start
echo service sinusbot9 started
rm -fr /tmp/.sinusbot.lock
rm -fr /tmp/.X11-unix/X40
echo All bots is started.
chmod 777
나는 , chmod 664
, 및 기타 다양한 순열을 시도했지만 소용이 없었습니다. WWW를 검색해도 답을 찾지 못했습니다.
systemd는 무엇에 대해 불평하고 어떻게 해결합니까?
답변1
커널이 실행 방법을 알 수 있도록 스크립트 시작 부분에 shebang을 추가해야 합니다.
#!/bin/sh
rm -fr /tmp/.sinusbot.lock
…