You are not logged in.
Hello,
I recently tried to create a code to automatically kill task taking 100% of one of the cores of my processor.
Here is what I am using :
/etc/systemd/system/tueur.service :
[Unit]
Description=Tuons bootctl-random-seed qui prends 100% d'un des coeurs du processeur
[Service]
Type=simple
ExecStart=/usr/local/bin/tueur
[Install]
WantedBy=multi-user.target/etc/systemd/system/tueur.timer :
[Unit]
Description=Lance le script tueur 1 min après le démarrage
[Timer]
OnBootSec=1min
[Install]
WantedBy=timers.target/usr/local/bin/ :
sudo pkill -9 bootctlBut when I boot, nothing happens and I have to kill the task manually.
when typing
journalctl -xein my terminal, I see the following error occured :
tueur.service: Failed to execute /usr/local/bin/tueur: Exec format errorDoes anyone knows where does it come from ? Maybe is because of the sudo, or is it something else I did wrong? I have a very basic understanding of all of this...
Last edited by Bestinbest (2022-04-01 19:15:52)
Offline
The real question would be why bootctl is hogging your CPU.
As for the script, it's missing a shebang.
And since you run the service as root, the call to sudo is pretty useless.
Last edited by schard (2022-04-01 19:03:51)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
Yes I know I have to search for that problem, but right now I have a competitive exam in a few weeks so I don't really have time to spend on that. I guess I'll do my research this summer x).
Anyway, thanks for the reply, I was sure it was something as simple as that.
Have a nice day.
Offline