From owner-freebsd-questions@FreeBSD.ORG Tue Mar 20 13:53:00 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C2A216A404 for ; Tue, 20 Mar 2007 13:53:00 +0000 (UTC) (envelope-from gandalf@designaproduct.biz) Received: from designaproduct.biz (135-shost.hostoffice.hu [195.228.74.135]) by mx1.freebsd.org (Postfix) with ESMTP id E56D913C4AE for ; Tue, 20 Mar 2007 13:52:59 +0000 (UTC) (envelope-from gandalf@designaproduct.biz) Received: from [172.16.0.43] (localhost [127.0.0.1]) by designaproduct.biz (Postfix) with ESMTP id 5355F1DD422 for ; Tue, 20 Mar 2007 09:46:24 -0400 (EDT) Message-ID: <45FFE73B.1080406@designaproduct.biz> Date: Tue, 20 Mar 2007 14:52:59 +0100 From: Laszlo Nagy User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Subject: Disappearing files, created from /etc/X11/Xclients X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2007 13:53:00 -0000 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)