I do have service looking like this:
[Unit] Description=API environment service [Service] WorkingDirectory=/var/www/api ExecStart=/var/www/api/api Restart=always # Restart service after 10 seconds if the dotnet service crashes: RestartSec=10 KillSignal=SIGINT SyslogIdentifier=dotnet-example User=apache Environment=ASPNETCORE_ENVIRONMENT=Production [Install]
Service works but every time I copy new files to that folder through ftp I need to run
sudo chmod +x /var/www/api/api to make that file executable and then do
sudo systemctl restart api.service
My question is is it possible to somehow add line at top of this service which will make this file executable if it is not so i only need to run restart command?