Error start-stop-daemon

I run

sstart-stop-daemon --start --exec $ DAEMON $ ARGS

on ubuntu and get the following error

start-stop-daemon: user `p 'not found

Can anyone spot the problem?

Abdul Halik

+3
source share
3 answers

You have to use

start-stop-daemon --start --exec "${DAEMON}" -- ${ARGS}

to ensure that it start-stop-daemondoes not attempt to interpret any of $ARGS, but instead transfers all of them directly to $DAEMON.

+9
source

ephemient is right, but before passing arguments it should appear --. So the above code will not look like this:

start-stop-daemon --start --exec /etc/init.d/mysql -- -u abc
+4
source

, $DAEMON $ARGS . , - -u p.

, :

$ start-stop-daemon --start --exec /etc/init.d/mysql -u abc
    start-stop-daemon: user `abc' not found
    (Success)

(Except that I also get a successful response).

0
source

Source: https://habr.com/ru/post/1712602/


All Articles