Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
2004-05-25 Al Riddoch <alriddoch@zepler.org>
Browse files Browse the repository at this point in the history
	* cyphesis.sysconfig, cyphesis.init: Fix init script so it
	  doesn't parameterise database name (which doesn't work)
	  exits correctly on fatal errors, and remove the code to
	  load obsolete server-side map files.

	* cyphesis.spec.in: Fix deps.
  • Loading branch information
alriddoch committed May 25, 2004
1 parent 6338093 commit 7126a8b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2004-05-25 Al Riddoch <alriddoch@zepler.org>

* cyphesis.sysconfig, cyphesis.init: Fix init script so it
doesn't parameterise database name (which doesn't work)
exits correctly on fatal errors, and remove the code to
load obsolete server-side map files.

* cyphesis.spec.in: Fix deps.

2004-05-24 Al Riddoch <alriddoch@zepler.org>

* common/stringstream.h: Get rid of local sstream implementation
Expand Down
22 changes: 8 additions & 14 deletions cyphesis.init
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ start() {
if ! su $POSTGRESUSER -c true >/dev/null 2>&1; then
echo
echo $"Could not check for running PostgreSQL database."
exit 1
return 1
fi

# Make sure postgres is running
if ! su $POSTGRESUSER -c "psql -c \"\" template1" >/dev/null 2>&1; then
echo $"PostgreSQL server is not running."
exit 1
return 1
fi

# Make sure the user we are going to run as exists
if ! su $CYPHESISUSER -c true >/dev/null 2>&1; then
echo $"Cannot find user $CYPHESISUSER to run cyphesis service."
exit 1
return 1
fi

# Make sure the user has a postgres account
Expand All @@ -66,6 +66,7 @@ start() {
echo_success
else
echo_failure
return 1
fi
echo
# Populate it with rules
Expand All @@ -76,24 +77,15 @@ start() {
echo_success
else
echo_failure
fi
echo
# Populate it with a map
echo -n $"Loading database with map: "
su $CYPHESISUSER -c "cydbload /etc/cyphesis/moraf.xml" >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
else
echo_failure
return 1
fi
echo
fi

echo -n $"Starting cyphesis: "

# Run the server, in self daemonising mode
su $CYPHESISUSER -c "/usr/bin/cyphesis --cyphesis:daemon=true --cyphesis:dbname=$CYPHESISDBASE" >/dev/null 2>&1
su $CYPHESISUSER -c "/usr/bin/cyphesis --cyphesis:daemon=true" >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
Expand All @@ -118,9 +110,11 @@ stop() {
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
restart|reload)
stop
Expand Down
10 changes: 4 additions & 6 deletions cyphesis.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Source0: %{name}-%{version}.tar.gz
Source1: cyphesis.init
Source2: cyclient.init
Source3: cyphesis.sysconfig
Requires: Atlas-C++ >= 0.4.93 varconf skstream >= 0.3.2 readline postgresql-libs >= 7.1 python >= 1.5.2 libstdc++
Requires: Atlas-C++ >= 0.4.93 varconf skstream >= 0.3.1 readline postgresql-libs >= 7.1 python >= 1.5.2 libstdc++
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildRequires: Atlas-C++-devel >= 0.4.93 varconf-devel skstream-devel >= 0.3.2 readline-devel postgresql-devel >= 7.1 python-devel >= 1.5.2 libstdc++-devel
BuildRequires: Atlas-C++-devel >= 0.4.93 varconf-devel skstream-devel >= 0.3.1 readline-devel postgresql-devel >= 7.1 python-devel >= 1.5.2 libstdc++-devel

%description
Cyphesis is a very simple world simulator. NPCs that do things according to
Expand Down Expand Up @@ -47,7 +47,7 @@ Acorn is deprecated. See README for details.
%package mason
Summary: Game data for running the Mason game in cyphesis
Group: Amusements/Games
Requires: %{name} = %{version}
Requires: %{name} = %{version} %{name}-acorn

%description mason
This is the rules data, scripts and map data required for the Mason
Expand All @@ -56,7 +56,7 @@ game. Install this package if you intend to run an Mason server.
%package werewolf
Summary: Game data for running the Werewolf game in cyphesis
Group: Amusements/Games
Requires: %{name} = %{version}
Requires: %{name} = %{version} %{name}-acorn

%description werewolf
This is the rules data, scripts and map data required for the Werewolf
Expand Down Expand Up @@ -127,13 +127,11 @@ rm -rf $RPM_BUILD_ROOT
%files acorn
%defattr(-,root,root)
%config %{_sysconfdir}/cyphesis/acorn.xml
%config %{_sysconfdir}/cyphesis/agrilan*.xml
%{_datadir}/cyphesis/rulesets/acorn

%files mason
%defattr(-,root,root)
%config %{_sysconfdir}/cyphesis/mason.xml
%config %{_sysconfdir}/cyphesis/moraf.xml
%{_datadir}/cyphesis/rulesets/mason

%files werewolf
Expand Down
1 change: 0 additions & 1 deletion cyphesis.sysconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
CYPHESISUSER=cyphesis
CYPHESISDBASE=cyphesis

0 comments on commit 7126a8b

Please sign in to comment.