Hello community,

here is the log from the commit of package webyast-base-ui.1306 for 
openSUSE:12.1:Update checked in at 2013-02-13 13:50:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1:Update/webyast-base-ui.1306 (Old)
 and      /work/SRC/openSUSE:12.1:Update/.webyast-base-ui.1306.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "webyast-base-ui.1306", Maintainer is ""

Changes:
--------
New Changes file:

--- /dev/null   2013-02-09 11:18:20.872010756 +0100
+++ 
/work/SRC/openSUSE:12.1:Update/.webyast-base-ui.1306.new/webyast-base-ui.changes
    2013-02-13 13:50:33.000000000 +0100
@@ -0,0 +1,1363 @@
+-------------------------------------------------------------------
+Fri Feb  1 11:54:12 UTC 2013 - [email protected]
+
+- removed controller for /hosts path (was accessible for
+  unauthorized users) (CVE-2012-0435) (bnc#792712)
+- 0.2.67
+
+-------------------------------------------------------------------
+Tue Oct 25 10:38:58 UTC 2011 - [email protected]
+
+- replaced fixed path /usr/src/packages/ by RPM_BUILD_DIR
+- 0.2.66 
+
+-------------------------------------------------------------------
+Fri Oct 14 07:47:20 UTC 2011 - [email protected]
+
+- commented tidy out cause it is unstable (bnc#706498)
+- 0.2.65 
+
+-------------------------------------------------------------------
+Wed Oct 12 07:55:31 UTC 2011 - [email protected]
+
+- added rubygem-sass as BuildRequires (broken layout on openSUSE_12.1-beta1)
+- 0.2.64
+
+-------------------------------------------------------------------
+Wed Aug  3 09:16:54 UTC 2011 - [email protected]
+
+- removed buildreq rubygem-sass
+- 0.2.63 
+
+-------------------------------------------------------------------
+Tue Jun 21 10:18:15 UTC 2011 - [email protected]
+
+- fixed fuzzy/unsharp plugin icons on the control panel page
+- 0.2.62
+
+-------------------------------------------------------------------
+Thu Jun 16 11:35:10 UTC 2011 - [email protected]
+
+- updating README
+- 0.2.61 
+
+-------------------------------------------------------------------
+Mon Jun 13 14:23:53 UTC 2011 - [email protected]
+
+- Don't show unescaped blocked user name to prevent XSS attack
+- 0.2.60
+
+-------------------------------------------------------------------
+Mon Jun 13 08:02:48 UTC 2011 - [email protected]
+
+- fix deprecated sass variables syntax
+- 0.2.59
+
+-------------------------------------------------------------------
+Fri Jun 10 09:25:56 UTC 2011 - [email protected]
+
+- [webyast-network-ui] mutated hostname+domain (+ yapi caching) (bnc#694283)
+- WebYaST does not show password strengt (bnc#697353)
+- disabled all javascript console logs in javascript files
+- 0.2.58
+
+-------------------------------------------------------------------
+Tue Jun  7 09:09:32 UTC 2011 - [email protected]
+
+- Updated Czech translations (jsrain)
+- 0.2.57 
+
+-------------------------------------------------------------------
+Mon Jun  6 12:06:35 UTC 2011 - [email protected]
+
+- IE8: Webyast cojntrol panel looks ugly (bnc#692861) 
+- 0.2.56
+
+-------------------------------------------------------------------
+Mon Jun  6 09:44:51 UTC 2011 - [email protected]
+
+- Fixed IE8 bugs
+- 0.2.55 
+
+-------------------------------------------------------------------
+Wed Jun  1 10:53:32 UTC 2011 - [email protected]
+
+- WebYast - The ball icon in green/red which show the status of the machine 
show like a square with IE8 (bnc#697369)
+- Adapted login form style to new WebYaST look
+- 0.2.54
+
+-------------------------------------------------------------------
+Tue May 31 13:08:31 UTC 2011 - [email protected]
+
+- passenger_enabled on; in location of nginx.conf in order
+  to load min javascripts correctly.
+- 0.2.53 
+
+-------------------------------------------------------------------
+Tue May 31 09:04:26 UTC 2011 - [email protected]
+
+- webyast logo shows up when user session got log out automatically 
(bnc#689851)
+- 0.2.52
+
+-------------------------------------------------------------------
+Mon May 30 12:20:47 UTC 2011 - [email protected]
+
+- shutdown lighttpd when we are switching to nginx (bnc#696011)
+- 0.2.51 
+
+-------------------------------------------------------------------
+Fri May 27 09:39:48 UTC 2011 - [email protected]
+
+- WebYast - Filed to link to "Enabling Kerberos Authentication" from help of 
LDAP authentication (bnc#693927)
+- 0.2.50
+
+-------------------------------------------------------------------
+Wed May 25 13:56:31 UTC 2011 - [email protected]
+
+- fixed WebYaST notifier doesn't terminate the running workers after user is 
inactive
+- 0.2.49
+
+-------------------------------------------------------------------
+Wed May 25 10:56:42 UTC 2011 - [email protected]
+
+- uniform look & feel throughout all WebYaST modules 
+- 0.2.48
+
+-------------------------------------------------------------------
+Tue May 24 14:17:20 UTC 2011 - [email protected]
+
+- requires nginx1.0 expl. (needed for autobuild)
+- 0.2.47 
+
+-------------------------------------------------------------------
+Thu May 19 12:03:13 UTC 2011 - [email protected]
+
+- Rotating indicator signalling activity while performing action only seldom 
moves (bnc#694224)
+- 0.2.46
+
+-------------------------------------------------------------------
+Thu May 19 10:01:58 UTC 2011 - [email protected]
+
+- adapted hostname validation rules in order to accomplish RFC-952 and 
RFC-1123 requirements (bnc#694283)
+- 0.2.45
+
+-------------------------------------------------------------------
+Wed May 18 14:36:47 UTC 2011 - [email protected]
+
+- enabled nginx gzip comperssion for static components
+- added expires headers for static components
+- optimized WebYaST UI (YSlow)
+- improved frequently used modules script 
+- 0.2.44
+
+-------------------------------------------------------------------
+Wed May 18 11:24:28 UTC 2011 - [email protected]
+
+- enable polling for more than one model (string which contains
+  model name seperated by ,). This is needed for (bnc#693928)
+- 0.2.43 
+
+-------------------------------------------------------------------
+Tue May 17 10:04:05 UTC 2011 - [email protected]
+
+- replaced old tango icons through monochrome icons designed by etrounev
+- minor layout adaptation
+- fixed tipsy offset issue
+- 0.2.42 
+
+-------------------------------------------------------------------
+Mon May 16 09:17:39 UTC 2011 - [email protected]
+
+- replaced webyast module icons
+- adapted layout
+- renamed the license
+- 0.2.41
+
+-------------------------------------------------------------------
+Fri May 13 13:31:15 UTC 2011 - [email protected]
+
+- corrected spelling mistakes in passwordStrength meter script
+- added quick sand script to be included if JSMIN is set to false
+- 0.2.40 
+
+-------------------------------------------------------------------
+Thu May 12 14:26:20 UTC 2011 - [email protected]
+
+- "Recently used modules" displayed in Webyast after first login (bnc#692851)
+- 0.2.39
+
+-------------------------------------------------------------------
+Thu May 12 09:27:46 UTC 2011 - [email protected]
+
+- fixed Copyright of WebYaST should be "2009-2011" (bnc#691874)
+- 0.2.38
+
+-------------------------------------------------------------------
+Thu May 12 08:30:31 UTC 2011 - [email protected]
+
++++ 1166 more lines (skipped)
++++ between /dev/null
++++ and 
/work/SRC/openSUSE:12.1:Update/.webyast-base-ui.1306.new/webyast-base-ui.changes

New:
----
  control_panel.yml
  nginx.conf
  webyast-base-ui.changes
  webyast-base-ui.spec
  webyast-ui
  webyast-ui.lr.conf
  www.tar.bz2
  yastwc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ webyast-base-ui.spec ++++++
#
# spec file for package webyast-base-ui
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           webyast-base-ui
Recommends:     WebYaST(org.opensuse.yast.modules.basesystem)
# bnc#634404
Recommends:     logrotate
Provides:       yast2-webclient = %{version}
Obsoletes:      yast2-webclient < %{version}
Requires:       check-create-certificate
Requires:       ruby-fcgi
Requires:       sqlite
Requires:       syslog-ng
Requires:       webyast-branding
PreReq:         rubygem-rake, rubygem-sqlite3
PreReq:         rubygem-rails-2_3 >= 2.3.8
PreReq:         rubygem-gettext_rails
PreReq:         yast2-runlevel
Provides:       webyast-language-ui = 0.1.2
Obsoletes:      webyast-language-ui <= 0.1.2

%if 0%{?suse_version} == 0 || %suse_version > 1110
# 11.2 or newer

%if 0%{?suse_version} > 1120
# since 11.3, they are in a separate subpackage
Requires:       sysvinit-tools
%else
# Require startproc respecting -p, bnc#559534#c44
Requires:       sysvinit > 2.86-215.2
%endif
%else
# 11.1 or SLES11
Requires:       sysvinit > 2.86-195.3.1
%endif
Requires:       nginx >= 1.0
Requires:       rubygem-nokogiri
Requires:       rubygem-passenger-nginx

Url:            http://en.opensuse.org/Portal:WebYaST
Version:        0.2.67
Release:        0
Summary:        WebYaST - base UI for system management
License:        LGPL-2.1 ; Apache-2.0
Group:          Productivity/Networking/Web/Utilities
Source:         www.tar.bz2
Source2:        yastwc
Source4:        webyast-ui
Source5:        control_panel.yml
Source6:        webyast-ui.lr.conf
Source7:        nginx.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  ruby
BuildRequires:  rubygem-gettext_rails
BuildRequires:  rubygem-haml
BuildRequires:  rubygem-nokogiri
BuildRequires:  rubygem-rails-2_3 >= 2.3.8
BuildRequires:  rubygem-selenium-client
BuildRequires:  rubygem-sqlite3
BuildRequires:  rubygem-yast2-webservice-tasks
BuildRequires:  sqlite
BuildRequires:  tidy
BuildArch:      noarch
BuildRequires:  nginx >= 1.0
BuildRequires:  rubygem-mocha
BuildRequires:  rubygem-passenger-nginx
BuildRequires:  rubygem-test-unit
%if 0%{?suse_version} <= 1130
# since 12*, sass conflicts with haml
BuildRequires:  rubygem-sass
%endif
#

%description
WebYaST - Provides core web client for WebYaST service.
Without plugins has only very limited configuration options.

Authors:
--------
    Duncan Mac-Vicar Prett <[email protected]>
    Bjoern Geuken <[email protected]>
    Stefan Schubert <[email protected]>
    Klaus Kaempf <[email protected]>
    Josef Reidinger <[email protected]>

%package testsuite
Requires:       %{name} = %{version}
Requires:       rubygem-mocha
Requires:       rubygem-test-unit
Requires:       tidy
Summary:        Testsuite for webyast-base-ui package
Group:          Productivity/Networking/Web/Utilities

%description testsuite
This package contains complete testsuite for webyast-base-ui package.
It is only needed for verifying the functionality of the package
and it is not needed at runtime.

%package branding-default
Provides:       webyast-branding
Requires:       %{name} = %{version}
#Requires: rubygem-mocha rubygem-test-unit tidy
Summary:        Branding package for webyast-base-ui package
Group:          Productivity/Networking/Web/Utilities

%description branding-default
This package contains css, icons and images for webyast-base-ui package.

%prep
%setup -q -n www

%build
env LANG=en rake makemo
rake sass:update
rake js:base
rm -r app/sass

%check
# run the testsuite
RAILS_ENV=test rake db:migrate
RAILS_ENV=test rake test

%install

#
# Install all web and frontend parts.
#
mkdir -p $RPM_BUILD_ROOT/%{webyast_ui_dir}/log
mkdir -p $RPM_BUILD_ROOT/%{webyast_ui_dir}/tmp
cp -a * $RPM_BUILD_ROOT/%{webyast_ui_dir}
rm -rf $RPM_BUILD_ROOT/%{webyast_ui_dir}/log/*
rm -rf $RPM_BUILD_ROOT/%{webyast_ui_dir}/po
rm -f $RPM_BUILD_ROOT/%{webyast_ui_dir}/COPYING

#
# init script
#
%{__install} -d -m 0755                            \
    %{buildroot}%{_sbindir}

%{__install} -D -m 0755 %SOURCE2 \
    %{buildroot}%{_sysconfdir}/init.d/%{webyast_ui_service}
%{__ln_s} -f %{_sysconfdir}/init.d/%{webyast_ui_service} 
%{buildroot}%{_sbindir}/rc%{webyast_ui_service}
#

# configure lighttpd/nginx web service
mkdir -p $RPM_BUILD_ROOT/etc/lighttpd/certs

# configure nginx web service
mkdir -p $RPM_BUILD_ROOT/etc/yastwc/
install -m 0644 %SOURCE7 $RPM_BUILD_ROOT/etc/yastwc/
# create symlinks to nginx config files
ln -s /etc/nginx/fastcgi.conf $RPM_BUILD_ROOT/etc/yastwc
ln -s /etc/nginx/fastcgi_params $RPM_BUILD_ROOT/etc/yastwc
ln -s /etc/nginx/koi-utf $RPM_BUILD_ROOT/etc/yastwc
ln -s /etc/nginx/koi-win $RPM_BUILD_ROOT/etc/yastwc
ln -s /etc/nginx/mime.types $RPM_BUILD_ROOT/etc/yastwc
ln -s /etc/nginx/scgi_params $RPM_BUILD_ROOT/etc/yastwc
ln -s /etc/nginx/uwsgi_params $RPM_BUILD_ROOT/etc/yastwc
ln -s /etc/nginx/win-utf $RPM_BUILD_ROOT/etc/yastwc

# firewall service definition, bnc#545627
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services
install -m 0644 %SOURCE4 $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services

# logrotate configuration bnc#634404
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -m 0644 %SOURCE6 $RPM_BUILD_ROOT/etc/logrotate.d

#  create empty tmp directory
mkdir -p $RPM_BUILD_ROOT/%{webyast_ui_dir}/tmp
mkdir -p $RPM_BUILD_ROOT/%{webyast_ui_dir}/tmp/cache
mkdir -p $RPM_BUILD_ROOT/%{webyast_ui_dir}/tmp/pids
mkdir -p $RPM_BUILD_ROOT/%{webyast_ui_dir}/tmp/sessions
mkdir -p $RPM_BUILD_ROOT/%{webyast_ui_dir}/tmp/sockets

# install YAML config file
mkdir -p $RPM_BUILD_ROOT/etc/webyast/
cp %SOURCE5 $RPM_BUILD_ROOT/etc/webyast/

#create dummy update-script
mkdir -p %buildroot/var/adm/update-scripts
touch %buildroot/var/adm/update-scripts/%name-%version-%release-1

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# services will not be restarted correctly if
# the package name will changed while the update
# So the service will be restarted by an update-script
# which will be called AFTER the installation
if /bin/rpm -q yast2-webclient > /dev/null ; then
  echo "renaming yast2-webclient to webyast-base-ui"
  if /sbin/yast runlevel summary service=yastwc 2>&1|grep " 3 "|grep yastwc 
>/dev/null ; then
    echo "yastwc is inserted into the runlevel"
    echo "#!/bin/sh" > %name-%version-%release-1
    echo "/sbin/yast runlevel add service=yastwc" >> %name-%version-%release-1
    echo "/usr/sbin/rcyastwc restart" >> %name-%version-%release-1
  else
    if /usr/sbin/rcyastwc status > /dev/null ; then
      echo "yastwc is running"
      echo "#!/bin/sh" > %name-%version-%release-1
      echo "/usr/sbin/rcyastwc restart" >> %name-%version-%release-1
    fi
  fi
fi
#We are switching from lighttpd to nginx. So lighttpd has to be killed
#at first
if rpm -q --requires %{name}|grep lighttpd > /dev/null ; then
  if /usr/sbin/rcyastwc status > /dev/null ; then
    echo "yastws is running under lighttpd -> switching to nginx"
    /usr/sbin/rcyastwc stop > /dev/null
    echo "#!/bin/sh" > %name-%version-%release-1
    echo "/usr/sbin/rcyastwc restart" >> %name-%version-%release-1
  fi
fi
if [ -f %name-%version-%release-1 ] ; then
  install -D -m 755 %name-%version-%release-1 /var/adm/update-scripts
  rm %name-%version-%release-1
  echo "Please check the service runlevels and restart WebYaST client with 
\"rcyastwc restart\" if the update has not been called with zypper,yast or 
packagekit"
fi
exit 0

%post
%fillup_and_insserv %{webyast_ui_service}

#
# create database
#
cd %{webyast_ui_dir}
RAILS_ENV=production rake db:migrate
chgrp %{webyast_ui_user} db db/*.sqlite* log log/*
chown %{webyast_ui_user} db db/*.sqlite* log log/*
chmod 700 log
chmod 755 db
chmod 600 db/*.sqlite* log/*

%preun
%stop_on_removal %{webyast_ui_service}

%postun
%restart_on_update %{webyast_ui_service}
%{insserv_cleanup}

# restart yastwc on nginx update (bnc#559534)

%triggerin -- nginx
%restart_on_update %{webyast_ui_service}

%files
%defattr(-,root,root)
%dir /etc/yastwc
%dir %{webyast_ui_dir}
%{webyast_ui_dir}/locale
%{webyast_ui_dir}/vendor
%{webyast_ui_dir}/app
%{webyast_ui_dir}/db
%{webyast_ui_dir}/doc
%{webyast_ui_dir}/lib
%{webyast_ui_dir}/public
%{webyast_ui_dir}/Rakefile
%{webyast_ui_dir}/README*
%{webyast_ui_dir}/INSTALL
%{webyast_ui_dir}/script
%{webyast_ui_dir}/config
%config %{webyast_ui_dir}/config/initializers/session_store.rb
%{webyast_ui_dir}/start.sh
%doc README* COPYING
%attr(-,%{webyast_ui_user},%{webyast_ui_user}) %{webyast_ui_dir}/log
%attr(-,%{webyast_ui_user},%{webyast_ui_user}) %{webyast_ui_dir}/tmp
%attr(-,%{webyast_ui_user},root) %{webyast_ui_dir}/public/javascripts
%config /etc/sysconfig/SuSEfirewall2.d/services/webyast-ui
%dir /etc/lighttpd
%dir /etc/lighttpd/certs
%config %{_sysconfdir}/init.d/%{webyast_ui_service}
%{_sbindir}/rc%{webyast_ui_service}
%dir /etc/webyast/
%config /etc/webyast/control_panel.yml

#nginx stuff
%config(noreplace) /etc/yastwc/nginx.conf
%config /etc/yastwc/fastcgi.conf
%config /etc/yastwc/fastcgi_params
%config /etc/yastwc/koi-utf
%config /etc/yastwc/koi-win
%config /etc/yastwc/mime.types
%config /etc/yastwc/scgi_params
%config /etc/yastwc/uwsgi_params
%config /etc/yastwc/win-utf

#logrotate configuration file
%config(noreplace) /etc/logrotate.d/webyast-ui.lr.conf

### exclude css, icons and images
%exclude %{webyast_ui_dir}/public/stylesheets
%exclude %{webyast_ui_dir}/public/icons
%exclude %{webyast_ui_dir}/public/images

%ghost %attr(755,root,root) /var/adm/update-scripts/%name-%version-%release-1

%files testsuite
%defattr(-,root,root)
%{webyast_ui_dir}/test

%files branding-default
%defattr(-,root,root)
### include css, icons and images
%{webyast_ui_dir}/public/stylesheets
%{webyast_ui_dir}/public/icons
%{webyast_ui_dir}/public/images

%changelog
++++++ control_panel.yml ++++++
# This is a config file for WebYaST control center
#
# The file needs to be located under /etc/webyast/ or /etc/webyast/vendor/
# (the 'vendor' directory has higher priority).

--- 
# timeout before automatic reloading of patches status (in seconds)
# value 0 disables automatic reload
# default: 28800 seconds = 8 hours
patch_status_timeout: 28800

# timeout before automatic reloading of patches status (in seconds)
# value 0 disables automatic reload
# default: 300 seconds = 5 minutes
system_status_timeout: 300

# display patches status in the status header
# default: true
display_patch_status: true

# display system status in the status header
# default: true
display_system_status: true

# label shown at the top of each page
appliance_label: _("My Appliance")
++++++ nginx.conf ++++++

user  nginx nginx;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        /var/run/yastwc.pid;


events {
    worker_connections  1024;
}


http {
    # Note: passenger_root option is automatically updated by
    # /etc/init.d/yastwc script at start up
    passenger_root /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.1;
    passenger_ruby /usr/bin/ruby;
    passenger_pool_idle_time 300;
    passenger_min_instances 0;
    passenger_default_user nginx;
    passenger_user nginx;
    passenger_max_pool_size 1;
    passenger_max_instances_per_app 1;
    passenger_spawn_method conservative;

    client_body_temp_path  /var/lib/nginx/tmp_yastwc 1 2;
    fastcgi_temp_path  /var/lib//nginx/fastcgi_yastwc 1 2;
    proxy_temp_path  /var/lib//nginx/proxy_yastwc 1 2;

    include       mime.types;
    default_type  application/octet-stream;

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip              on;
    gzip_static       on;
    gzip_buffers      16 8k;
    gzip_comp_level   9;
    gzip_http_version 1.0;
    gzip_proxied      any;
    gzip_min_length   0; 
    gzip_types        text/plain text/css image/x-icon image/png image/gif 
image/jpeg application/x-javascript text/javascript;
    gzip_vary         on;


    server {
      listen 54984;
      server_name 0.0.0.0;
      root /srv/www/yast/public;
      passenger_enabled on;
      rails_framework_spawner_idle_time 300;
      rails_app_spawner_idle_time 300;
      ssl                  on;
      ssl_certificate      /etc/lighttpd/certs/webyast.pem;
      ssl_certificate_key  /etc/lighttpd/certs/webyast.key;

      ssl_session_timeout  5m;
      ssl_protocols TLSv1;
      ssl_ciphers ALL:!aNULL:!eNULL:!SSLv2:!LOW:!EXP:!MD5:@STRENGTH;
      ssl_prefer_server_ciphers   on;

      location ~* \.(png|gif|jpg|jpeg|css|js|swf|ico)(\?[0-9]+)?$ {
        passenger_enabled on;
        access_log off;
        expires max;
        add_header Cache-Control public;
      }
    }

}
++++++ webyast-ui ++++++
# SuSEfirewall2 service definition
## Name: WebYaST UI
## Description: The front end of WebYaST, http://en.opensuse.org/WebYaST

# space separated list of allowed TCP ports
TCP="54984"
++++++ webyast-ui.lr.conf ++++++
/srv/www/yast/log/production.log /srv/www/yast/log/development.log 
/var/log/nginx/error.log /var/log/nginx/access.log {
    compress
    dateext
    maxage 365
    rotate 99
    size=+4096k
    notifempty
    missingok
    create 600 nginx nginx
    postrotate
     /etc/init.d/yastwc reload
    endscript
}

++++++ yastwc ++++++
#!/bin/sh
#
#     Copyright (C) 1995--2007  Marcus Rückert, SUSE / Novell Inc.
#          
#     This library is free software; you can redistribute it and/or modify it
#     under the terms of the GNU Lesser General Public License as published by
#     the Free Software Foundation; either version 2.1 of the License, or (at
#     your option) any later version.
#                             
#     This library is distributed in the hope that it will be useful, but
#     WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#     Lesser General Public License for more details.
#      
#     You should have received a copy of the GNU Lesser General Public
#     License along with this library; if not, write to the Free Software
#     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
#     USA.
#
# /etc/init.d/yastwc
#   and its symbolic link
# /(usr/)sbin/rcyastwc
#
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
# 
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
# UnitedLinux/SUSE/Novell based Linux distributions. If you want to base your
# script on this template and ensure that it works on non UL based LSB 
# compliant Linux distributions, you either have to provide the rc.status
# functions from UL or change the script to work without them.
# See skeleton.compat for a template that works with other distros as well.
#
### BEGIN INIT INFO
# Provides:          yastwc
# Required-Start:    $syslog $remote_fs
# Should-Start: $time ypbind sendmail
# Required-Stop:     $syslog $remote_fs
# Should-Stop: $time ypbind sendmail
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: yastwc
# Description:       Start yastwc
### END INIT INFO
# 
# Any extensions to the keywords given above should be preceeded by 
# X-VendorTag- (X-UnitedLinux- X-SuSE- for us) according to LSB.
# 
# Notes on Required-Start/Should-Start:
# * There are two different issues that are solved by Required-Start
#    and Should-Start
# (a) Hard dependencies: This is used by the runlevel editor to determine
#     which services absolutely need to be started to make the start of
#     this service make sense. Example: nfsserver should have
#     Required-Start: $portmap
#     Also, required services are started before the dependent ones.
#     The runlevel editor will warn about such missing hard dependencies
#     and suggest enabling. During system startup, you may expect an error,
#     if the dependency is not fulfilled.
# (b) Specifying the init script ordering, not real (hard) dependencies.
#     This is needed by insserv to determine which service should be
#     started first (and at a later stage what services can be started
#     in parallel). The tag Should-Start: is used for this.
#     It tells, that if a service is available, it should be started
#     before. If not, never mind.
# * When specifying hard dependencies or ordering requirements, you can 
#   use names of services (contents of their Provides: section)
#   or pseudo names starting with a $. The following ones are available
#   according to LSB (1.1):
#       $local_fs               all local file systems are mounted
#                               (most services should need this!)
#       $remote_fs              all remote file systems are mounted
#                               (note that /usr may be remote, so
#                                many services should Require this!)
#       $syslog                 system logging facility up
#       $network                low level networking (eth card, ...)
#       $named                  hostname resolution available
#       $netdaemons             all network daemons are running
#   The $netdaemons pseudo service has been removed in LSB 1.2.
#   For now, we still offer it for backward compatibility.
#   These are new (LSB 1.2):
#       $time                   the system time has been set correctly  
#       $portmap                SunRPC portmapping service available
#   UnitedLinux extensions:
#       $ALL                    indicates that a script should be inserted
#                               at the end
# * The services specified in the stop tags 
#   (Required-Stop/Should-Stop)
#   specify which services need to be still running when this service
#   is shut down. Often the entries there are just copies or a subset 
#   from the respective start tag.
# * Should-Start/Stop are now part of LSB as of 2.0,
#   formerly SUSE/Unitedlinux used X-UnitedLinux-Should-Start/-Stop.
#   insserv does support both variants.
# * X-UnitedLinux-Default-Enabled: yes/no is used at installation time
#   (%fillup_and_insserv macro in %post of many RPMs) to specify whether
#   a startup script should default to be enabled after installation.
#   It's not used by insserv.
#
# Note on runlevels:
# 0 - halt/poweroff                     6 - reboot
# 1 - single user                       2 - multiuser without network exported
# 3 - multiuser w/ network (text mode)  5 - multiuser w/ network and X11 (xdm)
# 
# Note on script names:
# http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/scrptnames.html
# A registry has been set up to manage the init script namespace.
# http://www.lanana.org/
# Please use the names already registered or register one or use a
# vendor prefix.


# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
NGINX_BIN=/usr/sbin/nginx
test -x $NGINX_BIN || { echo "$NGINX_BIN not installed"; 
        if [ "$1" = "stop" ]; then exit 0;
        else exit 5; fi; }

# Check for existence of needed config file and read it
NGINX_CONFIG=/etc/yastwc/nginx.conf
test -r $NGINX_CONFIG || { echo "$NGINX_CONFIG not existing";
        if [ "$1" = "stop" ]; then exit 0;
        else exit 6; fi; }

PID_FILE=/var/run/yastwc.pid

CERTIFICATEFILE=/etc/lighttpd/certs/webyast.pem
CERTKEYFILE=/etc/lighttpd/certs/webyast.key
COMBINEDCERTFILE=/etc/lighttpd/certs/webyast-combined.pem

# Source LSB init functions
# providing start_daemon, killproc, pidofproc, 
# log_success_msg, log_failure_msg and log_warning_msg.
# This is currently not used by UnitedLinux based distributions and
# not needed for init scripts for UnitedLinux only. If it is used,
# the functions from rc.status should not be sourced or used.
#. /lib/lsb/init-functions

# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     be verbose in local rc status and clear it afterwards
#      rc_status -v -r  ditto and clear both the local and overall rc status
#      rc_status -s     display "skipped" and exit with status 3
#      rc_status -u     display "unused" and exit with status 3
#      rc_failed        set local and overall rc status to failed
#      rc_failed <num>  set local and overall rc status to <num>
#      rc_reset         clear both the local and overall rc status
#      rc_exit          exit appropriate to overall rc status
#      rc_active        checks whether a service is activated by symlinks
. /etc/rc.status

# Reset status of this service
rc_reset

# Return values acc. to LSB for all commands but status:
# 0       - success
# 1       - generic or unspecified error
# 2       - invalid or excess argument(s)
# 3       - unimplemented feature (e.g. "reload")
# 4       - user had insufficient privileges
# 5       - program is not installed
# 6       - program is not configured
# 7       - program is not running
# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
# 
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.

case "$1" in
    start)
    if [ ! -e  $COMBINEDCERTFILE ]
    then
        echo "No certificate found. Creating one now."
        if ! /usr/sbin/check-create-certificate -c -C $CERTIFICATEFILE -K 
$CERTKEYFILE -B $COMBINEDCERTFILE -D webyast -O WebYaST -U WebYaST 
>/srv/www/yast/log/check-create-certificate.log 2>&1
        then
            echo -n "Can not create certificate. Please see 
/srv/www/yast/log/check-create-certificate.log for details."
            rc_failed
            rc_status -v
            rc_exit
        fi
        chown nginx:nginx $CERTIFICATEFILE $CERTKEYFILE $COMBINEDCERTFILE
    fi

       echo -n "Starting yastwc "
  #generate deployment specific secret key (bnc#591345)
  SECRET=`cd /srv/www/yast/ && rake -s secret`
  if [ -z $SECRET ]; then
    echo -n "Can generate secret for session. Run 'cd /srv/www/yast/ && rake -s 
secret' for details."
    rc_failed
    rc_status -v
    rc_exit
  fi
  sed -i 
's/f05944f2fa89ced61528d66622c2f5f4dded5912a1276890d2907d012c416f3a32f22dbd22f24614346c1360380dbf71a6fcbbc0e32b2d0cc6812afc623d6c41/'"$SECRET"/
 /srv/www/yast/config/initializers/session_store.rb

        # patch passenger config root if the current config is different (after 
updating passenger or on a different arch than the default)
        grep -q "^[ \\t]*passenger_root[ \\t][ \\t]*`passenger-config --root`;" 
$NGINX_CONFIG ||
            sed -i.bak "s#^\\([ \\t]*\\)passenger_root[ 
\\t].*\$#\\1passenger_root `passenger-config --root`;#" $NGINX_CONFIG

        ## Start daemon with startproc(8). If this fails
        ## the return value is set appropriately by startproc.
        /sbin/startproc -p $PID_FILE $NGINX_BIN -c $NGINX_CONFIG

        # Remember status and be verbose
        rc_status -v

       # print the URL of the server
        if test "$?" -eq 0; then
            IFC=`LC_ALL=C route | grep "^default" | tr -s " " | cut -d " " -f 8`
            IP=`LC_ALL=C ifconfig $IFC | grep "inet addr" | cut -d ":" -f 2 | 
cut -d " " -f 1`
            PORT=`LC_ALL=C grep "listen" $NGINX_CONFIG|cut -d ";" -f 1|tr -s " 
"|cut -d " " -f 3`
            if [ -n "$IP" ]; then
                echo -e "\t${done}The WebYaST client service is running at 
https://$IP:$PORT/${norm}\n";
            else
                echo -e "\t${warn}WebYaST could not determine the IP address 
for $IFC${norm}\n"
            fi
        fi

        ;;
    stop)
        echo -n "Shutting down yastwc "
        ## Stop daemon with killproc(8) and if this fails
        ## killproc sets the return value according to LSB.

        /sbin/killproc -TERM -p $PID_FILE $NGINX_BIN

        # Remember status and be verbose
        rc_status -v
        ;;
    try-restart|condrestart)
        ## Do a restart only if the service was active before.
        ## Note: try-restart is now part of LSB (as of 1.9).
        ## RH has a similar command named condrestart.
        if test "$1" = "condrestart"; then
                echo "${attn} Use try-restart ${done}(LSB)${attn} rather than 
condrestart ${warn}(RH)${norm}"
        fi
        $0 status
        if test $? = 0; then
                $0 restart
        else
                rc_reset        # Not running is not a failure.
        fi
        # Remember status and be quiet
        rc_status
        ;;
    restart)
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 stop
        $0 start

        # Remember status and be quiet
        rc_status
        ;;
    force-reload)
        ## Signal the daemon to reload its config. Most daemons
        ## do this on signal 1 (SIGHUP).
        ## If it does not support it, restart the service if it
        ## is running.

        echo -n "Reload service yastwc "
        ## if it supports it:
        /sbin/killproc -p $PID_FILE -HUP $NGINX_BIN
        rc_status -v

        ## Otherwise:
        #$0 try-restart
        #rc_status
        ;;
    reload)
        ## Like force-reload, but if daemon does not support
        ## signaling, do nothing (!)

        # If it supports signaling:
        echo -n "Reload service yastwc "
        /sbin/killproc -HUP -p $PID_FILE $NGINX_BIN
        #touch /var/run/yastwc.pid
        rc_status -v
        
        ## Otherwise if it does not support reload:
        #rc_failed 3
        #rc_status -v
        ;;
    status)
        echo -n "Checking for service yastwc "
        ## Check status with checkproc(8), if process is running
        ## checkproc will return with exit status 0.

        # Return value is slightly different for the status command:
        # 0 - service up and running
        # 1 - service dead, but /var/run/  pid  file exists
        # 2 - service dead, but /var/lock/ lock file exists
        # 3 - service not running (unused)
        # 4 - service status unknown :-(
        # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
        
        # NOTE: checkproc returns LSB compliant status values.
        /sbin/checkproc -p $PID_FILE $NGINX_BIN
        # NOTE: rc_status knows that we called this init script with
        # "status" option and adapts its messages accordingly.
        rc_status -v
        ;;
    probe)
        ## Optional: Probe for the necessity of a reload, print out the
        ## argument to this init script which is required for a reload.
        ## Note: probe is not (yet) part of LSB (as of 1.9)

        test $NGINX_CONFIG /var/run/yastwc.pid && echo reload
        ;;
    *)
        echo "Usage: $0 
{start|stop|status|try-restart|restart|force-reload|reload|probe}"
        exit 1
        ;;
esac
rc_exit
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to