Zitat von Wietse Venema <wie...@porcupine.org>:

Wietse Venema:
lst_ho...@kwsoft.de:
> Zitat von Wietse Venema <wie...@porcupine.org>:
>
> > lst_ho...@kwsoft.de:
> >> The "problem" is more of that distribution like Ubuntu and Redhat are
> >> moving to "upstart" for boot and starting services/daemons. The main
> >> difference for the started services is that upstart need the program

Is there any reason they can't do this:

    Postfix "job" script:

      pre-start exec postfix start
      post-stop exec postfix stop

With this, the system will do the work for them, and everything
uses stable documented interfaces.


I'm just on the way learning the new concepts of upstart...
As far as i understand the common way is to not detach as it is done in the common way but run in foreground to keep contact with upstart (init) so status can be easily collected. It should be possible to fire only a startup script and terminate but with this the daemon listing (initctl list) would show status "waiting" instead of "running".
A simple startup config for sshd taken from Ubuntu 10.04 is for example:


# ssh - OpenBSD Secure Shell server
#
# The OpenSSH server provides secure shell access to the system.

description     "OpenSSH server"

start on filesystem
stop on runlevel S

respawn
respawn limit 10 5
umask 022
# replaces SSHD_OOM_ADJUST in /etc/default/ssh
oom never

pre-start script
    test -x /usr/sbin/sshd || { stop; exit 0; }
    test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
    test -c /dev/null || { stop; exit 0; }

    mkdir -p -m0755 /var/run/sshd
end script

# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
# 'exec' line here instead
exec /usr/sbin/sshd -D


Regards

Andreas


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to