FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Edubuntu User

 
 
LinkBack Thread Tools
 
Old 01-01-1970, 01:00 AM
"Craig E. Szymanski"
 
Default Urgent help request! was how do you get something to run when a user logs on?

----- "john" <lists.john@gmail.com> wrote:

| From: "john" <lists.john@gmail.com>
| To: "Oliver Grawert" <ogra@ubuntu.com>
| Cc: edubuntu-users@lists.ubuntu.com
| Sent: Sunday, August 31, 2008 5:21:55 PM GMT -05:00 US/Canada Eastern
| Subject: Urgent help request! was Re: how do you get something to run when a user logs on?
|
| Hi all,
|
| I am two days away from the start of school and the problem I
| described before still applies to me. If I can't figure this out I'll
| have to put off my upgrade to 8.04 (or 8.10 perhaps) until December.
| I'd really appreciate any help.
|
| This issue is I want to run some scripts that up until now have been
| called by /etc/profile. This has worked for me up through Edubuntu
| 7.04 The scripts use the system variables $HOME and $USER to map NFS
| shares to users desktops. I understand from oli and others that the
| image generated by 8.04 doesn't reference /etc/profile when users log
| in.
|
Hi John,
I had this problem when I upgraded to Gutsy
(https://lists.ubuntu.com/archives/edubuntu-users/2008-February/003598.html)
What I ended up doing was using the information on this page...
http://trac.64studio.com/64studio/ticket/107
and put this file: http://trac.64studio.com/64studio/attachment/ticket/107/15shell_profile
into: /etc/X11/Xsession.d
Make sure it is executable: chmod 755 /etc/X11/Xsession.d/15shell_profile

Afterwards all my printer settings and other tweaks worked as before.
Craig

|
| On Thu, Aug 28, 2008 at 8:27 AM, Oliver Grawert <ogra@ubuntu.com>
| wrote:
| > hi,
| > On Do, 2008-08-28 at 08:03 -0700, john wrote:
| >> Hi all,
| >>
| >> I was wondering where I can put scripts that I want to run when a
| user
| >> logs on to a thin client. I used to put them in /etc/profile but
| that
| >> doesn't seem to work under Hardy. It seems like LDM is somehow
| >> by-passing the stuff I put there. Can someone help me out?
| > ldm is executing /etc/X11/Xsession by default ... (like gdm or kdm
| do)
| > one option would be to put stuff into /etc/X11/Xsession.d, another
| is to
| > use the xdg autostart mechanism in /etc/xdg/autostart
| >
| > ciao
| > oli
| >
|
| --
| edubuntu-users mailing list
| edubuntu-users@lists.ubuntu.com
| Modify settings or unsubscribe at:
| https://lists.ubuntu.com/mailman/listinfo/edubuntu-users

--
edubuntu-users mailing list
edubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/edubuntu-users
 
Old 09-01-2008, 08:29 AM
Gavin McCullagh
 
Default Urgent help request! was how do you get something to run when a user logs on?

Hi,

On Sun, 31 Aug 2008, john wrote:

> When I tried calling these scripts from
> /etc/X11/Xsession.d per Ollies suggestion the scripts didn't seem to
> run, and in fact after accepting my credentials X just sent me back to
> the login screen, perhaps my syntax was incorrect. But I couldn't
> find any debug information in the logs to trouble shoot the issue.
> Where do I find more debug info?

I think you need to remove the "exit 0;" off the end as a start.

I'll reply with more detail in a bit.

Gavin


--
edubuntu-users mailing list
edubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/edubuntu-users
 
Old 09-01-2008, 08:22 PM
Gavin McCullagh
 
Default Urgent help request! was how do you get something to run when a user logs on?

Hi,

as promised, a little more detail (I was a little busy earlier, sorry).

On Sun, 31 Aug 2008, john wrote:

> This issue is I want to run some scripts that up until now have been
> called by /etc/profile. This has worked for me up through Edubuntu
> 7.04 The scripts use the system variables $HOME and $USER to map NFS
> shares to users desktops. I understand from oli and others that the
> image generated by 8.04 doesn't reference /etc/profile when users log
> in.
>
> When I tried calling these scripts from
> /etc/X11/Xsession.d per Ollies suggestion the scripts didn't seem to
> run, and in fact after accepting my credentials X just sent me back to
> the login screen, perhaps my syntax was incorrect. But I couldn't
> find any debug information in the logs to trouble shoot the issue.
> Where do I find more debug info?

Actually, what Ollie is doing is sending you down a path which is more
consistent with regular (not thin client) desktops. This is probably for
the best in general. As far as I know, /etc/profile only gets run when a
shell such as bash gets started. Environment variables are then inherited
by processes spawned by that shell. In the old LTSP case, the first thing
which happens is the thin client connects via ssh to the server, which
spawns a shell (bash) which in turn spawns gnome, etc. As a result,
/etc/profile worked for setting things within thin clients. However, it
probably didn't work for old LTSP and it wouldn't work on installed
desktops which use GDM (the display manager) as those spawn gnome directly
without starting a bash shell.

The process is that /etc/X11/Xsession gets run and it in turn includes
these lines:

# use run-parts to source every file in the session directory; we source
# instead of executing so that the variables and functions defined above
# are available to the scripts, and so that they can pass variables to each
# other
SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
set +e
for SESSIONFILE in $SESSIONFILES; do
. $SESSIONFILE
done
set -e
fi

which says something like "for each file in /etc/X11/Xsession.d/, execute
that code within this script". Because your script had an exit in it, that
effectively put an early exit inside the script above which is why your
script broke your login.

> francois suggestion about putting the lines in
> /opt/ltsp/i386/etc/profile and then updating the image didn't work
> either.

I'm pretty sure this is incorrect. The Xsession runs on the server so the
XSession scripts that get run are those of the server.

As regards debugging, I suggest writing the output of commands and stuff
into a file such as /tmp/xsession-$USER.txt. That way you can get an idea
how things went and put in debug statements to see the value of certain
variables at the time the script ran.

Gavin


--
edubuntu-users mailing list
edubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/edubuntu-users
 

Thread Tools




All times are GMT. The time now is 06:55 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org