我确实有如下服务:
[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]
服务正常,但每次我通过 ftp 将新文件复制到该文件夹时,我都需要运行sudo chmod +x /var/www/api/api
以使该文件可执行,然后执行sudo systemctl restart api.service
我的问题是,是否可以以某种方式在此服务顶部添加行,以使此文件可执行,如果不是,那么我只需要运行重新启动命令?