Disappearing files, created from /etc/X11/Xclients
- From: Laszlo Nagy <gandalf@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 14:52:59 +0100
Hi,
I'm running several diskless boxes. They connect to the same server with xdmpc (gdm). When a user logs in, the WM is started by script /etc/X11/Xclients:
#!/bin/sh
xmodmap /etc/X11/xmodmap.hun
exec /etc/X11/startwm.py
You can find the startwm.py script at the end of this e-mail. Most importantly, I wanted to save client IP addresses and the date of the login into different files. These files are located under /tmp/disklessips/*. Rights for /tmp/diskless is octal 42777:
drwxrwsrwx 2 root users 512 Mar 20 14:41 disklessips
The strange thing is that, if I login with user 'gandalf' who is in 'wheel', the files are created and saved into /tmp/disklessips/gandalf.txt and /tmp/disklessips/gandalf.history.txt. But if I login with any other user (they are in group 'users'), no files are created, but the window manager IS started. The startwm.py program creates these files BEFORE starting gnome, and it does throw an error. So they must have been created, but I do not see them anywhere. They simply disappear. Never existed? Any thoughts?
Thanks,
Laszlo
#!/usr/local/bin/python
import os
import datetime
WM = """exec dbus-launch --exit-with-session gnome-session"""
# Extract client IP
display = os.environ['DISPLAY']
idx = display.find(':')
remotehost = display[:idx]
os.environ['REMOTEHOST'] = remotehost
# Save client IP
ddir = '/tmp/disklessips'
fout = file('%s/%s.txt'%(ddir,os.getlogin()),'wb+')
fout.write(remotehost)
fout.close()
# Save history
fout = file('%s/%s.history.txt'%(ddir,os.getlogin()),'ab+')
fout.write( datetime.datetime.now().isoformat()[:19] + '\t' + remotehost + '\n' )
fout.close()
os.system(WM)
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Disappearing files, created from /etc/X11/Xclients
- From: Alex Zbyslaw
- Re: Disappearing files, created from /etc/X11/Xclients
- Prev by Date: Re: Shared object "libintl.so.6" not found
- Next by Date: new port
- Previous by thread: automated response
- Next by thread: Re: Disappearing files, created from /etc/X11/Xclients
- Index(es):
Relevant Pages
|