how to autologin, autostart in xdm / twm

Hello All,

I want to achieve a kiosk like functionality with minimal X. Purposely chose twm as that offers no icons, menus and if I manage to run my intended program under twm, that will give a better kiosk feel. I do not want KDE, GNOME, XFCE to claim memory and resources as they have no role in my application.

Now I have referred to various posts on net and know XDM cannot give me autologin. I plan to autologin via inittab / mingetty and startx from .bashrc and expect to launch application from within twm.

I have been unable to get my application to run in twm on start. I have put the command in .xinitrc (after executing twm, like below), but it does not launch at all. But if I start a xterm and run that command, application runs without any problem.
I have tried putting that in .profile and .bashrc too without success. Any ideas ?

My .xinitrc section:

........................................................................
# 
# finally start the window manager
#
unset WINDOW_MANAGER STARTUP
exec $WINDOWMANAGER
#This did not work and had to be commented out.
/usr/bin/java -jar /home/pbhat/MilkTally-1.1/Milk.jar &

# call failsafe
exit 0

Thanks in advance.

Did you ever consider to go to yast2 and open the /etc/sysconfig editor. Yes I know I hate it because it reminds me of a windows registration key, but your system will probably call those parameters

change those fields and it work

Desktop->Display Manager->DISPLAYMANAGER_AUTOLOGIN -specify the user

Desktop->Window Manager->DEFAULT_WM - put the correct window manager

sorry for double posting, the 10 minute rule arggg

how about /etc/init.d/ for boot scripts?
Howto: Write A Suse Boot Script

Did you understand that when you exec something in a shell script, nothing below that line will get run?

Also if you had read the startx man page you would have seen their suggested example. You start the apps you want and then the window manager last.

xrdb -load $HOME/.Xresources
xsetroot -solid gray &
xbiff -geometry -430+5 &
oclock -geometry 75x75-0-0 &
xload -geometry -80-0 &
xterm -geometry +0+60 -ls &
xterm -geometry +0-100 &
xconsole -geometry -0+0 -fn 5x7 &
exec twm

The twm replaces the startx process.

Shame to me, I had read man pages for both exec and startx, but your point escaped me. Reading the man page for exec now again, I realise the meaning of the statement ‘exec replaces the shell’. Thank you. That worked.

Knowing you from before as my Guru on other occassions too, I have made my mind to pick your head again. Look, if I call the startx from .bashrc, X produces errors. Basically it is,‘There is already another X on Display 0’, I see two X processes which even if I kill get spawned again. I find no way of calling startx from inittab. I don’t know if I can replace mingetty with startx command in inittab. But the so many advises on Net all suggest that and they all seem to be Debian based systems. I find no rc.local in OS which they refer to.

From Susestudio How-Tos, openSUSE:SUSE Studio General howtos - openSUSE it is suggested to autologin the user with mingetty and then in .bashrc,

while true do WINDOWMANAGER=/home/tux/bin/start.sh startx done
. But calling startx from .bashrc any which way produces X errors as I said above. I am not getting if I am missing something here. P.S: I have not missed to replace tux with my username !]

@idoitprone :

You may want to see if your suggestion works. XDM does not support auto login, wherever you set that.

You may blame me of ignorance, but not laziness!

Kind Regards,

Are you running the system at runlevel 5? If so there is already an X server running. To make sure no X server is active you should choose to boot to runlevel 3.

Running xstart from .bashrc implies you require the user to login. If you want to avoid this, you can put the xstart in /etc/inittab but you should su to the user in question as you do not want to run xstart as root.

No, I am running in runlevel 3. Following the suggestions on the How -To above, I made the mingetty in /etc/inittab autologin me after booting to runlevel 3 and in .bashrc I placed the below code .

while true do WINDOWMANAGER=/home/tux/bin/start.sh startx done
. I also tried calling startx plainly from .bashrc as
/usr/bin/startx
on a line in .bashrc. But the result is same.

Now,what I want to do is, replace one of the lines,

1:2345:respawn:/sbin/mingetty --noclear tty1
as
1:2345:respawn:su - pbhat -c /usr/bin/startx tty1
. Here I am not sure if using mingetty process is mandatory in that line.

Thanks so much.

may be I can use

mingetty --login ‘use su as the login program’
?

You shouldn’t need mingetty in between. Also you might need to specify a free console for the X, usually vt7 is allocated to X.

Oh my bad, I did not realize the session manager did not support at I. I usually accustomed to customizable session managers like kdm or something.

I read this and understand
Enabling autologin in Debian Linux without using GDM, XDM, KDM or other login manager | Debian Ubuntu Linux Solutions Blog

Sorry, for not understanding the problem completely. I just did a stupid bump lol

btw I realize suse dont have rc.local, but how about the directory /etc/init.d/rc3.d

man init.d

random online man init.d page
init.d man page

Update:
Now I have achieved what I needed with this
1.set window manager in .profile ( so that whatever is set by OS is overridden)
2.set application to run in .xinitrc
3.call startx from inittab 'su’ing to the user.
4.As the application will run single, my runlevel is actually 2.

Thanks ken_yap and others who helped me understand better, think more.

Any response is an honour rather than ignore the question. Using the yast sysconfig editor was my first attempt. As it did not work, I started exploring. Thanks.