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

Sander Devrieze s.devrieze at pandora.be
Fri Aug 24 23:52:39 MSD 2007


2007/8/24, Badlop <badlop at gmail.com>:
>     * Automatic touching of logs, when you delete these files when
> they are too big, they are automatically created again when you
> restart
>
> Is it needed? I think ejabberd already generates them if not present.

No idea about the current state of ejabberd, but in the past this was
needed AFAIR. Otherwise I would not have added this feature ;-)

>     * Verifies permissions and the existence of ejabberd.cfg
>
> Not much interesting: make install will already create dirs, seet
> permissions, etc.

My idea was to make it more foolproof:
* user accidentially deletes an important file or changes it to
insecure permissions
* system accidentially deletes an important file or changes it to
insecure permissions because of a bug

==>more security, no strange bug reports sent to the ejabberd project
because of stupid errors by this user (the user will get a good
description of the problem in the error message so he don't have to
search for what he did wrong).

<snip>
> > * 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.
>
> Just a matter of taste: Makefile.in is parsed to build Makefile.
> However, our .template files are not parsed, they are just copied to
> somewhere in root dirs.

Why do you call it .templete then if it is not parsed? Just, call it
"ejabberdctl", that's my thought.

> > * 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 )
>
> It is a nice trick to reduce the size of the file. However, it is not
> that common, and I want this script to be as easy to understand as
> possible.

IMO the cat command is very common ;-)

> > * a configtest option for th script would be nice (see apachectl configtest)
>
> Yes. This is tracked here:
> https://support.process-one.net/browse/EJAB-51
> Maybe it can be included in a future revision.

Didn't Magnus already wrote something like this? Maybe you can just
add it as a patch so that it already can be in next ejabberd release?
If it's not too difficult I think it would be very nice to have this
because it would make the similarity with apachectl's feature set even
more complete (important becaus lot's of admins already know how to
handle Apache ;-) )

<snip>
> > > # ejabberdctl
> > > RPC failed on the node ejabberd at localhost: nodedown
> >
> > Can't the help be displayed, just all apachectl?
>
> The help is displayed when it is useful.

In my script it shows the command that are available when ejabberd is
not started. Maybe do it like this:
ejabberd does not seems to be started. Only next commands are available.
<command list>
More commands will be available when ejabberd is running.

> > > 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?
>
> It is optional, read the output. Those are just examples.

ok

Other general remark:
* Add a man page for ejabberdctl so that people can do "man
ejabberdctl" I guess this needs to be in GFDL license and you probably
also can copy-paste stuff from "man apachectl", but Sergei will know
this better I guess.

-- 
Mvg, Sander Devrieze.


More information about the ejabberd mailing list