Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#26 Patch for webkit start/stop-script (2)

closed-fixed
WebKit (45)
1
2005-10-27
2002-05-29
Uli Fouquet
No

This is the same webkit patch as announced in the other
patch remark with the patch file 'inline' (see below).

The webkit script shipped with the webware 0.7 package
may be fine for Red Hat and other distributions or
Unices. Anyway, to let SuSE Linux start WebKit at
bootup, there had some modifications to be made. This
patch includes this modifications. The patched version
of webkit checks whether the current system is a SuSE
Linux and modifies its behaviour during
bootup/shutdown.

Furthermore it creates an entry in SuSEs standard
configuration file and creates a link
/usr/sbin/rcwebkit if it is missing.

Some minor changes on the webkit script were done as
well.

Serveral things this script can do during bootup should
be done during installation of the package and may be
triggered by other scripts than this one.

Applying this patch makes sense for SuSE Linux users
only!

To INSTALL:
-copy the patch to your WebWare/WebKit/ directory.
-enter
patch webkit < webkit.patch
from the commandline.
-as user root do the following:
- copy webkit to /et c/init.d/
- enter
insserv webkit
Note, that this is different to the procedure in Red
Hat.
- run webkit by typing
webkit start
That's it. Here is the patch:

9a10,18
> # This part is for SuSE Linux distributions
> ### BEGIN INIT INFO
> # Provides: webkit
> # Required-Start: apache
> # Required-Stop: $local_fs $network $remote_fs
$syslog $netdaemons
> # Default-Start: 3 5
> # Default-Stop: 0 1 2 6
> # Description: Start WebKit, a Python application
server, part of Webware
> ### END INIT INFO
16c25,27
< PYTHONPATH=
---
> PYTHONPATH=/usr/bin/python
>
> SUSE_RC_CONFIG="/etc/rc.config"
19a31
> is_SuSE="no"
21,26c33,90
< # Source function library.
< # Use the funtions provided by Red Hat or use our own
< if [ -f /etc/rc.d/init.d/functions ]
< then
< . /etc/rc.d/init.d/functions
< else
---
> # /etc/rc.config is the main configuration file for
SuSE
> if test -f "$SUSE_RC_CONFIG" ; then
>
> # Okay, this seems to be a SuSE-distribution
>
> #
> # load the configuration
> #
> . /etc/rc.config
> . /etc/rc.status
>
> # Is there an entry for WebWare in the SuSE main
configuration file?
> if test -z "$START_WEBWARE"; then
> if test -w "$SUSE_RC_CONFIG"; then
> echo -n "No entry for WebWare in rc.config.
Creating one."
> echo >> "$SUSE_RC_CONFIG"
> echo "#" >> "$SUSE_RC_CONFIG"
> echo "# WebKit is a Python application server
and part of Webware." >> "$SUSE_RC_CONFIG"
> echo "# Should the WebWare application server be
started at bootup? (yes/no)" >> "$SUSE_RC_CONFIG"
> echo "#" >> "$SUSE_RC_CONFIG"
> echo "START_WEBWARE=\"yes\"" >>
"$SUSE_RC_CONFIG"
> echo -e "$rc_done"
> else
> echo -n "$SUSE_RC_CONFIG is not writable."
> echo -e "$rc_failed"
> fi
> START_WEBWARE="yes";
> fi
>
> # Is there an link rcwebkit in /usr/sbin?
> if test ! -x /usr/sbin/rcwebkit; then
> echo -n "Creating link to start/stop script."
> if /bin/ln -s ../../etc/init.d/webkit
/usr/sbin/rcwebkit ; then
> echo -e "$rc_done"
> echo "You can start/stop WebWare now by using
rcwebkit as root"
> else
> echo -e "$rc_failed"
> fi
> fi
>
> #
> # Determine the base and follow a runlevel link
name.
> #
> base=${0##*/}
> link=${base#*[SK][0-9][0-9]}
>
>
> #
> # The echo return value for success (defined in
/etc/rc.config).
> #
> return=$rc_done
>
>
> # Force execution if not called by a runlevel
directory.
> test $link = $base && START_WEBWARE=yes
> test "$START_WEBWARE" = yes || exit 0
>
> # Redefine functions...
33c97
< echo -n "Success"
---
> echo -e "$rc_done"
36c100
< echo -n "Failed"
---
> echo -e "$rc_failed"
38d101
< fi
39a103,130
> # Set a flag
> is_SuSE="yes"
>
> else
>
> # This section is for non-SuSE distributions
> # (i.e. Red Hat or other Unix)
>
> # Source function library.
> # Use the funtions provided by Red Hat or use our
own
> if [ -f /etc/rc.d/init.d/functions ]
> then
> . /etc/rc.d/init.d/functions
> else
> function action {
> echo "$1"
> shift
> $@
> }
> function success {
> echo -n "Success"
> }
> function failure {
> echo -n "Failed"
> }
>
> fi
> fi
85,86c176
< $0 stop
< $0 start
---
> $0 stop && sleep 2 && $0 start || failure "Could
not restart WebKit"

Discussion

  • Uli Fouquet
    Uli Fouquet
    2002-05-29

    webkit patch

     
    Attachments
  • Uli Fouquet
    Uli Fouquet
    2002-05-29

    • priority: 5 --> 1
     
  • Logged In: YES
    user_id=193957

    I have replaced the (RedHat) startscript with a folder
    containing start scripts for various flavors of Unix, like
    SuSE, RedHat, Debian or NetBSD, plus a generic script that
    should work with most other Unixes like Solaris.

     
    • assigned_to: nobody --> cito
    • status: open --> closed-fixed