Re: [zones-discuss] svnserve

2009-10-06 Thread Trevor Pretty





If it does not come with a manifest for SMF you need to write one. If
it does then use it! or just use an rc script. However using the rc
scrpt ans making a service run under SMF is not hard. Attached is what
I wrote as a demo before postgress got an SMF service by default.

Look at "demo 2" in the self running ksh script where I demo my newly
created service.

The Defiant wrote:

  Hi All,

Another newbie question. I've just configured a seprate contaniner to serve as a seprate svn repository and configured svnserve as the default svn server. Everything works fine, except svnserve wont autostart after rebooting ;(

Can someone point me to adding svnserve to autostart. I guess we would be using SMF service and not the autostart.sh

Thx in advance!
  












www.eagle.co.nz
This email is confidential and may be legally 
privileged. If received in error please destroy and immediately notify 
us.


#!/usr/bin/ksh
#
#
#Note: The presentation is:- 
#
#http://webhome.singapore/trevor/Standard_Pressos/Solaris10_Demos/Sol10_demo_Overview/Solaris10_demo_SMF_CONTAINERS_ZFS.odp
#
#
#
# NOTE: This one use apache22 the older version use apache2
#
#http://webhome.singapore/trevor/Standard_Pressos/Solaris10_Demos/Sol10_demo_Overview/smf_demo_self_running.ksh_apache2
#
#
#--Setup---
#
#get the two files you need:-
#
#http://webhome.singapore/trevor/Standard_Pressos/Solaris10_Demos/Sol10_demo_Overview/pgsql
#http://webhome.singapore/trevor/Standard_Pressos/Solaris10_Demos/Sol10_demo_Overview/pgsql.xml
#
#copy these to (or anywhere else you prefer):
#
#/lib/svc/method/pgsql 
#/var/svc/manifest/application/pgsql.xml
#
#Setup pgsql if you have not already.
# 
#NOTE: This may be already under SMF conrol in later NV builds you will need to 
check when 
#  I wrote this it was not under SMF control. This was what I did on S10 
many moons 
#  ago to setup postgres, it's survived many LUs
# svcs -a | grep sql
# disabled   11:08:53 svc:/application/database/postgresql:version_81
# disabled   11:08:53 svc:/application/database/postgresql_83:default_32bit
# disabled   11:08:53 svc:/application/database/postgresql:version_82_64bit
# disabled   11:08:53 svc:/application/database/postgresql:version_82
# disabled   11:08:53 svc:/application/database/postgresql_83:default_64bit
# disabled   11:08:54 svc:/application/database/mysql:version_50
# 
#
#file:///usr/share/doc/pgsql/8.1.3/html/installation.html
#
#su -
#DATA=/var/lib/pgsql/data
#mkdir $DATA   #This should exist it is the default
#useradd -d /home/postgres postgres
#mkdir ~postgres
#chown postgres ~postgres
#chown postgres $DATA 
#
#su - postgres
#DATA=/var/lib/pgsql/data
#/bin/initdb -D $DATA
#/bin/createdb test#Optional
#/bin/psql -l
#
#su -
#svccfg delete -f pgsql
#cd /home/tp47565/Software/PostgreSQL
#cp ./pgsql.xml /var/svc/manifest/application
#cp ./pgsql /lib/svc/method
#chmod a+r /lib/svc/method/pgsql
#svccfg validate /var/svc/manifest/application/pgsql.xml
#svccfg import /var/svc/manifest/application/pgsql.xml
#svcadm enable pgsql 
#svcs pgsql
#su - postgres -c /bin/psql -l
# Note: I've setup the postgres user to run /bin/psql -l
#   and then logout
#***


## Press return to continue (so you can talk!)
#
press_return()
{
echo \n\t-- Press RETURN to continue --\c
read ANS
echo 
clear
}

## Do the commands given appending with  so they show up
#
do_command()
{
echo 
echo -- $*
eval $*
}

## I should check if you have the role but I don't - too lazy!
#
UID=`/usr/xpg4/bin/id -u`
if [ ! $UID -eq 0 ]; then
echo You must be root to run this script
press_return
exit 1
fi


##
## DEMO START 
##

#--- demo 1 simple commands 

# Have a browser Running to show that apache stops and starts
# /home/tp47565/bin/browser.sh norton/~tp47565 

svcadm disable apache22 #Just in case it is turned off
sleep 2 
svcadm enable apache22
sleep 3 
cd /tmp
clear
echo 
echo Is apache22 running, a simple ps to find out
echo 
echo 
do_command ps -ef | grep apache | grep -v grep
echo 
echo I can also see it is via the Browser
press_return
echo 
echo  So lets send the processes a kill -9
echo 
do_command kill -9 `pgrep httpd `
echo 
echo Is apache22 running, a simple ps to find out
echo 
do_command sleep 5
echo 
do_command ps -ef | grep apache | grep -v grep
echo 
echo I can also see it is via the Browser
echo 
echo But did you Notice the PIDs have changed?
press_return
echo 
echo 
echo In Solaris 10 most things have been turned into Services
echo Lets look into /etc/init.d
do_command ls /etc/init.d
echo 
echo 
echo There seems to be a lot less than I remember?
press_return
echo 
echo 
echo 

Re: [zones-discuss] svnserve

2009-10-06 Thread Enrico Maria Crisostomo
Hi.

I'd also take into account how you plan to configure Subversion. When
I'm not needing Apache2 and mod_svn I usually configure it as an inetd
service. I blogged about it, you can start here:

http://thegreyblog.blogspot.com/search/label/subversion

Hope this helps,
Enrico

On Tue, Oct 6, 2009 at 10:23 PM, Trevor Pretty
trevor_pre...@eagle.co.nz wrote:

 If it does not come with a manifest for SMF you need to write one. If it
 does then use it! or just use an rc script. However using the rc scrpt ans
 making a service run under SMF is not hard. Attached is what I wrote as a
 demo before postgress got an SMF service by default.

 Look at demo 2 in the self running ksh script where I demo my newly
 created service.

 The Defiant wrote:

 Hi All,

 Another newbie question. I've just configured a seprate contaniner to serve
 as a seprate svn repository and configured svnserve as the default svn
 server. Everything works fine, except svnserve wont autostart after
 rebooting ;(

 Can someone point me to adding svnserve to autostart. I guess we would be
 using SMF service and not the autostart.sh

 Thx in advance!




 www.eagle.co.nz

 This email is confidential and may be legally privileged. If received in
 error please destroy and immediately notify us.
 #!/usr/bin/ksh
 #
 #
 #Note: The presentation is:-
 #
 #http://webhome.singapore/trevor/Standard_Pressos/Solaris10_Demos/Sol10_demo_Overview/Solaris10_demo_SMF_CONTAINERS_ZFS.odp
 #
 #
 #
 # NOTE: This one use apache22 the older version use apache2
 #
 #http://webhome.singapore/trevor/Standard_Pressos/Solaris10_Demos/Sol10_demo_Overview/smf_demo_self_running.ksh_apache2
 #
 #
 #--Setup---
 #
 #get the two files you need:-
 #
 #http://webhome.singapore/trevor/Standard_Pressos/Solaris10_Demos/Sol10_demo_Overview/pgsql
 #http://webhome.singapore/trevor/Standard_Pressos/Solaris10_Demos/Sol10_demo_Overview/pgsql.xml
 #
 #copy these to (or anywhere else you prefer):
 #
 #/lib/svc/method/pgsql
 #/var/svc/manifest/application/pgsql.xml
 #
 #Setup pgsql if you have not already.
 #
 #NOTE: This may be already under SMF conrol in later NV builds you will need
 to check when
 #      I wrote this it was not under SMF control. This was what I did on S10
 many moons
 #      ago to setup postgres, it's survived many LUs
 # svcs -a | grep sql
 # disabled       11:08:53 svc:/application/database/postgresql:version_81
 # disabled       11:08:53
 svc:/application/database/postgresql_83:default_32bit
 # disabled       11:08:53
 svc:/application/database/postgresql:version_82_64bit
 # disabled       11:08:53 svc:/application/database/postgresql:version_82
 # disabled       11:08:53
 svc:/application/database/postgresql_83:default_64bit
 # disabled       11:08:54 svc:/application/database/mysql:version_50
 #
 #
 #file:///usr/share/doc/pgsql/8.1.3/html/installation.html
 #
 #su -
 #DATA=/var/lib/pgsql/data
 #mkdir $DATA                   #This should exist it is the default
 #useradd -d /home/postgres postgres
 #mkdir ~postgres
 #chown postgres ~postgres
 #chown postgres $DATA
 #
 #su - postgres
 #DATA=/var/lib/pgsql/data
 #/bin/initdb -D $DATA
 #/bin/createdb test    #Optional
 #/bin/psql -l
 #
 #su -
 #svccfg delete -f pgsql
 #cd /home/tp47565/Software/PostgreSQL
 #cp ./pgsql.xml /var/svc/manifest/application
 #cp ./pgsql /lib/svc/method
 #chmod a+r /lib/svc/method/pgsql
 #svccfg validate /var/svc/manifest/application/pgsql.xml
 #svccfg import /var/svc/manifest/application/pgsql.xml
 #svcadm enable pgsql
 #svcs pgsql
 #su - postgres -c /bin/psql -l
 # Note: I've setup the postgres user to run /bin/psql -l
 #       and then logout
 #***


 ## Press return to continue (so you can talk!)
 #
 press_return()
 {
        echo \n\t-- Press RETURN to continue --\c
        read ANS
        echo 
        clear
 }

 ## Do the commands given appending with  so they show up
 #
 do_command()
 {
        echo 
        echo -- $*
        eval $*
 }

 ## I should check if you have the role but I don't - too lazy!
 #
 UID=`/usr/xpg4/bin/id -u`
 if [ ! $UID -eq 0 ]; then
        echo You must be root to run this script
        press_return
        exit 1
 fi


 ##
 ## DEMO START 
 ##

 #--- demo 1 simple commands 

 # Have a browser Running to show that apache stops and starts
 # /home/tp47565/bin/browser.sh norton/~tp47565

 svcadm disable apache22 #Just in case it is turned off
 sleep 2
 svcadm enable apache22
 sleep 3
 cd /tmp
 clear
 echo 
 echo Is apache22 running, a simple ps to find out
 echo 
 echo 
 do_command ps -ef | grep apache | grep -v grep
 echo 
 echo I can also see it is via the Browser
 press_return
 echo 
 echo  So lets send the processes a kill -9
 echo 
 do_command kill -9 `pgrep httpd `
 echo 
 echo Is 

Re: [zones-discuss] svnserve

2009-10-06 Thread The Defiant
Wow, Thanks you guys!!!
Very informative..
If anyone else has a similar issue they can try this too:

http://fred.nomades.info/sysadm/sol10/#svn

Cheers
-TheDefiant.

Message was edited by: defian7
-- 
This message posted from opensolaris.org
___
zones-discuss mailing list
zones-discuss@opensolaris.org


[zones-discuss] svnserve

2009-10-05 Thread The Defiant
Hi All,

Another newbie question. I've just configured a seprate contaniner to serve as 
a seprate svn repository and configured svnserve as the default svn server. 
Everything works fine, except svnserve wont autostart after rebooting ;(

Can someone point me to adding svnserve to autostart. I guess we would be using 
SMF service and not the autostart.sh

Thx in advance!
-- 
This message posted from opensolaris.org
___
zones-discuss mailing list
zones-discuss@opensolaris.org