rpms/cyphesis/devel cyphesis-0.5.18-init.patch,NONE,1.1
Alexey Torkhov
atorkhov at fedoraproject.org
Sat Dec 20 11:00:46 UTC 2008
- Previous message (by thread): rpms/cyphesis/devel .cvsignore, 1.10, 1.11 cyphesis.spec, 1.29, 1.30 sources, 1.10, 1.11
- Next message (by thread): rpms/ember/devel .cvsignore, 1.2, 1.3 ember.spec, 1.7, 1.8 sources, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: atorkhov
Update of /cvs/pkgs/rpms/cyphesis/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12331
Added Files:
cyphesis-0.5.18-init.patch
Log Message:
* Thu Dec 18 2008 Alexey Torkhov <atorkhov at gmail.com> 0.5.18-1
- Update to 0.5.18
cyphesis-0.5.18-init.patch:
--- NEW FILE cyphesis-0.5.18-init.patch ---
diff -ur cyphesis-0.5.17.old/cyphesis.init cyphesis-0.5.17/cyphesis.init
--- cyphesis-0.5.17.old/cyphesis.init 2006-09-27 01:33:12.000000000 +0400
+++ cyphesis-0.5.17/cyphesis.init 2008-11-08 00:03:57.000000000 +0300
@@ -18,34 +18,36 @@
CYPHESISUSER=cyphesis
fi
+CYPHESISPARAMS="--cyphesis:unixport=/var/run/cyphesis/cyphesis.sock"
+
POSTGRESUSER=postgres
start() {
# Start the daemon.
# Make sure postgres superuser exists
- if ! su $POSTGRESUSER -c true >/dev/null 2>&1; then
+ if ! runuser $POSTGRESUSER -c true >/dev/null 2>&1; then
echo
echo $"Could not check for running PostgreSQL database."
return 1
fi
# Make sure postgres is running
- if ! su $POSTGRESUSER -c "psql -c \"\" template1" >/dev/null 2>&1; then
+ if ! runuser $POSTGRESUSER -c "psql -c \"\" template1" >/dev/null 2>&1; then
echo $"PostgreSQL server is not running."
return 1
fi
# Make sure the user we are going to run as exists
- if ! su $CYPHESISUSER -c true >/dev/null 2>&1; then
+ if ! runuser $CYPHESISUSER -c true >/dev/null 2>&1; then
echo $"Cannot find user $CYPHESISUSER to run cyphesis service."
return 1
fi
# Make sure the user has a postgres account
- if ! su $CYPHESISUSER -c "psql -c \"\" template1" >/dev/null 2>&1; then
+ if ! runuser $CYPHESISUSER -c "psql -c \"\" template1" >/dev/null 2>&1; then
echo -n $"Creating PostgreSQL account: "
- su $POSTGRESUSER -c "createuser -A -d -q -R $CYPHESISUSER" >/dev/null 2>&1
+ runuser $POSTGRESUSER -c "createuser -A -d -q -R $CYPHESISUSER" >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
@@ -58,10 +60,10 @@
fi
# Make sure the database exists
- if ! su $CYPHESISUSER -c "psql -c \"\" cyphesis" >/dev/null 2>&1; then
+ if ! runuser $CYPHESISUSER -c "psql -c \"\" cyphesis" >/dev/null 2>&1; then
# Create the database
echo -n $"Creating PostgreSQL database: "
- su $CYPHESISUSER -c "createdb -q cyphesis" >/dev/null 2>&1
+ runuser $CYPHESISUSER -c "createdb -q cyphesis" >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
@@ -73,7 +75,7 @@
echo
# Populate it with rules
echo -n $"Loading database with rules: "
- su $CYPHESISUSER -c "cyloadrules" >/dev/null 2>&1
+ runuser $CYPHESISUSER -c "cyloadrules $CYPHESISPARAMS" >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
@@ -88,7 +90,7 @@
echo -n $"Starting cyphesis: "
# Run the server, in self daemonising mode
- su $CYPHESISUSER -c "/usr/bin/cyphesis --cyphesis:daemon=true" >/dev/null 2>&1
+ runuser $CYPHESISUSER -c "/usr/bin/cyphesis --cyphesis:daemon=true $CYPHESISPARAMS" >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
@@ -96,8 +98,24 @@
else
echo_failure
echo
+ return $RETVAL
fi
echo
+
+ if [ "$POPULATE_WORLD" == "1" ] ; then
+ echo -n $"Populating cyphesis world: "
+
+ # Populate the world with game data
+ runuser $CYPHESISUSER -c "/usr/bin/cyclient $CYPHESISPARAMS" >/dev/null 2>&1
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+ echo_success
+ else
+ echo_failure
+ fi
+ echo
+ fi
+
return $RETVAL
}
@@ -107,7 +125,10 @@
killproc cyphesis
RETVAL=$?
echo
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cyphesis
+ if [ $RETVAL -eq 0 ] ; then
+ rm -f /var/lock/subsys/cyphesis
+ fi
+
return $RETVAL
}
- Previous message (by thread): rpms/cyphesis/devel .cvsignore, 1.10, 1.11 cyphesis.spec, 1.29, 1.30 sources, 1.10, 1.11
- Next message (by thread): rpms/ember/devel .cvsignore, 1.2, 1.3 ember.spec, 1.7, 1.8 sources, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list