Disappearing files, created from /etc/X11/Xclients
gandalf at designaproduct.biz
Tue Mar 20 13:53:00 UTC 2007
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
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?
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+')
# Save history
fout = file('%s/%s.history.txt'%(ddir,os.getlogin()),'ab+')
fout.write( datetime.datetime.now().isoformat()[:19] + '\t' + remotehost
+ '\n' )
More information about the freebsd-questions