Никак не получается запустить скрипт с автозапуском. В чем проблема?
Использовал такие команды:
chmod +x /root/scripts/gccscripts.sh
systemctl enable gsscripts.service
systemctl enable gsscripts
systemctl run gsscripts.service
systemctl run gsscripts
[Unit]
Description=gcc
[Service]
Type=simple
ExecStart=/root/scripts/gccscripts.sh
[Install]
WantedBy=multi-user.target
#!/bin/bash
function gcc_stepik()
{
local srcname="${1}.c";
local objname1="${1}";
local objname2="${1}";
cd /root/coding/stepik/c/ && gcc "$srcname" -lm -o "$objname1" && /root/coding/stepik/c/"$objname2";
}
● gccscripts.service - gcc
Loaded: loaded (/etc/systemd/system/gccscripts.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2020-03-31 06:46:56 UTC; 28min ago
Process: 1821 ExecStart=/root/scripts/gccscripts.sh (code=exited, status=0/SUCCESS)
Main PID: 1821 (code=exited, status=0/SUCCESS)
Mar 31 06:46:56 code-server systemd[1]: Started gcc.
root@code-server:~#