Operating System - HP-UX
1827894 Members
1537 Online
109969 Solutions
New Discussion

Automating Motif Window Manager (mwm) on bootup

 
SOLVED
Go to solution
Bob Fonacier
Occasional Advisor

Automating Motif Window Manager (mwm) on bootup

I tried automating mwm on our server together with Xvfb (X Virtual Frame Buffer). These background processes are being used by Oracle Reports. I created a script, /sbin/init.d/xctl & linked it to run at init 3, BUT mwm is not being run. Pls help, below is my script:

#!/bin/sh
# /sbin/init.d/xctl
# Version When Who What
# 1.0 23-JAN-03 Bob Fonacier Created
# 1.1 21-FEB-03 Gareth Roberts Added mwm and changed screen size, fixed vars
# 1.2 11-SEP-03 Bob Fonacier Added exit & linked to /sbin/rc3.d
# ln -s /sbin/init.d/xctl /sbin/rc3.d/S995xctl

case $1 in
'start_msg')
echo "Starting X term for unix"
;;
'start')
DISPLAY=`/usr/bin/hostname`:0.0; export DISPLAY
/usr/bin/X11/Xvfb :0 -ac -screen 0 1024x768x8 -pn -fp \
/usr/lib/X11/fonts/misc -sp /etc/X11/SecurityPolicy &
/usr/bin/X11/mwm &
/usr/bin/X11/xhost +
;;
'stop_msg')
echo "Stopping X term for unix"
;;
'stop')
;;
esac

exit 0;
4 REPLIES 4
Mike Stroyan
Honored Contributor
Solution

Re: Automating Motif Window Manager (mwm) on bootup

You typically need to use nohup to prevent
commands started by rc scripts from exiting
because of a SIGHUP when /sbin/rc completes.

I would also add a sleep between the start of
the X server and the start of the clients.
The 'start' clause would look something like-

DISPLAY=`/usr/bin/hostname`:0.0; export DISPLAY
nohup sh -c '/usr/bin/X11/Xvfb :0 -ac -screen 0 1024x768x8 -pn -fp \
/usr/lib/X11/fonts/misc &
sleep 5; /usr/bin/X11/xhost + ; /usr/bin/X11/mwm &' > /dev/null

The "-sp /etc/X11/SecurityPolicy" is a
default, so shouldn't be needed.
Bob Fonacier
Occasional Advisor

Re: Automating Motif Window Manager (mwm) on bootup

EXCELLENT piece of advice Mike ! You solved one of my long standing problem. Thanks very much and keep up the good work of helping others.

Bob
Unix Administrator_5
Frequent Advisor

Re: Automating Motif Window Manager (mwm) on bootup

There is a known problem with some older versions of Xvfb. It will no start properly at boot. You have to upgrade to a later version. I'm not sure if this is your problem or not.
ed e
Advisor

Re: Automating Motif Window Manager (mwm) on bootup


well, I only seem to get
mwm: I/O error on display:: :8.0
anyone else?