start-stop-daemon quoted arguments misinterpreted

前端 未结 4 569
太阳男子
太阳男子 2020-12-31 01:01

I have been trying to make an init script using start-stop-daemon. I am stuck on the arguments to the daemon. I want to keep these in a variable at the top of the script but

4条回答
  •  梦毁少年i
    2020-12-31 01:35

    Whenever you have a bash variable with spaces, make sure you use quotes when referring to it.

    start-stop-daemon --start --make-pidfile --pidfile $PID --exec $DAEMON -- "$DAEMON_OPTS"

提交回复
热议问题