[ejabberd] Improvements in ejabberd start script - this proposal needs review

Sander Devrieze s.devrieze at pandora.be
Tue Aug 21 20:53:32 MSD 2007

2007/8/21, Badlop <badlop at gmail.com>:
> Some months ago ejabberd SVN got a start script, which also has
> support for ejabberd_ctl [1]. I think that script can be improved
> integrating several features available in other start scripts.
> My proposal improves all the existing stuff in ejabberd SVN with many
> other features copied from Debian official ejabberd package [2, 3, 4]
> and Sander's proposal [5, 6].

See also http://ejabberd.jabber.ru/node/1117#features

> The diff against ejabberd trunk SVN is available here:
> http://ejabberd.jabber.ru/files/contributions/startscript1.diff
> I appreciate any comment; I want ejabberd to include a powerful
> command-line script, unfortunately I'm not an expert in those topics.

Can you move the exporting of some of the variables to the script
instead of the config file, I know you copied this from my script and
that it is a minor thing. Though, it increases consistency and issues
when users remove the line and don't know they have to add "export "
before the variable. So, in the script you can start (after loading
the config file!!) with exporting all variables (I guess it doesn't
matter if they are not set) like this: export $VARIABLE

Other minor improvements:
1) PROCESSES="+P 32768"
-->Allow people to just enter the number like this:
In the script you first have to create a new variable using this one
(not tested):

2) #POLL="-K true"
-->Replace with this:
POLLING=yes (or no)
In the script:
Use an if or case construction to create the POLL variable using the
value of the POLLING variable.

-->same comment as for PROCESSES, maybe also make the naming of the
variable easier

Other comments:
* it seems you didn't added the host detection during configuration?
* you call the file ejabberdctl.template, why not ejabberdctl.in?
AFAIK this is the common naming for files that are changed by the
configure script.
* to display the help text you use multiple echo commands, you can
replace this by a cat command (see e.g.
http://flits102-126.flits.rug.nl/~dirk-jan/linux/inbellen/ppp.html )
* a configtest option for th script would be nice (see apachectl configtest)

>   /sbin/ejabberdctl - Start and administration script

Should be /usr/sbin/ejabberdctl

> # ejabberdctl
> RPC failed on the node ejabberd at localhost: nodedown

Can't the help be displayed, just all apachectl?

> Examples:
>   ejabberdctl restart
>   ejabberdctl --node ejabberd at host restart

Is this "--node ejabberd at host" necessary? Isn't this configured in the
ejabberdctl config file?


Mvg, Sander Devrieze.

More information about the ejabberd mailing list