service脚本中传参

service文件:

[Unit]
Description=testserver
After=local-fs.target network.target

[Service]
Type=oneshot
Environment="LANG=zh_CN.UTF-8"
EnvironmentFile=/opt/test/config/config.properties
ExecStart=/opt/test/config/test-start.sh ${testType}
ExecStop=/opt/test/config/test-stop.sh ${testType}
RemainAfterExit=yes

[Install]
WantedBy=rescue.target
WantedBy=multi-user.target
WantedBy=graphical.target

config.properties文件:

testType=tomcat

你可能感兴趣的:(Linux,Java,java)