rpms/cyphesis/devel cyphesis-0.5.17-init.patch, NONE, 1.1 cyphesis.spec, 1.25, 1.26

Alexey Torkhov atorkhov at fedoraproject.org
Sun Nov 9 12:49:45 UTC 2008


Author: atorkhov

Update of /cvs/pkgs/rpms/cyphesis/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24596

Modified Files:
	cyphesis.spec 
Added Files:
	cyphesis-0.5.17-init.patch 
Log Message:
* Tue Nov 04 2008 Alexey Torkhov <atorkhov at gmail.com> 0.5.17-1
- Update to 0.5.17
- Add patch for libgcrypt proper initialisation
- Specify unix socket path in config without full path so cyphesis could
  be called by regular user. Instead of this, specify it in init script.
- Unit tests actually do the checks


cyphesis-0.5.17-init.patch:

--- NEW FILE cyphesis-0.5.17-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:daemon=true --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" >/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 $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" >/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
 }
 


Index: cyphesis.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cyphesis/devel/cyphesis.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- cyphesis.spec	4 Nov 2008 13:40:43 -0000	1.25
+++ cyphesis.spec	9 Nov 2008 12:49:15 -0000	1.26
@@ -14,7 +14,7 @@
 Source5:        logwatch.script.cyphesis
 Source6:        logwatch.serviceconf.cyphesis
 Source7:        logwatch.shared.applycyphesisdate
-Patch0:         cyphesis-0.5.15-init.patch
+Patch0:         cyphesis-0.5.17-init.patch
 Patch1:         cyphesis-0.5.11-logdir.patch
 Patch3:         cyphesis-0.5.17-sockpath.patch
 Patch4:         cyphesis-0.5.17-gcrypt-init-fix.patch
@@ -41,11 +41,11 @@
 It is the server used in most current WorldForge games.
 
 %package logwatch
-Summary: logwatch scripts for the WorldForge game server
+Summary: Logwatch scripts for the WorldForge game server
 Group: Amusements/Games
 Requires: %{name} = %{version}-%{release} logwatch
 %description logwatch
-logwatch scripts for the WorldForge game server
+Logwatch scripts for the WorldForge game server.
 
 
 %prep
@@ -96,7 +96,8 @@
 mkdir -p %{buildroot}%{_var}/log/%{name}
 mkdir -p %{buildroot}%{_var}/run/%{name}
 
-sed -i -e 's#unixport="#unixport="/var/run/cyphesis/#' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cyphesis.vconf
+# Using parameter when starting cyphesis at init script
+#sed -i -e 's#unixport="#unixport="/var/run/cyphesis/#' $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cyphesis.vconf
 
 
 %check
@@ -167,8 +168,9 @@
 * Tue Nov 04 2008 Alexey Torkhov <atorkhov at gmail.com> 0.5.17-1
 - Update to 0.5.17
 - Add patch for libgcrypt proper initialisation
-- Fix full socket patch to be applicable for command line tools
-- Make tests actually do the checks
+- Specify unix socket path in config without full path so cyphesis could
+  be called by regular user. Instead of this, specify it in init script.
+- Unit tests actually do the checks
 
 * Thu Aug 28 2008 Wart <wart at kobold.org> 0.5.16-3
 - Rebuild for new mercator




More information about the fedora-extras-commits mailing list