[gold-users] Antwort: GOLD init script
Scott Jackson
scottmo at adaptivecomputing.com
Thu Jul 15 11:22:10 MDT 2010
Richard,
Thank you for providing this. I will add your suse sample under contrib
as well (unless you let me know you would prefer I not do this).
Thanks,
Scott
p.s. Here is my patch:
scottmo at mana:/software/gold-3.0$ svn diff
Index: contrib/init.d/gold.sles.in
===================================================================
--- contrib/init.d/gold.sles.in (revision 0)
+++ contrib/init.d/gold.sles.in (revision 0)
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# gold server This script will start and stop the GOLD Server
+#
+### BEGIN INIT INFO
+# Provides: gold
+# Required-Start: $syslog $remote_fs
+# Should-Start:
+# Required-Stop: $syslog $remote_fs
+# Should-Stop: $null
+# Default-Start: 2 3 5
+# Default-Stop:
+# Short-Description: GOLD server
+# Description: GOLD server is an Allocation Manager and acts much like
a bank
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.status
+
+RETVAL=0
+prog="gold"
+export GOLD_HOME=@prefix@
+
+PIDFILE=$GOLD_HOME/etc/$prog.pid
+LOCKFILE=/var/lock/subsys/$prog
+
+#
+# The pathname substitution in daemon command assumes prefix and
+# exec_prefix are same. This is the default, unless the user requests
+# otherwise.
+#
+case "$1" in
+ start)
+ echo -n "Starting $prog: "
+ startproc -u @USER@ $GOLD_HOME/sbin/goldd >/dev/null
+ RETVAL=$?
+ #echo
+ [ $RETVAL -eq 0 ] && touch $LOCKFILE
+ rc_status -v
+ ;;
+ stop)
+ echo -n "Shutting down $prog: "
+ $GOLD_HOME/sbin/goldd -k >/dev/null
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
+ #echo
+ rc_status -v
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ echo -n "Checking for $prog: "
+ checkproc -p $PIDFILE $GOLD_HOME/sbin/goldd
+ rc_status -v
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ RETVAL=1
+ ;;
+esac
+exit $RETVAL
Property changes on: contrib/init.d/gold.sles.in
___________________________________________________________________
Added: svn:executable
+ *
Index: configure.ac
===================================================================
--- configure.ac (revision 205)
+++ configure.ac (working copy)
@@ -178,7 +178,8 @@
etc/goldd.conf.dist
etc/goldg.conf.dist
etc/gold.spec
- etc/gold.d
+ contrib/init.d/gold.redhat
+ contrib/init.d/gold.sles
etc/gold.sh
etc/gold.csh
base.sql
Index: doc/installation.sgml.in
===================================================================
--- doc/installation.sgml.in (revision 205)
+++ doc/installation.sgml.in (working copy)
@@ -819,9 +819,7 @@
</userinput>
</para>
<para>
-Alternatively, if you are on linux system that supports init.d scripts,
-you can add an add gold as a system startup service by copying
etc/gold.d to
-/etc/init.d/gold, giving it execute permission, and then start gold by
issuing:
+Alternatively, if you are on a linux system that supports init.d
scripts, you can create a system startup service for gold. Sample
scripts are provided in contrib/init.d/ that can be edited for your
distribution and installed into /etc/init.d. After adding execute
permissions, Gold can then be started by issuing:
</para>
<para>
<userinput><prompt>[root]# </prompt>
Index: etc/gold.d.in
===================================================================
--- etc/gold.d.in (revision 205)
+++ etc/gold.d.in (working copy)
@@ -1,56 +0,0 @@
-#!/bin/bash
-#
-# chkconfig: 2345 93 7
-# description: gold startup script
-#
-# 1. This file should be installed as /etc/init.d/gold
-#
-# 2. Start gold with:
-#
-# /etc/init.d/gold start
-#
-# Source function library.
-[ -f /etc/rc.d/init.d/functions ] || exit 0
-. /etc/rc.d/init.d/functions
-
-RETVAL=0
-prog="gold"
-export GOLD_HOME=@prefix@
-
-PIDFILE=$GOLD_HOME/etc/$prog.pid
-LOCKFILE=/var/lock/subsys/$prog
-
-#
-# The pathname substitution in daemon command assumes prefix and
-# exec_prefix are same. This is the default, unless the user requests
-# otherwise.
-#
-case "$1" in
- start)
- echo -n "Starting $prog: "
- daemon --user @USER@ $GOLD_HOME/sbin/goldd
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch $LOCKFILE
- ;;
- stop)
- echo -n "Shutting down $prog: "
- $GOLD_HOME/sbin/goldd -k >/dev/null
- RETVAL=$?
- [ $RETVAL -eq 0 ] && rm -f $LOCKFILE && success
- echo
- ;;
- restart)
- $0 stop
- $0 start
- ;;
- status)
- status -p $PIDFILE $GOLD_HOME/sbin/goldd
- RETVAL=$?
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|status}"
- RETVAL=1
- ;;
-esac
-exit $RETVAL
Index: INSTALL.in
===================================================================
--- INSTALL.in (revision 205)
+++ INSTALL.in (working copy)
@@ -446,9 +446,7 @@
[gold] goldd
-Alternatively, if you are on linux system that supports init.d scripts,
-you can add an add gold as a system startup service by copying
etc/gold.d to
-/etc/init.d/gold, giving it execute permission, and then start gold by
issuing:
+Alternatively, if you are on a linux system that supports init.d
scripts, you can create a system startup service for gold. Sample
scripts are provided in contrib/init.d/ that can be edited for your
distribution and installed into /etc/init.d. After adding execute
permissions, Gold can then be started by issuing:
[root] service gold start
RNothdurft at spirit21.de wrote:
> Hi Tavia,
>
> i'm using GOLD on SLES 11 and have rewritten the init script to fit to
> the distro:
>
> #!/bin/bash
> #
> # gold server This script will start and stop the GOLD Server
> #
> ### BEGIN INIT INFO
> # Provides: gold
> # Required-Start: $syslog $remote_fs
> # Should-Start:
> # Required-Stop: $syslog $remote_fs
> # Should-Stop: $null
> # Default-Start: 2 3 5
> # Default-Stop:
> # Short-Description: GOLD server
> # Description: GOLD server is an Allocation Manager and acts much like
> a bank
> ### END INIT INFO
>
> # Source function library.
> #[ -f /etc/rc.d/init.d/functions ] || exit 0
> #. /etc/rc.d/init.d/functions
> . /etc/rc.status
>
> RETVAL=0
> prog="gold"
> export GOLD_HOME=/usr/local/gold
>
> PIDFILE=$GOLD_HOME/etc/$prog.pid
> LOCKFILE=/var/lock/subsys/$prog
>
> #
> # The pathname substitution in daemon command assumes prefix and
> # exec_prefix are same. This is the default, unless the user requests
> # otherwise.
> #
> case "$1" in
> start)
> echo -n "Starting $prog: "
> startproc -u golduser $GOLD_HOME/sbin/goldd >/dev/null
> RETVAL=$?
> #echo
> [ $RETVAL -eq 0 ] && touch $LOCKFILE
> rc_status -v
> ;;
> stop)
> echo -n "Shutting down $prog: "
> $GOLD_HOME/sbin/goldd -k >/dev/null
> RETVAL=$?
> [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
> #echo
> rc_status -v
> ;;
> restart)
> $0 stop
> $0 start
> ;;
> status)
> echo -n "Checking for $prog: "
> checkproc -p $PIDFILE $GOLD_HOME/sbin/goldd
> rc_status -v
> RETVAL=$?
> ;;
> *)
> echo "Usage: $0 {start|stop|restart|status}"
> RETVAL=1
> ;;
> esac
> exit $RETVAL
>
> Kind regards,
> Richard
>
>
> Richard Nothdurft
> DHBW-Student der SPIRIT/21 AG
> Otto-Lilienthal-Str. 36, 71034 Böblingen
> Mobil: 0177/7427024
> E-Mail: rnothdurft at spirit21.de
> Internet: http://www.spirit21.de <http://www.spirit21.de/>
>
>
>
> *Tavia Stone <tavia.stone at stfc.ac.uk>*
> Gesendet von: gold-users-bounces at supercluster.org
>
> 15.07.2010 14:48
> Bitte antworten an
> Gold Users Mailing List <gold-users at supercluster.org>
>
>
>
> An
> gold-users at supercluster.org
> Kopie
>
> Thema
> [gold-users] GOLD init script
>
>
>
>
>
>
>
>
>
> Building GOLD-2.1.12.2 on SuSE 11.1:
>
> Noticed earlier today that the init script 'gold.d' is not written for
> use with SuSE Linux (SuSE doesn't use /etc/rc.d/init.d/functions). Is
> there a restriction on which Linux distro one can build GOLD on? I
> found nothing in the User's Guide to suggest this. Do you have an init
> script written for SuSe that was left out of the source distribution?
>
> Thanks,
> Tavia
> ---------------------------------------
> Tavia Stone
> HPC Systems Administrator
> STFC Daresbury Laboratory
> Phone: +44 (0)1925 603966
> Email: tavia.stone at stfc.ac.uk
>
>
>
>
>
>
> _______________________________________________
> gold-users mailing list
> gold-users at supercluster.org
> http://www.supercluster.org/mailman/listinfo/gold-users
>
>
>
> SPIRIT/21 AG
>
> Sitz der Gesellschaft: Böblingen
> Vorstand: Dietmar Wendt (Vorsitzender), Philipp Steffen, Joachim Gutheil
> Vorsitzender des Aufsichtsrates: Siegfried J. Althaus
> Registergericht: Amtsgericht Stuttgart, Registernummer: HRB 244681
> Umsatzsteuer-Identifikationsnummer: DE 198412560
> ------------------------------------------------------------------------
>
> _______________________________________________
> gold-users mailing list
> gold-users at supercluster.org
> http://www.supercluster.org/mailman/listinfo/gold-users
>
More information about the gold-users
mailing list