Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28679 - gnocatan init.d script
Summary: gnocatan init.d script
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-14 03:11 UTC by sthom
Modified: 2003-10-17 01:50 UTC (History)
1 user (show)

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


Attachments
start stop restart script to put in /etc/init.d (gnocatan,849 bytes, text/plain)
2003-09-14 03:22 UTC, sthom
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sthom 2003-09-14 03:11:26 UTC
Hi, 
 
when installing I am missing a script starting the gnocatan-meta-server for  
initiating new gnocatan-servers and connecting to them. I have written a  
small but working script to start, stop and restart the service. Maybe, you  
put it to your package 'games-board/gnocatan' for others to play that famous  
game at home without having deep knowledge about runlevels and services on  
Linux. 
 
Regards 
Sascha 
 
---- my script sample ----------------------------- 
 
#!/sbin/runscript 
 
# This script will start gnocatan services. 
 
opts="${opts} start stop" 
 
depend() { 
        need net 
} 
 
start() { 
        ebegin "Starting gnocatan META server..." 
        # start-stop-daemon --start --quiet --exec /usr/bin/gnocatan-meta-server 
        if [ -n "$(ps ax | grep gnocatan-meta | grep -v grep)" ] ; then 
                ebegin "                already running." 
        else 
                /usr/bin/gnocatan-meta-server & 
        fi 
        eend $? 
} 
 
stop() { 
        ebegin "Stopping gnocatan META server..." 
        ebegin "        stopping gnocatan servers..." 
        if [ -n "$(ps ax | grep gnocatan-server | grep -v grep)" ] ; then 
                killall gnocatan-server-console 
        else 
                ebegin "                none were running." 
        fi 
        ebegin "        stopping META server ..." 
        if [ -n "$(ps ax | grep gnocatan-meta | grep -v grep)" ] ; then 
                killall gnocatan-meta-server 
        else 
                ebegin "                none were running." 
        fi 
        eend $? 
} 
 
restart() { 
        svc_stop 
        svc_start 
}
Comment 1 sthom 2003-09-14 03:22:30 UTC
Created attachment 17682 [details]
start stop restart script to put in /etc/init.d
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2003-09-17 23:09:20 UTC
Did start-stop-daemon not work?  Why the commented out code with the slightly
odd check for running?  Just curious.
Comment 3 sthom 2003-09-21 02:45:20 UTC
When starting the server with start-stop-daemon the script doesn't finish. That's why 
I do not use it. And when there is no process of gnocatan-meta-server is presented 
via ps the start-stop-daemon tells me it is aleady running and I can't stop it. I don't 
know start-stop-daemon program well enough. 
Comment 4 Sybren Harmsma 2003-10-14 17:58:19 UTC
I'm not sure what you are trying to do here. In almost all cases the is no
need for users to start a gnocatan meta server.

To play the game, you need to run the gnocatan client. To host a game, you
need to start the gnocatan server. If you host a game, you can add AI players
or you can wait for people (friends?) to enter. If you join a game on someone
elses computer, you dont need a server.

The meta server is a server that holds a list of all active servers. This
way you can look on the internet and find people to play. You can join their
game, or you can register your own server at the meta server. This way other
players can find and enter your server. The meta-server is currently located
at gnocatan.debian.net. Unless you have your own private internet or something,
there's no need to start a meta server IMO.

Also, I don't think starting a gnocatan server at startup will be very useful.
The server needs setting like what map, how many players, etc. Most people
use the gtk frontend (gnocatan-server-gtk) to set the game settings.

Also, there just is a new version of Gnocatan (0.8.0.0). Many bug fixes.
I submitted the ebuild at Bug #31162 and it should be in portage soon.

If you have more questions, check the help, the website, or mail us at gnocatan-develop@lists.sourceforge.net

Comment 5 Mr. Bones. (RETIRED) gentoo-dev 2003-10-17 01:50:06 UTC
Yeah, I kind of don't see the point of the init script either.  Sorry.

If I'm missing something really obvious, go ahead and reopen with a more
detailed reason for including the init script.  Thanks.