Sponsored Content
Top Forums Shell Programming and Scripting how to run a command as soon as user exits from session Post 302542562 by yazu on Thursday 28th of July 2011 03:18:02 AM
Old 07-28-2011
It depends on many factors (your system, what session - console or desktop environment or ssh or something else, shell, how a user enters a session and what do you really want - to control a user or for yourself, etc.).

I believe your question has no information for an answer.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run a command with some other user id

Hi Say I am running a script using my user id csaha. How can I run any specific command in the same sctipr using any other user id (say root). Definitely I have the password of root. Any idea how the same can be achieved ??? Example: I need to run a script using my id (csaha) only on... (4 Replies)
Discussion started by: csaha
4 Replies

2. Shell Programming and Scripting

Script exits with $? not 0 randomly, how can I see what command failed?

Hi! I have this situation with 3 shellscripts. One is a "startscript" that simply calls other scripts. This one is scheduled with cron to run at regular intervals. That script runs what I'll refer to as Script 1. Script 1 in turn runs script 2 (import_catalogs_buyer.sh) Sometimes, seemingly... (2 Replies)
Discussion started by: trailsmoke
2 Replies

3. AIX

run which command to check the actual user

hi gurus, i have a question: when run which javac under a user account I got the following results: PROD DB Server: /usr/java14/bin/javac DR DB Server: /usr/java14/bin/javac DEV DB Server: /usr/java5_64/bin/javac The .profile in all environments are same. so how do know who is the... (1 Reply)
Discussion started by: lweegp
1 Replies

4. Shell Programming and Scripting

Save the output of the command run as other user

Dear All, I am writing a script and kind of stuck in a small thing. Cannot figure it out. so please help I am logged in as root user. I want to switch user to "user1" inside the script and execute a specific command lets say "pwd" and come back where i started. I know how to switch user,... (16 Replies)
Discussion started by: suhail.sadaqat
16 Replies

5. UNIX for Advanced & Expert Users

How can I run command with super user privledge

Hello All, I am working on UNIX like environment. This environment is ported from UNIX. Here when we need to build product set, we need to run some script with super user privledge (which we normal user dont have) Is there any way (some C program or some script) through which any normal... (2 Replies)
Discussion started by: joshi123
2 Replies

6. Shell Programming and Scripting

'script' command exits immediately

I'm trying to capture the output of some commands with the 'script' utility. Normally, I would type 'script /path/to/output/file', then enter commands, then hit ctrl+D to end the 'script' capture. I'm having trouble with it on a server. Upon starting 'script', it exits immediately before I type... (6 Replies)
Discussion started by: jalburger
6 Replies

7. Shell Programming and Scripting

tuxedo command run from another user

Hi , I would like to know, whether if it is possible or not. I am runing one tuxedo command script. This script should run on another userID and stored the data on another UserID. For Example: UserA : The Script is available in this userID location. . If i run that script then it... (3 Replies)
Discussion started by: Mani_apr08
3 Replies

8. Shell Programming and Scripting

Check when user exits SUDO

Hello to everyone, I'm new here and would like to thank everybody for the upcoming support, I know that I will have my question answered here, this community is huge. :) First of all, I´m a DBA and work on a daily basis on Unix environments of all kinds (HP-UX, Solaris, AIX, etc). I have... (8 Replies)
Discussion started by: ZeroBR
8 Replies

9. Shell Programming and Scripting

Execute a command after ssh exits

In my .tcshrc I define and run an alias to set my terminal title. The title contains the hostname. I do this because I ssh to other machines a lot and I always need to know which host I am typing in. The alias is defined and run in the .tcshrc like this... alias tt 'echo -n "^0;`hostname -s`^G"'... (5 Replies)
Discussion started by: salvadorjoshua
5 Replies

10. UNIX for Advanced & Expert Users

Run compile command make as another user

Hello I'm trying to compile LibreOffice core from github.com. But this can - as far as I know - not be done as root user. So I compiled it as login user (the user as I log in) and compilation works. Now I try to compile LibreOffice core as a user I created using useradd: useradd -r -U -m... (2 Replies)
Discussion started by: go4bash
2 Replies
gnome-session(1)						   User Commands						  gnome-session(1)

NAME
gnome-session - starts up the GNOME desktop environment SYNOPSIS
gnome-session [--choosesession] [--failsafe] [--purge-delay=delay] [--warn-delay=delay] [--suicide-delay=delay] [session-name] [gnome-std- options] DESCRIPTION
The gnome-session program starts up the GNOME desktop environment. This command is typically executed by your login manager (either gdm, xdm, or from your X startup scripts). It will either load your last session, or provide a default session for the user as defined by the system administrator (or the default GNOME installation on your system). You can optionally specify a specific session name to restore. gnome-session is an X11R6 session manager. It can manage GNOME applications as well as any X11R6 SM compliant sessions. If the user has previously saved a session, the session is loaded from the ~.gnome2/session file. Otherwise, the session is loaded from the /usr/share/gnome/default.session file. Any programs specified in the ~/.gnome2/session/.session-manual will also be started. gnome-session also exports an X Atom called GNOME_SM_DESKTOP on the root window, to indicate that gnome-session has started. Some applica- tions may require such information to proceed correctly. OPTIONS
The following options are supported: --choosesession User can specify a session to load, as opposed to the session specified in the ~/.gnome/session-options file. If that entry does not exist in the ~/.gnome/session file (or if that file does not exist), gnome-session will use the default ses- sion, and all saves to that session will be to the new session name. --failsafe Fail-safe operations mode: gnome-session only reads saved sessions from the default.session file. --purge-delay=deThe number of milliseconds that gnome-session will wait for clients to register. If delay is 0, gnome-session will wait forever. The default value is 30,000 milliseconds. --suicide-delay=Theanumber of milliseconds that gnome-session will wait for clients to die. If delay is 0, gnome-session will wait forever. The default value is 10,000 milliseconds. --warn-delay=delThe number of milliseconds that gnome-session will wait for clients to respond. If delay is 0, gnome-session will wait for- ever. The default value is 10,000 milliseconds. gnome-std-optionStandard options available for use with most GNOME applications. See gnome-std-options(5) for more information. OPERANDS
The following operands are supported: session-name The name of the session to be loaded. EXAMPLES
Example 1: Starting a session named "MySession" example% gnome-session --choose-session=MySession Example 2: Starting the system default session, ignoring the user's session example% gnome-session --failsafe Example 3: Setting the purge delay to 50000ms example% gnome-session --purge-delay=50000 Example 4: Setting the suicide delay to 50000ms example% gnome-session --suicide-delay=50000 Example 5: Setting the warning delay to 50000ms example% gnome-session --warn-delay=50000 ENVIRONMENT VARIABLES
gnome-session accepts all of the standard environment variables used by GNOME programs, as well as the SESSION_MANAGER environment vari- able. gnome-session also sets several environment variables for the use of its child processes. See environ(5) for descriptions of the following environment variables: SESSION_MANAGER Used by session-manager-aware clients to contact gnome-session. DISPLAY Set to the X display being used by gnome-session. Note that the --display option, if specified, overrides the set- ting of the DISPLAY environment variable. EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gnome-session The command-line executable for the application. /usr/share/gnome/defaultDefaultnsystem session file. ~/.gnome2/session User session file. ~/.gnome2/session/.sessiSpecifies programs to start that do not support session management. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-session | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
gnome-std-options(5), default.session(5), gnome-smproxy(1), gnome-session-save(1) NOTES
Written by Brian Cameron, Sun Microsystems Inc., 2003. SunOS 5.10 13 Jan 2003 gnome-session(1)
All times are GMT -4. The time now is 05:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy