Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 194654 - net-irc/inspircd initscript won't stop and rehash the service
Summary: net-irc/inspircd initscript won't stop and rehash the service
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Michael Hanselmann (hansmi) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-03 21:25 UTC by Tiger
Modified: 2007-11-13 17:14 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild patch for --bin-dir -> --binary-dir (ebuild.diff,551 bytes, patch)
2007-10-04 22:37 UTC, Craig Edwards
Details | Diff
init.d patch based on new init.d by Tiger (init.d.diff,1.26 KB, patch)
2007-10-04 22:38 UTC, Craig Edwards
Details | Diff
inspircd-1.1.13.ebuild without white spacing (inspircd-1.1.13.ebuild.diff,2.11 KB, patch)
2007-10-06 13:36 UTC, Tiger
Details | Diff
Patch for inspircd initscript (inspircd-initd.diff,955 bytes, patch)
2007-10-06 13:49 UTC, Tiger
Details | Diff
Patch for inspircd initscript (without spaces) (inspircd-initd.diff,1.24 KB, patch)
2007-11-11 14:24 UTC, Eugene Janusov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tiger 2007-10-03 21:25:57 UTC
The runscript works when we start the ircd but don't want to stop it. The
problem seems the wrong pid in pidfile (Maybe the app run
multiples-instances?).
It's the same for 'rehash' command because the path :
  kill -s SIGHUP $(</var/run/inspircd/ircd.pid)
Comment 1 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-10-03 21:35:09 UTC
Craig, can you please fix this and provide me with a patch?
Comment 2 Craig Edwards 2007-10-03 22:07:01 UTC
its not supposed to run multiple instances from the initscript, this could be the problem.

There should probably be a check for already running.
Comment 3 Tiger 2007-10-04 17:31:48 UTC
I made a quick initscript for inspircd and it works fine :

#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        need net
    provide ircd
}

start() {
        ebegin "Starting InspIRCd"
        start-stop-daemon --start --quiet --chuid inspircd \
        --exec /usr/bin/inspircd \
        --pidfile /var/run/inspircd.pid --make-pidfile -- \
        --logfile /var/log/inspircd/ircd.log &>/dev/null
        sleep 1
        echo `pidof inspircd` > /var/run/inspircd.pid
        eend $?
}

stop() {
        ebegin "Stopping InspIRCd"
        start-stop-daemon --stop --quiet --pidfile /var/run/inspircd.pid
        eend $?
}

For rehash function, we need to keep the inspircd launcher, maybe in /usr/bin/inspircd.launcher (I think a simlink to /usr/lib/inspircd/inspircd.launcher/inspird is a bad solution).

The launcher is broken in current ebuild, the ./configure --bin-dir option has moved to --binary-dir
Comment 4 Craig Edwards 2007-10-04 22:01:11 UTC
The configure flag never was --bin-dir, therefore its always been broken.

Hansmi, can we incorporate Tiger's fixed initscript into the ebuild?

Thanks
Comment 5 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-10-04 22:04:45 UTC
(In reply to comment #4)
> The configure flag never was --bin-dir, therefore its always been broken.
> Hansmi, can we incorporate Tiger's fixed initscript into the ebuild?

I can integrate both fixes if you give me diffs/patches. I don't run InspIRCd myself and therefore couldn't test these changes. Thanks a lot.
Comment 6 Craig Edwards 2007-10-04 22:37:37 UTC
Created attachment 132599 [details, diff]
ebuild patch for --bin-dir -> --binary-dir
Comment 7 Craig Edwards 2007-10-04 22:38:00 UTC
Created attachment 132600 [details, diff]
init.d patch based on new init.d by Tiger
Comment 8 Craig Edwards 2007-10-04 22:38:13 UTC
hope these are what you need
Comment 9 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-10-05 20:28:26 UTC
(In reply to comment #8)
> hope these are what you need

I applied the patch for the ebuild. The init.d patch does whitespace changes for no reason and `pidof inspircd` can lead to conflicts. Why rewrite the pid file at all?
Comment 10 Craig Edwards 2007-10-05 21:16:50 UTC
This is tiger's suggested code made into a diff. Ask him why he reformatted it as text? I don't see why the spacing type matters in the initscript.

I don't know shellscript personally, so i can't write this script myself.

If it had been down to me there probably wouldnt be an initscript in the ebuild, however i didnt write the initial code for it.
Comment 11 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-10-06 09:03:28 UTC
(In reply to comment #10)
> This is tiger's suggested code made into a diff. Ask him why he reformatted it
> as text? I don't see why the spacing type matters in the initscript.

It does, see
http://devmanual.gentoo.org/ebuild-writing/file-format/index.html#indenting-and-whitespace

> I don't know shellscript personally, so i can't write this script myself.
> 
> If it had been down to me there probably wouldnt be an initscript in the
> ebuild, however i didnt write the initial code for it.

Since you offered to proxy-maintain, you should feel respsonsible for it. In case you think you can't do that, it's better to remove InspIRCd from Portage.
Comment 12 Tiger 2007-10-06 13:36:53 UTC
Created attachment 132726 [details, diff]
inspircd-1.1.13.ebuild without white spacing

I added a line in post pkg_postinst() function, because now the inspircd launcher works and anyone could start/stop/rehash the ircd :

+       chmod -R 750 "${ROOT}"/usr/$(get_libdir)/inspircd/inspircd.launcher
Comment 13 Tiger 2007-10-06 13:49:59 UTC
Created attachment 132728 [details, diff]
Patch for inspircd initscript

The initscript works fine now with the patched ebuild. It need just one thing but I don't know how to do that : fix the library path for rehash & version function. Can we use sed in ebuild to modify the intscript and use $(get_libdir) function ?
Comment 14 Eugene Janusov 2007-11-11 14:24:49 UTC
Created attachment 135743 [details, diff]
Patch for inspircd initscript (without spaces)

Tiger's initscript works fine, but there are still spaces after patching, so I've corrected it.

Are there any more obstacles for applying these changes to portage?
Comment 15 Craig Edwards 2007-11-11 14:53:21 UTC
There are no obstacles remaining. Any chance we can get this bumped to the latest insp version 1.1.14 while we are at it?
Comment 16 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2007-11-12 21:48:15 UTC
Thanks for the patch, it's applied to CVS.
Comment 17 Tiger 2007-11-13 17:14:09 UTC
Works fine on x86 and amd64 :)