Operating System - HP-UX
1826507 Members
3259 Online
109693 Solutions
New Discussion

Re: Automating X server (mwm) on system bootup

 
manoj_pu
Regular Advisor

Automating X server (mwm) on system bootup

I tried automating mwm on our server (running hpux 11i) together with Xvfb (X Virtual Frame Buffer). These background processes are being used by Oracle Reports. I created a script, /sbin/init.d/xvfb & linked it to run at init 3, BUT mwm is not being run. Pls help,
Attached is the script used for startup.

Manoj
Leave with out tense and try best you gets result
5 REPLIES 5
Isralyn Manalac_1
Regular Advisor

Re: Automating X server (mwm) on system bootup

Hi Manoj,

I've got a simple script to start xvfb and mwm during start-up:

PATH=/sbin:/usr/sbin:/usr/bin
export PATH
rval=2
case $1 in
start_msg) echo "Starting xvfb" ;;
stop_msg) echo "Shutting down xvfb" ;;
start)
nohup /usr/bin/X11/Xvfb :45 -screen 0 1024x768x8 -pn -fp /usr/lib/X11/fonts/misc
-sp /etc/X11/SecurityPolicy &

nohup /usr/bin/X11/mwm -display $HOSTA:45.0 & ;;
stop)
rval=$? ;;
*) echo "usage: $0 {start|stop|start_msg|stop_msg}"
rval=1 ;;
esac
exit $rval


Regards,

Ira
manoj_pu
Regular Advisor

Re: Automating X server (mwm) on system bootup

Hi Isralyn,

It did not help me to keep mwm process running always.

Whats happening is the script starts xvfb and mwm while the system is coming up.
But mwm process dies once system is completely come up.

Please anybody guide me to prepare a script or providing some other way to start xvfb and mwm in the system startup.


Manoj
Leave with out tense and try best you gets result
Devesh Pant_1
Esteemed Contributor

Re: Automating X server (mwm) on system bootup

Manoj,
Here is what we use out here:
Create a script in /sbin/init.d/startxvfb.ksh
link the /sbin/rc3.d/S93startxvfb to this
Hope it helps
thanks
DP

#!/bin/ksh
# startxvfb.ksh -- restart Xvfb and twm
#
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/shlib/X11
integer Xvfb_pid
let Xvfb_pid=0
integer twm_pid
let twm_pid=0

if [[ "$1" = stop ]]
then
# Find the PID of Xvfb
Xvfb_pid=`ps -ef | grep Xvfb | grep -v grep | awk '{ print $2 }'`
if [ $Xvfb_pid -gt 0 ]
then
kill -9 $Xvfb_pid
fi
# Find the PID of twm
twm_pid=`ps -ef | grep twm | grep -v grep | awk '{ print $2 }'`
# If twm is running, stop it.
if [ $twm_pid -gt 0 ]
then
kill -9 $twm_pid
fi
else
# Restart Xvfb and twm
# Find the PID of Xvfb
Xvfb_pid=`ps -ef | grep Xvfb | grep -v grep | awk '{ print $2 }'`
# If Xvfb is running, stop it.
if [ $Xvfb_pid -gt 0 ]
then
kill -9 $Xvfb_pid
fi
# Start Xvfb then wait ten seconds.
/usr/bin/X11/Xvfb :9 &
/sbin/sleep 5

# Find the PID of twm
twm_pid=`ps -ef | grep twm | grep -v grep | awk '{ print $2 }'`
# If twm is running, stop it.
if [ $twm_pid -gt 0 ]
then
kill -9 $twm_pid
fi
# Start twm
/usr/bin/X11/twm -display :9 &
fi
manoj_pu
Regular Advisor

Re: Automating X server (mwm) on system bootup

Davesh,

My xvfb rc script works fine if we run manually. But same script is not working in the system startup.

Manoj
Leave with out tense and try best you gets result
Devesh Pant_1
Esteemed Contributor

Re: Automating X server (mwm) on system bootup

Manoj,
I suspect there might be some other script that runs later in the sequence that might be affecting.
try to change the sequence so that this one runs at the last.

DP