我正在尝试将名为“myService”的init.d脚本升级到systemd。init.d脚本有1个参数决定要做什么,使用以下开关案例:
case "$choice" in
"start")
# starts service logic here
"stop")
# stops service logic here
"filter")
# runs some .sh file from our PC
esac
为了升级到systemd,我在systemd中创建myService.service
文件并在ExecuteStart和ExecuteStop上设置文件的属性来执行带参数start或stop的init.d文件,现在我可以这样做:systemctl start myService.service
,但是如果我想调用filter
选项我不允许做systemctl filter myService
.service,因为“filter”不是systemctl的有效选项。任何建议我如何克服这个?