I'm using Ubuntu with the latest updates. I made a systemd service to run a script (Server.exe) (Mono, C#) when my server starts. Here's its configuration:
[Unit]
Description=My
After=network.target
[Service]
PIDFile=/home/my/server/bshserver.pid
WorkingDirectory=/home/my/server
ExecStart=/home/my/server/start
User=my
Group=my
SyslogIdentifier=My-Server
StandardOutput=syslog
Restart=on-failure
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
"start" file:
#!/bin/sh
echo Starting MyServer in /home/my/server
/home/my/server/Server.exe
exit $?
I was to try another Ubuntu, fail too
When I run the script /home/my/server/start normally (simply /home/my/server/start on my terminal), it is working as expected. Top reports it's using between 2 and, say, 5% of my CPU, which is normal. But when I start it with service start, htop says it's always using at least 100% of my CPU (one core)
What could explain such a big difference in CPU usage?