Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6015

failed to execute linux service script with "exec format error"

$
0
0

I write a bash script to clean proxy:

dconf write /system/proxy/mode "'none'"

I can use terminal to execute it, but I want to use it as service, so, I write a service to execute it before shutdown:

[Unit]Description=clean proxyDefaultDependencies=noBefore=shutdown.target reboot.target halt.target[Service]Type=oneshotExecStart=/home/***/myprocess/services/logout_service.sh[Install]WantedBy=shutdown.target reboot.target halt.target

then I enable this service, but when I restart my computer, it faild,

sudo journalctl -u shutdown-clean-proxy.service

3月 23 22:28:40 the-refuge systemd[1]: Starting clean proxy...3月 23 22:28:40 the-refuge systemd[3442]: shutdown-clean-proxy.service:Failed to execute /home//myprocess/services/logout_service.sh: Exec format error3月 23 22:28:40 the-refuge systemd[3442]: shutdown-clean-proxy.service: Failed at step EXEC spawning/home//myprocess/services/logout_service.sh: Exec format error3月 23 22:28:40 the-refuge systemd[1]: shutdown-clean-proxy.service: Main process exited, code=exited, status=203/EXEC3月 23 22:28:40 the-refuge systemd[1]: shutdown-clean-proxy.service: Failed with result 'exit-code'.3月 23 22:28:40 the-refuge systemd[1]: Failed to start clean proxy.

can't get anything with what's wrong.

please help ~


Viewing all articles
Browse latest Browse all 6015

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>