Improve the example startup script
authorIustin Pop <iustin@google.com>
Thu, 13 Aug 2009 13:52:30 +0000 (15:52 +0200)
committerIustin Pop <iustin@google.com>
Thu, 13 Aug 2009 14:55:22 +0000 (16:55 +0200)
commit82cd7760226f186a16cc3cb84506cc1b81f2f559
tree0d7a123e69f7ec8f1999a558ea6349535ff4dff2
parenta02b4427b8730690a6dae72e369f3f0963544371
Improve the example startup script

Currently, the supplised script has two issues:
  - it doesn't use start-stop-daemon --start correctly, leading to
    messages like "ganeti.errors.GenericError:
    /var/run/ganeti/ganeti-rapi.pid contains a live process" in the logs
  - it doesn't allow start/stop/restart of a single daemon, which leads
    to manual launch, which is bad because we don't reuse the settings
    from the defaults file

For the first one, we change from ‘--exec …’ to ‘--startas …’, which is
the actual option used for start, whereas exec is a test (that also
supplies the default to startas). We also add ‘--oknodo’ as per recent
Debian policy changes.

For the second, we do a bigger change; we basically remove the full-path
and pid variables, and construct these two from the daemon name. We then
check if we are given a daemon name (in which case we only do that)
otherwise we do the requested action on all daemons.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
doc/examples/ganeti.initd.in