Timeline for Running init.d script produces "start-stop-daemon: not found"
Current License: CC BY-SA 4.0
28 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 4, 2020 at 12:05 | answer | added | sciack | timeline score: 0 | |
| Mar 9, 2019 at 12:08 | history | edited | Rui F Ribeiro | CC BY-SA 4.0 |
deleted 41 characters in body; edited tags
|
| Sep 3, 2016 at 6:31 | answer | added | dese.co.uk | timeline score: 0 | |
| Sep 30, 2015 at 14:04 | answer | added | the | timeline score: 6 | |
| Sep 2, 2015 at 20:12 | answer | added | eco | timeline score: 3 | |
| Jan 26, 2015 at 19:34 | comment | added | JonS |
Hi, sorry for the delay. I've added sbin to the path: echo $PATH; /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin but I now get: [....] Starting daemon monitor: monit/etc/init.d/monit: 124: /etc/init.d/monit: start-stop-daemon: not found failed! Thanks.
|
|
| Jan 23, 2015 at 22:15 | comment | added | vinc17 |
@JonS So, the cause of the error is that your $PATH doesn't contain /sbin.
|
|
| Jan 22, 2015 at 10:38 | comment | added | JonS |
Hi sorry for the delay. Was very late here in the uk :) i re-added the line at the top as advised, no error this time just /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games hd /etc/init.d/monit shows 00000000 65 63 68 6f 20 24 50 41 54 48 3b 20 65 78 69 74 |echo $PATH; exit| on the first line. Thanks!
|
|
| Jan 22, 2015 at 1:47 | comment | added | vinc17 |
@TeresaeJunior OK, just /etc/init.d/monit: 124: /etc/init.d/monit: start-stop-daemon: not found comes from the start-stop-daemon line. The error on echo $PATH suggests that /bin/sh is bash, not dash. But the error on start-stop-daemon seems to come from dash. In such a case, the executed command seems to be /etc/init.d/monit: start-stop-daemon, which obviously doesn't exist.
|
|
| Jan 22, 2015 at 1:35 | comment | added | vinc17 |
@TeresaeJunior The missing newline is normal: start-stop-daemon waits for the command to terminate, then it should write OK or FAIL in [....]. Since this must be done on the same line, a newline is not output before that.
|
|
| Jan 22, 2015 at 1:28 | comment | added | admirabilis |
@vinc17 From my tests, it seems it is just a newline missing after the message Starting daemon monitor: monit
|
|
| Jan 22, 2015 at 1:07 | comment | added | vinc17 |
Looking at your initial error message [....] Starting daemon monitor: monit/etc/init.d/monit: 124: /etc/init.d/monit: start-stop-daemon: not found failed!, it appears that start-stop-daemon is executed successfully, but it tries to execute the command monit/etc/init.d/monit: 124: /etc/init.d/monit: start-stop-daemon: not found (I don't know why), which obviously doesn't exist, hence the error message Starting daemon monitor: ... failed!.
|
|
| Jan 22, 2015 at 0:52 | comment | added | vinc17 |
Could you try again with echo $PATH; exit at the beginning of the script? If you still get the error, can you put the beginning of the output of hd /etc/init.d/monit (one must see everything at least until the exit).
|
|
| Jan 22, 2015 at 0:41 | comment | added | JonS | Hi thanks for the replies. I ran file <filename>, and it says: /etc/init.d/monit: POSIX shell script, ASCII text executable | |
| Jan 22, 2015 at 0:40 | comment | added | vinc17 |
It looks like echo $PATH was executed as $PATH (i.e. the contents of $PATH being the command, as in this case with bash, one gets the error message you obtained).
|
|
| Jan 22, 2015 at 0:35 | comment | added | admirabilis |
Complementing what vinc17 said, run file /etc/init.d/monit.
|
|
| Jan 22, 2015 at 0:31 | comment | added | vinc17 |
The fact that echo $PATH; exit gave you a strange error means some serious problem with your script. No problems with unprintable characters? Are the end-of-lines correct?
|
|
| Jan 22, 2015 at 0:12 | comment | added | JonS | Hi, now it says: [....] Starting daemon monitor: monit/etc/init.d/monit: 124: /etc/init.d/monit: /sbin/start-stop-daemon: not found failed! Thanks. | |
| Jan 22, 2015 at 0:08 | comment | added | admirabilis |
Strange, I can't figure out what's happening, but remove echo $PATH; exit from the script, and then replace start-stop-daemon with /sbin/start-stop-daemon in the line 124.
|
|
| Jan 22, 2015 at 0:04 | comment | added | JonS | Hi, it says: /etc/init.d/monit: line 1: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: No such file or directory | |
| Jan 21, 2015 at 23:59 | comment | added | admirabilis |
Try putting echo $PATH; exit at the top of the script, run it, and tell me the output.
|
|
| Jan 21, 2015 at 23:35 | history | edited | JonS | CC BY-SA 3.0 |
added script
|
| Jan 21, 2015 at 23:23 | comment | added | JonS | Hi, thanks for the replies. I'm not using Live, it's a proper install running from a VPS. I am running it as root, yes. | |
| Jan 21, 2015 at 22:19 | comment | added | admirabilis |
Are you trying to run /etc/init.d/monit start as root?
|
|
| Jan 21, 2015 at 22:02 | comment | added | Joseph R. | I faced a similar problem with the Live version of Squeeze before. Is this Debian Live by any chance? | |
| Jan 21, 2015 at 20:30 | comment | added | muru | Perhaps they should specify the full path in the init script. | |
| Jan 21, 2015 at 20:14 | review | First posts | |||
| Jan 21, 2015 at 20:42 | |||||
| Jan 21, 2015 at 20:11 | history | asked | JonS | CC BY-SA 3.0 |