[csw-devel] SF.net SVN: gar:[22116] csw/mgar/pkg/opencsw-manual/trunk/files/ for-maintainers/buildfarm-setup.rst
Peter FELECAN
pfelecan at opencsw.org
Fri Oct 4 20:14:21 CEST 2013
"Maciej (Matchek) Bliziński" <maciej at opencsw.org> writes:
> 2013/10/4 <pfelecan at users.sourceforge.net>:
>> Revision: 22116
>> http://gar.svn.sourceforge.net/gar/?rev=22116&view=rev
>> Author: pfelecan
>> Date: 2013-10-04 15:54:28 +0000 (Fri, 04 Oct 2013)
>> Log Message:
>> -----------
>> opencsw-manual/trunk:
>> - add sudo where needed
>> - started to verify the checkpkg optional chapter
>>
>> Modified Paths:
>> --------------
>> csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/buildfarm-setup.rst
>>
>> Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/buildfarm-setup.rst
>> ===================================================================
>> --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/buildfarm-setup.rst 2013-10-04 08:15:39 UTC (rev 22115)
>> +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/buildfarm-setup.rst 2013-10-04 15:54:28 UTC (rev 22116)
>> @@ -35,7 +35,12 @@
>> all packages that are in any of OpenCSW catalogs for any Solaris version.
>> A typical location is ``/export/mirror/opencsw``.
>>
>> +* `Regular user setup`_ for details on setting up an user: creation,
>> + sudo activation, etc.
>>
>> +.. _Regular user setup:
>> + http://usable-solaris.googlecode.com/svn/trunk/docs/solaris-10-preliminary-setup.html#_regular_user_setup
>> +
>> Base setup (required)
>> ---------------------
>>
>> @@ -44,7 +49,7 @@
>>
>> ::
>>
>> - pkgutil -y -i gar_dev mgar gcc4core gcc4g++ sudo
>> + sudo pkgutil -y -i gar_dev mgar gcc4core gcc4g++ sudo
>
> Hah, this can't work: you can't install sudo if it's not installed yet!
I agree with you. However it was what you have written and I just put it
back without verifying. That was the reason for which I took it out in
the first place. Will be corrected.
>>
>> Setup ``~/.garrc`` (required)
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> @@ -151,22 +156,93 @@
>> You can use any database engine supported by sqlobject. MySQL and sqlite have
>> been tested.
>>
>> -When using MySQL, you need to create the database and a user which has access
>> -to that database (not covered here).
>> +Required packages
>> +^^^^^^^^^^^^^^^^^
>>
>> -max_allowed_packet problem in MySQL
>> -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> +Install the required packages:
>>
>> -Since checkpkg stores objects in JSON, it sometimes stores values way bigger
>> -than the default allowed 1MB. For this to work with MySQL, the following
>> -needs to be present in ``/etc/opt/csw/my.cnf``::
>> +::
>>
>> - [mysqld]
>> - max_allowed_packet=64M
>> + sudo pkgutil --yes --install cswutils mysql5 mysql5client
>>
>> -There are packages which require data structures larger than 32MB, hence the
>> +
>> +Create a minimal configuration file:
>> +
>> +::
>> +
>> + sudo echo >>/etc/opt/csw/my.cnf "[mysqld]"
>> + sudo echo >>/etc/opt/csw/my.cnf "max_allowed_packet=64M"
>> +
>> +This is needed since checkpkg stores objects in JSON, it sometimes
>> +stores values way bigger than the default allowed 1MB, as there are
>> +packages which require data structures larger than 32MB, hence the
>> 64MB value.
>>
>> +You start the data base server:
>> +
>> +::
>> +
>> + sudo svcadm enable svc:/network/cswmysql5:default
>> +
>> +Eventually, you make your installation secure:
>> +
>> +::
>> +
>> + sudo /opt/csw/bin/mysql_secure_installation
>
> This needs to be executed first, and only then "svcadm enable".
The script needs a running server. Install on a pristine system and try
to run the script and you'll see for yourself.
Because, when you run the script the service disabled:
# svcs -l svc:/network/cswmysql5:default
fmri svc:/network/cswmysql5:default
enabled false
state disabled
next_state none
state_time Fri Oct 04 20:12:55 2013
logfile /var/svc/log/network-cswmysql5:default.log
restarter svc:/system/svc/restarter:default
contract_id
dependency require_all/none svc:/system/filesystem/local (online)
dependency require_all/none svc:/network/loopback (online)
you get:
# /opt/csw/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Enter current password for root (enter for none):
ad infinitum
>> +
>> +and answer affirmatively to all the questions.
>> +
>> +Creating the database
>> +^^^^^^^^^^^^^^^^^^^^^
>> +
>> +When using MySQL, you need to create the database and a user which has access
>> +to that database.
>> +
>> +::
>> +
>> + mysql -u root -h 127.0.0.1 -p
>
> The "-h 127.0.0.1" option is not necessary. If the database is local,
> it'll connect via a socket.
You're right.
>
>> + > create database checkpkg;
>> + > grant all privileges on checkpkg.* to "checkpkg" identified by "password";
>> + > flush privileges;
>> + > exit;
>> +
>> +Note that you must use your own value instead of ``password``.
>> +
>> +To verify that your user creation is correct you can execute this:
>> +
>> +::
>> +
>> + mysql -u wp1 -h 127.0.0.1 -p
>> + > use checkpkg;
>> + > status;
>> + > exit;
>> +
>> +Configuration
>> +^^^^^^^^^^^^^
>> +
>> +The database access configuration is held in ``/etc/opt/csw/checkpkg.ini``.
>> +You can also use a per-user file: ``~/.checkpkg/checkpkg.ini``. The format is
>> +as follows:
>> +
>> +::
>> +
>> + [database]
>> + type = mysql
>> + name = checkpkg
>> + host = mysql
>> + user = checkpkg
>> + password = yourpassword
>> +
>> +
>> +Initializing tables and indexes
>> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> +
>> +The next step is creating the tables in the database:
>> +
>> +::
>> +
>> + pkgdb initdb
>
> "bin/pkgdb initdb", not "pkgdb initdb". You're executing it from GAR
> sources, with PWD being the "v2 directory. Maybe this could be made
> clearer somehow in the instructions?
Clearer you said?
--
Peter
More information about the devel
mailing list