YaST/Web/Installation/Service/FromSource

From openSUSE

(Difference between revisions)
Revision as of 11:43, 11 August 2009
Klaus kaempf (Talk | contribs)

� Previous diff
Revision as of 17:27, 19 August 2009
Jdsn (Talk | contribs)

Next diff →
Line 11: Line 11:
You can browse the repository [http://git.opensuse.org/?p=projects/yast/rest-service.git;a=summary here]. You can browse the repository [http://git.opensuse.org/?p=projects/yast/rest-service.git;a=summary here].
-once you checkout, run the service from the source:+Once you checked out the sources and made sure everything needed is installed and configured and you ran
 +<pre>
 +make install
 +</pre>
 +you can start the service by running
 +<pre>
 +./start.sh
 +</pre>
-==Required packages==+==Required Packages==
Assuming that you're running openSUSE 11.1 for development, do the following: Assuming that you're running openSUSE 11.1 for development, do the following:
Line 19: Line 26:
* Install `''grep 'Requires:' git/dist/yast2-webservice.spec''` from [http://download.opensuse.org/repositories/YaST:/Web/openSUSE_11.1/ http://download.opensuse.org/repositories/YaST:/Web/openSUSE_11.1/] (also check for PreReq:) * Install `''grep 'Requires:' git/dist/yast2-webservice.spec''` from [http://download.opensuse.org/repositories/YaST:/Web/openSUSE_11.1/ http://download.opensuse.org/repositories/YaST:/Web/openSUSE_11.1/] (also check for PreReq:)
* Install ''rubygem-rails'' 2.3 from [http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.1/ http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.1/] * Install ''rubygem-rails'' 2.3 from [http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.1/ http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.1/]
 +
 +For openSUSE 11.1 these calls (as root) should install all needed packages:
<pre> <pre>
-zypper in rubygem-rails-2_3+zypper ar http://download.opensuse.org/repositories/YaST:/Web/openSUSE_11.1 YaST_Web_oS-11.1
 +zypper ar http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.1 devel_languages_ruby_extensions_oS-11.1
 + 
 +zypper in ruby-rpam rubygem-gettext rubygem-sqlite3 ruby-polkit ruby-dbus PolicyKit \
 + rubygem-relevance-rcov ruby-fcgi lighttpd-mod_magnet ruby-dbus sqlite rubygem-rake \
 + rubygem-rails-2_3 rubygem-test-unit
</pre> </pre>
Line 31: Line 45:
rake system_check rake system_check
</pre> </pre>
 +
 +==Fix PolicyKit rights==
 +If some PolicyKit rights are missing you can try this to grant all rights to all available plugins for the user who runs the rest-service.
 +<pre>
 +find rest-service/plugins/ -name "*policy*" -exec cp {} /usr/share/PolicyKit/policy/ \;
 +ruby rest-service/webservice/package policyKit-rights.rb --user <restServiceUser> --action grant
 +</pre>
 +
==Migrate the database== ==Migrate the database==

Revision as of 17:27, 19 August 2009

Contents

Installing the WebYaST Service component

See REST service for technical implementation details. This page is about installing from source.

Download the source code

git clone git://git.opensuse.org/projects/yast/rest-service.git

You can browse the repository here.

Once you checked out the sources and made sure everything needed is installed and configured and you ran

make install

you can start the service by running

./start.sh

Required Packages

Assuming that you're running openSUSE 11.1 for development, do the following:

For openSUSE 11.1 these calls (as root) should install all needed packages:

zypper ar http://download.opensuse.org/repositories/YaST:/Web/openSUSE_11.1 YaST_Web_oS-11.1
zypper ar http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.1  devel_languages_ruby_extensions_oS-11.1

zypper in ruby-rpam rubygem-gettext rubygem-sqlite3 ruby-polkit ruby-dbus PolicyKit \
 rubygem-relevance-rcov ruby-fcgi lighttpd-mod_magnet ruby-dbus sqlite rubygem-rake \
 rubygem-rails-2_3 rubygem-test-unit

Check your system

There is a script to help identify possible problems with the development machine configuration. It will tell you about possible problems you need to solve before running the service as a developer and points to information how to fix the problems.

cd webservice
rake system_check

Fix PolicyKit rights

If some PolicyKit rights are missing you can try this to grant all rights to all available plugins for the user who runs the rest-service.

find rest-service/plugins/ -name "*policy*" -exec cp {} /usr/share/PolicyKit/policy/ \;
ruby rest-service/webservice/package policyKit-rights.rb --user <restServiceUser>  --action grant


Migrate the database

cd webservice
rake db:migrate

Start HTTP server

You have to start a HTTP server, so either you start it as a daemon: rcyastws start or on a commandline with all debugging information and errors available:

 cd webservice
 script/server -p 8080

Once the service is running go to http://localhost:8080 and click on configuration documentation.

Setup permissions

You need to setup PolicyKit if you want to run the service as your current user.

First you need to edit /etc/PolicyKit/PolicyKit.conf to add something like (assuming you are joe):

<match user="joe">
    <match action="org.opensuse.yast.*">
      <return result="yes"/>
    </match>
  </match>
  <match user="joe">
    <match action="org.freedesktop.packagekit.system-update">
      <return result="yes"/>
    </match>
  </match>
  <match user="joe">
    <match action="org.freedesktop.policykit.read">
      <return result="yes"/>
    </match>
  </match>

See Web Server Rights documentation for more details (assuming the webservice is running).

Then, you need to grant permissions for certail roles. See "API Policies" section in the web service configuration documentation.


Fix your system

It may (and probably will) happen that you will get error

 Error loading language plugin /usr/lib64/YaST2/plugin/libpy2lang_ruby.so:
 libpy2wfm.so.2: cannot open shared object file: No such file or directory

The workaround is:

 ln -s /usr/lib/YaST2/plugin/libpy2wfm.so.2 /usr/lib
 (or ln -s /usr/lib64/YaST2/plugin/libpy2wfm.so.2 /usr/lib64 )

For details, see Bug 482762 - web-yast: libpy2lang_ruby.so cannot open libpy2wfm.so.2