/etc/init.d/jabber uses "/var/run/jabber/$(basename ${cfgfile%.xml}).pid", which becomes /var/run/jabber/c2s.pid, but config files have <pid>/var/run/jabber/jabberd2-c2s.pid</pid>. As a result, jabber services are starting multiple times (and crashing). Reproducible: Always Steps to Reproduce: 1. emerge =net-im/jabberd2-2.2.17-r1; 2. /etc/init.d/jabberd start; 3. /etc/init.d/jabberd start; Actual Results: Jabber services are starting multiple times (and crashing). Expected Results: Jabber services are starting one time and running. Possible solutions: 1. changing init script; 2. renaming config files to jabberd2-${id}; 3. changing pid files in configs;
ewarn 'If you are upgrading from <=jabberd2-2.2.17 then you might have' ewarn 'to update /etc/jabber/jabberd.cfg via etc-update because' ewarn 'the binaries have been renamed to avoid file collisions!'
oh, I think I misread your report
+*jabberd2-2.3.1-r1 (15 Dec 2013) + + 15 Dec 2013; Julian Ospald <hasufell@gentoo.org> -jabberd2-2.2.17.ebuild, + -jabberd2-2.2.17-r1.ebuild, -files/jabberd2-2.2.17.init, + -files/jabberd2-2.2.17.logrotate, -jabberd2-2.3.1.ebuild, + +jabberd2-2.3.1-r1.ebuild, +files/jabberd2-2.3.1.init, + +files/jabberd2-2.3.1.logrotate, +files/jabberd2-2.3.1.pamd: + fix init script and revbump wrt #494302, remove old
it is now grepping the config files to get the appropriate pid http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-im/jabberd2/files/jabberd2-2.3.1.init?r1=1.1&r2=1.2
Yes, grepping will work in all but one case: <pidfile>/var/run/jabber/jabberd2-${id}.pid</pidfile> Jabberd2 will set ${id} to the value of <id> tag, but init script won't.
(In reply to Regna from comment #5) > Yes, grepping will work in all but one case: > <pidfile>/var/run/jabber/jabberd2-${id}.pid</pidfile> > Jabberd2 will set ${id} to the value of <id> tag, but init script won't. alternative solution?
1: Expect pid files to be jabberd2-$(basename ${cfgfile%.xml}).pid; 2: Don't rename pids in config templates at all, and use old $(basename ${cfgfile%.xml}).pid; 2: grep for <id> and expect pidfiles to be ${id}.pid (not always same as $(basename ${cfgfile%.xml}).pid); 4: grep for <id>, set it to id variable and replace ${id} in greped pid path.
(In reply to Regna from comment #7) > 1: Expect pid files to be jabberd2-$(basename ${cfgfile%.xml}).pid; not sure how that solves the issue > 2: Don't rename pids in config templates at all, and use old $(basename > ${cfgfile%.xml}).pid; not an option, see bug 241472 > 2: grep for <id> and expect pidfiles to be ${id}.pid (not always same as > $(basename ${cfgfile%.xml}).pid); not sure how that solves the issue > 4: grep for <id>, set it to id variable and replace ${id} in greped pid path. That's possible, although it does not really improve the ugliness of the current situation.
Created attachment 371064 [details] jabberd.initd Initscript for the first (or second) option, pidfile name from config file name. Tested.