YaST/Web/Installation/Service/FromSource
From openSUSE
| Revision as of 13:25, 8 September 2009 BenniBrunner (Talk | contribs) Fix PolicyKit rights � Previous diff |
Current revision Mschmidkunz (Talk | contribs) Required Packages |
||
| Line 32: | Line 32: | ||
| zypper ar http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.1 devel_languages_ruby_extensions_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 \ | + | zypper in ruby-rpam rubygem-gettext rubygem-gettext_activerecord rubygem-gettext_rails \ |
| - | rubygem-relevance-rcov ruby-fcgi lighttpd-mod_magnet ruby-dbus sqlite rubygem-rake \ | + | rubygem-locale rubygem-locale_rails rubygem-rbus rubygem-restility rubygem-selenium-client \ |
| - | rubygem-rails-2_3 rubygem-test-unit | + | 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 \ | ||
| + | rubygem-yast2-webservice-tasks yast2 yast2-core yast2-country yast2-dbus-server \ | ||
| + | yast2-perl-bindings yast2-users | ||
| zypper up yast2-core # needs a version >= 2.18.6 | zypper up yast2-core # needs a version >= 2.18.6 | ||
Current revision
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:
- Install `grep 'Requires:' git/dist/yast2-webservice.spec` from 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/
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-gettext_activerecord rubygem-gettext_rails \ rubygem-locale rubygem-locale_rails rubygem-rbus rubygem-restility rubygem-selenium-client \ 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 \ rubygem-yast2-webservice-tasks yast2 yast2-core yast2-country yast2-dbus-server \ yast2-perl-bindings yast2-users zypper up yast2-core # needs a version >= 2.18.6
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
Enable collectd
The rest-service supports to read system status information from collectd. To install and enable this service perform these actions:
zypper ar http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.1/ server_monitoring_oS-11.1 zypper in collectd vi /etc/collectd.conf # enable the plugins you want rccollectd start

