for example:
/etc/init.d/courier-imap start
* Starting courier-imapd ... [ !! ]
/etc/init.d/jabberd and courier-imap-ssl also fail.
syslog indicates that the shell scripts being exec'd start and are then immediatly stopped (killed?)
please help

This is one royal pain. Is it the intended behavior on the part of the devs that only start-stop-daemon runs binaries? What about chuid for scripts? What is the best approach to compensate? Was this caveat discussed in Gentoo Weekly Newsletter or something comparable?snacknuts wrote:Today I noticed that all /etc/init.d/ scripts that "--exec" shell scripts have started failing.
Technically you can run scripts - provided that the script is the daemon and uses #!/bin/bash instead of #!env bashtimotheus25 wrote:This is one royal pain. Is it the intended behavior on the part of the devs that only start-stop-daemon runs binaries?
Again, you can use chuid for scripts provided they meet the above criteria - or move the logic of the "script" into the init script and solve the issue that way.What about chuid for scripts? What is the best approach to compensate?
Actually yes. I sent out 3 e-mails to the gentoo-dev mailing list, and no-one objected. I also emailed how to solve existing init scripts. I informed people though the correct channels.Was this caveat discussed in Gentoo Weekly Newsletter or something comparable?

Thanks, but I am still looking for a solution.UberLord wrote: Technically you can run scripts - provided that the script is the daemon and uses #!/bin/bash instead of #!env bash
The problem is that what s-s-d executes is expected to be the daemon.
Code: Select all
% head -n 7 /usr/bin/jabberd
#!/bin/sh
#-*-Perl-*-
exec perl -w -x $0 "$@"
#!perl
Code: Select all
% grep -A 2 -- --start /etc/init.d/jabber
start-stop-daemon --start -c jabber:jabber \
--make-pidfile --pidfile /var/run/jabber/jabberd.pid \
--background -q -x /usr/bin/jabberd
Code: Select all
% cat /usr/local/jabber/bin/pyaim-t.sh
#!/bin/bash
CMD=/usr/lib/python2.4/site-packages/pyaim-t/pyaim-t.py
exec python $CMD -c /etc/jabber/pyaim-t.xml -l /var/log/jabber/pyaim-t.log
Code: Select all
% grep -A 3 -- --start /etc/init.d/pyaim-t
start-stop-daemon --name pyaim-t.sh --start --background --chuid jabber:jabber \
--exec /usr/local/jabber/bin/pyaim-t.sh
true
eend $?
jabber is a bad case for start-stop-daemon. The last time I looked at the script which is the "daemon" it really launched 4 separate daemons.timotheus25 wrote:Thanks, but I am still looking for a solution.UberLord wrote: Technically you can run scripts - provided that the script is the daemon and uses #!/bin/bash instead of #!env bash
The problem is that what s-s-d executes is expected to be the daemon.
Jabber is a good example of a now broken service. I have jabberd-2.0.11 installed (latest).
It's called start-stop-daemon for a reason - and what you are trying to run is NOT a daemon.Also, I want to run many python scripts that create PID files but do not rename their process as a daemon. What can I do?
For example:Code: Select all
% cat /usr/local/jabber/bin/pyaim-t.sh #!/bin/bash CMD=/usr/lib/python2.4/site-packages/pyaim-t/pyaim-t.py exec python $CMD -c /etc/jabber/pyaim-t.xml -l /var/log/jabber/pyaim-t.logCode: Select all
% grep -A 3 -- --start /etc/init.d/pyaim-t start-stop-daemon --name pyaim-t.sh --start --background --chuid jabber:jabber \ --exec /usr/local/jabber/bin/pyaim-t.sh true eend $?
Code: Select all
start-stop-daemon --start --exec python -- background --chuid jabber:jabber \
-- /usr/lib/python2.4/site-packages/pyaim-t/pyaim-t.py \
-c /etc/jabber/pyaim-t.xml -l /var/log/jabber/pyaim-t.logSure - make a patch for our man page and we'll include itWould bugging baselayout for a a s-s-d man-page example w.r.t. scripts be reasonable?
Does that mean the next update of courier-imap has this fixed? I mean, I can hack startup scripts myself, but on the next update I overwrite this init.d script, so if there is no official solution, I have to remember not to overwrite the script on etc-update. That I remember is unlikely to happen, because one shouldn't make custom modification to init.d scripts, and therefore I always overwrite them with etc-update.I submitted fixed scripts for that over a year ago, but for various reasons (devs retired is one) i never got stabled. That is now happening
I believe that version 4.0.4 in portage right now has fixed scripts.halfgaar wrote:Does that mean the next update of courier-imap has this fixed?I submitted fixed scripts for that over a year ago, but for various reasons (devs retired is one) i never got stabled. That is now happening
Code: Select all
# /etc/init.d/cupsd status
* status: starting