rc* scripts to start/stop IDS
Posted in 2000
Topics: Server Administration, Networking & sqlhosts Configuration, Platform-Specific Issues
Hi,
Especial thanks to Mark and SC for their help. I followed their advice with
respect to the edit scripts to start and stop the IDS engine on a Solaris 7
OS. Here's that I did:
1) Creation of the /etc/init.d/informix script
informix -rwxr--r-- 3 root sys
2) Link (hard link) to the following directory:
/etc/rc0.d/K90informix -rwxr--r-- 3 root sys
3) Link (hard link) to the following directory:
/etc/rc3.d/S90informix -rwxr--r-- 3 root sys
The informix script is here:
#!/sbin/sh
#Start of script
case "$var" in
'start')
su - informix
PATH=/usr/bin:/usr/ucb:/etc:. export PATH
TERM=vt100
export TERM
EDITOR=/bin/vi
export EDITOR
# Variables de entorno de Informix
INFORMIXDIR=/opt/informix export INFORMIXDIR
PATH=$INFORMIXDIR/bin:$PATH export PATH
DBDATE=dmy4/ export DBDATE
INFORMIXSERVER=ol_prueba_shm export INFORMIXSERVER
INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts export INFORMIXSQLHOSTS
ONCONFIG=onconfig.203 export ONCONFIG
cd /opt/informix
oninit
;;
'stop')
su - informix
PATH=/usr/bin:/usr/ucb:/etc:. export PATH
TERM=vt100
export TERM
EDITOR=/bin/vi
export EDITOR
# Variables de entorno de Informix
INFORMIXDIR=/opt/informix export INFORMIXDIR
PATH=$INFORMIXDIR/bin:$PATH export PATH
DBDATE=dmy4/ export DBDATE
INFORMIXSERVER=ol_prueba_shm export INFORMIXSERVER
INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts export INFORMIXSQLHOSTS
ONCONFIG=onconfig.203 export ONCONFIG
cd /opt/informix
onmode -ky
;;esac
exit 0
#End of script
I reboot the machine and the engine doesn't start.
But, if I separately run the start case script and the stop case script on a
root terminal, they run OK: the engine start and stop. I think I have a
problem in the owner, permissions or type of links of the scripts I edited
(informix, S90informix and K90informix). At last, why did you tell me to put
90 in the S and K scripts ???
I'm very thanked.
Yours,
Alejandro Cabrera Obed
Responsable Area Informatica
Sistema Unico de Prestaciones para Personas con Discapacidad
Tel. 54 11 4331-7344 int 5527
http://www.sisdis.gov.ar
E-mail: sisdis@tournet.com.ar
Bs. As. - Argentina
See /etc/init.d/README to better understand the S, K, and the numbers that
go along with them...
Hal Maner
M Systems International, Inc.
www.msystemsintl.com
"Sistema Unico (CNA)" <sisdis@tournet.com.ar> wrote in message
news:8rl4r6$lkk$1@news.xmission.com...
>
> Hi,
>
> Especial thanks to Mark and SC for their help. I followed their advice
with
> respect to the edit scripts to start and stop the IDS engine on a Solaris
7
> OS. Here's that I did:
>
> 1) Creation of the /etc/init.d/informix script
> informix -rwxr--r-- 3 root sys
> 2) Link (hard link) to the following directory:
> /etc/rc0.d/K90informix -rwxr--r-- 3 root sys
> 3) Link (hard link) to the following directory:
> /etc/rc3.d/S90informix -rwxr--r-- 3 root sys
>
> The informix script is here:
>
> #!/sbin/sh
> #Start of script
>
> case "$var" in
> 'start')
> su - informix
> PATH=/usr/bin:/usr/ucb:/etc:.> export PATH
> TERM=vt100
> export TERM
> EDITOR=/bin/vi
> export EDITOR
> # Variables de entorno de Informix
> INFORMIXDIR=/opt/informix> export INFORMIXDIR
> PATH=$INFORMIXDIR/bin:$PATH> export PATH
> DBDATE=dmy4/> export DBDATE
> INFORMIXSERVER=ol_prueba_shm> export INFORMIXSERVER
> INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts> export INFORMIXSQLHOSTS
> ONCONFIG=onconfig.203> export ONCONFIG
> cd /opt/informix
> oninit
> ;;>
> 'stop')
> su - informix
> PATH=/usr/bin:/usr/ucb:/etc:.> export PATH
> TERM=vt100
> export TERM
> EDITOR=/bin/vi
> export EDITOR
> # Variables de entorno de Informix
> INFORMIXDIR=/opt/informix> export INFORMIXDIR
> PATH=$INFORMIXDIR/bin:$PATH> export PATH
> DBDATE=dmy4/> export DBDATE
> INFORMIXSERVER=ol_prueba_shm> export INFORMIXSERVER
> INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts> export INFORMIXSQLHOSTS
> ONCONFIG=onconfig.203> export ONCONFIG
> cd /opt/informix
> onmode -ky
> ;;> esac
>
> exit 0
> #End of script
>
> I reboot the machine and the engine doesn't start.
> But, if I separately run the start case script and the stop case script on
a
> root terminal, they run OK: the engine start and stop. I think I have a
> problem in the owner, permissions or type of links of the scripts I edited
> (informix, S90informix and K90informix). At last, why did you tell me to
put
> 90 in the S and K scripts ???
>
> I'm very thanked.
>
> Yours,
>
> Alejandro Cabrera Obed
> Responsable Area Informatica
> Sistema Unico de Prestaciones para Personas con Discapacidad
> Tel. 54 11 4331-7344 int 5527
> http://www.sisdis.gov.ar
> E-mail: sisdis@tournet.com.ar
> Bs. As. - Argentina
>
>
As far as I can tell, the only difference between 'start' and 'stop'
in your script is 'oninit' and 'oninit -ky'. It may be better to
do something like this:
ARGS=""
[ "$var" = "stop" ] && ARGS="-ky"
[The rest of your script is here]
oninit $ARGS
Thanh
In article <8rl4r6$lkk$1@news.xmission.com>,
"Sistema Unico \\(CNA\\)" <sisdis@tournet.com.ar> wrote:
>
> Hi,
>
> Especial thanks to Mark and SC for their help. I followed their
advice with
> respect to the edit scripts to start and stop the IDS engine on a
Solaris 7
> OS. Here's that I did:
>
> 1) Creation of the /etc/init.d/informix script
> informix -rwxr--r-- 3 root sys
> 2) Link (hard link) to the following directory:
> /etc/rc0.d/K90informix -rwxr--r-- 3 root sys
> 3) Link (hard link) to the following directory:
> /etc/rc3.d/S90informix -rwxr--r-- 3 root sys
>
> The informix script is here:
>
> #!/sbin/sh
> #Start of script
>
> case "$var" in
> 'start')
> su - informix
> PATH=/usr/bin:/usr/ucb:/etc:.> export PATH
> TERM=vt100
> export TERM
> EDITOR=/bin/vi
> export EDITOR
> # Variables de entorno de Informix
> INFORMIXDIR=/opt/informix> export INFORMIXDIR
> PATH=$INFORMIXDIR/bin:$PATH> export PATH
> DBDATE=dmy4/> export DBDATE
> INFORMIXSERVER=ol_prueba_shm> export INFORMIXSERVER
> INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts> export INFORMIXSQLHOSTS
> ONCONFIG=onconfig.203> export ONCONFIG
> cd /opt/informix
> oninit
> ;;>
> 'stop')
> su - informix
> PATH=/usr/bin:/usr/ucb:/etc:.> export PATH
> TERM=vt100
> export TERM
> EDITOR=/bin/vi
> export EDITOR
> # Variables de entorno de Informix
> INFORMIXDIR=/opt/informix> export INFORMIXDIR
> PATH=$INFORMIXDIR/bin:$PATH> export PATH
> DBDATE=dmy4/> export DBDATE
> INFORMIXSERVER=ol_prueba_shm> export INFORMIXSERVER
> INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts> export INFORMIXSQLHOSTS
> ONCONFIG=onconfig.203> export ONCONFIG
> cd /opt/informix
> onmode -ky
> ;;> esac
>
> exit 0
> #End of script
>
> I reboot the machine and the engine doesn't start.
> But, if I separately run the start case script and the stop case
script on a
> root terminal, they run OK: the engine start and stop. I think I have
a
> problem in the owner, permissions or type of links of the scripts I
edited
> (informix, S90informix and K90informix). At last, why did you tell me
to put
> 90 in the S and K scripts ???
>
> I'm very thanked.
>
> Yours,
>
> Alejandro Cabrera Obed
> Responsable Area Informatica
> Sistema Unico de Prestaciones para Personas con Discapacidad
> Tel. 54 11 4331-7344 int 5527
> http://www.sisdis.gov.ar
> E-mail: sisdis@tournet.com.ar
> Bs. As. - Argentina
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.