On Tuesday, December 9, 2014 21:49 CET, Vadim Zhukov <persg...@gmail.com> wrote: > Sebastian, you made me remember having this diff for a long time. > Using it in production for more than a year, but last 2 or 3 > releases I always rememebered about it right at the freeze time. :( > Feel free to take any ideas from here if you want. > > IIRC, I didn't implement "stop" via ejabberctl because it could > leave daemon running under some circumstances. > -- > WBR, > Vadim Zhukov >
Thanks for the feedback, updated patch below. Updates to the pkg README, and changes to the rcscript itself based on Antoines feedback. I did not went the pexp= route, because for example the node name, given by the user, could be even more exotic, and then the script would fail to match with the partially hardcoded node name like you had it. Well, I could add a sentence to the pkg README about that if someone thinks it makes sense? With or without such a sentence, would this maybe OK now? Sebastian Index: Makefile =================================================================== RCS file: /cvs/ports/net/ejabberd/Makefile,v retrieving revision 1.33 diff -u -r1.33 Makefile --- Makefile 27 Oct 2014 15:44:20 -0000 1.33 +++ Makefile 10 Dec 2014 09:32:07 -0000 @@ -4,7 +4,7 @@ V= 2.1.12 DISTNAME= ejabberd-$V -REVISION= 1 +REVISION= 2 CATEGORIES= net Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/net/ejabberd/pkg/PLIST,v retrieving revision 1.14 diff -u -r1.14 PLIST --- pkg/PLIST 24 Jan 2014 19:05:29 -0000 1.14 +++ pkg/PLIST 10 Dec 2014 09:32:07 -0000 @@ -275,3 +275,7 @@ @sample /var/log/ejabberd/ @sample /var/db/ejabberd/ @sample /var/db/ejabberd/ejabberd/ +@mode +@owner +@group +@rcscript ${RCDIR}/ejabberd Index: pkg/README =================================================================== RCS file: /cvs/ports/net/ejabberd/pkg/README,v retrieving revision 1.6 diff -u -r1.6 README --- pkg/README 5 May 2013 16:17:19 -0000 1.6 +++ pkg/README 10 Dec 2014 09:32:07 -0000 @@ -31,26 +31,15 @@ {registration_watchers, ["adm...@example.org"]}, -* Running - Control is done using ${TRUEPREFIX}/sbin/ejabberdctl, run it without +* Administration + Control is done using ${TRUEPREFIX}/sbin/ejabberdctl. Run it without arguments for list of possible commands and flags. It needs to be executed as either root or _ejabberd user. - To start ejabberd at boot time, you may insert the following - into ${SYSCONFDIR}/rc.local: - - if [ -x ${TRUEPREFIX}/sbin/ejabberdctl ]; then - echo -n ' ejabberd'; ${TRUEPREFIX}/sbin/ejabberdctl start - fi - - -* Administration - ejabberdctl has some commands for administration of the server. After - starting ejabberd run ejabberdctl again for the list of options. Another possibility, giving you more options, is the web interface, - available at http://your.server:5280/admin/ where you need to log in - as a user added to admin acl group, give your full jid and your - account password + available at http://your.server:5280/admin/. First, you need to + create a user in the "admin" ACL group. Then you can use his full JID + and account password to log in. * Using SSL Index: pkg/ejabberd.rc =================================================================== RCS file: pkg/ejabberd.rc diff -N pkg/ejabberd.rc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/ejabberd.rc 10 Dec 2014 09:32:07 -0000 @@ -0,0 +1,24 @@ +#!/bin/sh +# +# $OpenBSD$ + +daemon="${TRUEPREFIX}/sbin/ejabberdctl" +daemon_user="_ejabberd" + +. /etc/rc.d/rc.subr + +rc_start() { + ${daemon} ${daemon_flags} start +} + +rc_stop() { + ${daemon} ${daemon_flags} stop +} + +rc_check() { + ${daemon} ${daemon_flags} status +} + +rc_reload=NO + +rc_cmd $1