我有这个 systemd 文件:
[Unit]
Description=something website
After=syslog.target
Requires=postgresql.service
[Service]
ExecStart=/home/my_user/my_webapp/bin/ foreground
ExecStop=/home/my_user/my_webapp/bin/ stop
Restart=on-abort
WorkingDirectory=/home/my_user/my_webapp/bin
SyslogIdentifier=my_webapp_web_app
User=my_user
[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)
如您所见,“my_webapp”和“my_user”重复了很多次。有没有办法将它们存储到变量中并使用变量代替?