General :: Bash - Attaching Some Code To Session Start And End?
Jun 20, 2011
I'm trying to execute some code (let's call it login.java) when I log in and out of my linux machine. Is there any way to do this? I'm looking for perhaps a way to trigger the code? I've thought of just putting it in my .bash_login but preferably the code would launch on normal login, not when I start my terminal.
View 2 Replies
ADVERTISEMENT
Feb 27, 2010
I have a Lenovo 3000 N100 laptop which LCD does not work anymore.So I borrowed a monitor from my friend and started using it(it has been few days).I had installed Fedora-12 few months ago. After connecting the external monitor, I found that this one shows good graphical start-up but just upto the login screen(just before the login screen, login-screen does not come) and it proceeds no more.Though I can get the virtual consoles restarting xserver is of no use.
View 5 Replies
View Related
Feb 27, 2010
I have a Lenovo 3000 N100 laptop which LCD does not work anymore.So I borrowed a monitor from my friend and started using it(it has been few days).I had installed Fedora-12 few months ago. After connecting the external monitor, I found that this one shows good graphical start-up but just upto the login screen(just before the login screen, login-screen does not come) and it proceeds no more.Though I can get the virtual consoles restarting xserver is of no use
View 2 Replies
View Related
Apr 25, 2011
how to launch a non-login bash session that doesn't inherit its parents environmental variables, and doesn't source /etc/bashrc?
View 2 Replies
View Related
Apr 23, 2010
I am using CentOS 5.4. I created a bash script that does some checking before running any commands. If the check fails, it will simply exit 0. The problem I am having is that on our server, the script will exit the su or ssh session when the exit 0 is called.
#!/bin/bash
# check if directory has contents and exit if none
if [ -z "`ls /ebs_raid/import/*.txt 2>/dev/null`" ]; then
echo "ok"
exit 0
fi
Here is the output:
[root@ip-10-251-86-31 ebs_raid]# . test.sh
ok
[russ@ip-10-251-86-31 ebs_raid]$
I was removed from my sudo session, if I wasn't in the sudo session, it would have logged me out of my ssh session. I am not sure what I am doing wrong here or where to start.
View 1 Replies
View Related
Dec 10, 2009
I have 3 script BASH. I want start this script when the system start,stop and reeboot.
View 4 Replies
View Related
Sep 11, 2010
Don't pay attention to 9+9+, was a misstyping
This is the deal. I installed kubuntu yesterday. Now when it prompts the start session screen, I write the user and password, click enter and then starts loading a new screen. It shows an hdd draw, and starts loading some other images, and all of a sudden it prompts me again at the start session screen.
Intel Celeron 2,13 GHz at ASROCK P4VM800 motherboard
1,18 GB RAM
View 3 Replies
View Related
Feb 9, 2010
how to write secure code for bash scripts in general? Strangely I didn't found anything in google and in the forum so far. If someone here is willing to review a bash script for me (about 600 lines).
View 6 Replies
View Related
May 29, 2011
Can fluxbox remember the apps that were running when it was shut down and reopen them when it is restarted?
If so, how?
View 3 Replies
View Related
Nov 11, 2010
How to start a remote login session from script to any server?
View 1 Replies
View Related
May 1, 2010
I'm not able to successfully start a KDE session(SLAX), check out the error, Code: xauth: creating new authority file /root/.serverauth.7378
X.Org X Server 1.4.2
Release Date: 11 June 2008
X Protocol Version 11, Revision 0
[code]....
View 9 Replies
View Related
Apr 1, 2011
hello everyone.I've created a application that uses laptop camera as the interface and uses the gestures made by finger movements in air to perform clicking an right clicking operations.i just need to know how to attach this application to the OS kernal so that i can perform various operations like closing window,opening applications etc.
View 1 Replies
View Related
Apr 15, 2011
When I do xhost + also it hangs.Without the xclock I am not able to run oracle reports in production for bar code printing as I am not able to start a standalone reports server. Help needed to start xclock and where to look for any help
View 2 Replies
View Related
Dec 13, 2010
I have a file opened in vi running in a terminal(xterm), if I directly closes the terminal without first closing the file then I can see the vi still running in the background(ps x). Now is there any way to attach that process i.e. vi to some other terminal so that I can continue my work on the file. I have also tried fd command but it fails.
View 4 Replies
View Related
Apr 6, 2010
when i start my pc i have an error: Consolekit session error, unknown return code 0 when i click Ok it then starts my session
View 7 Replies
View Related
Apr 16, 2010
I know I have to count how many instances are running: ps x | grep apache2 | wc -l result if it's running: 2, or else: 1 I also know there is a command called test that I could use to perform the verification, but I don't know how to use test with wc
View 3 Replies
View Related
Mar 28, 2011
I have disabled root ssh logins for security. When I am logged in as a normal user over SSH and do a su into root the tab-completion stops working with apt. It still works when doing normal file-browsing, on the original user1, and it has worked previously when logged directly into root. How do I make it autocomplete again? I am using Debian Stable on a headless homeserver.
View 3 Replies
View Related
Jul 14, 2011
The problem is this: My movie collection is growing that large that it no longer fits on the 3TB storage I have available for it in my server.therefore want to start using external disks, but as I don't want to waste electricty I want to switch this drive on only when I want to watch a movie which is on this drive. This drive will be connected to my server running Fedora 15 x64. The movies will (most likely) be played by a machine running XBMC on an Ubuntu minimal install (10.04). Currently I use NFS to create a mount on this machine to my media folder.The question: How can I best setup this external drive and shares etc so to have these movies available from my XBMC machine when I switch on the drive, but nothing crashing when the drive is off (while the XBMC machine stays on)?
View 8 Replies
View Related
Mar 26, 2010
I am using Fedora and trying to auto run a script soon after the unit boots to desktop. I found many suggestions and finally decided to use the Sessions->Startup Programs option (under System->Preferences->Personal->Sessions menu). I added my script in the Startup Programs with the command 'sh myscript.sh'. Now I have two questions here:1. When I use the command 'gnome-terminal -e myscript.sh', I get 'There was an error creating the child process for this terminal' message after logging into the desktop. Can any one tell if I am missing something here?2. Even if I use sh instead of gnome-terminal, I still want to see the script executing. In other words, my script has certain echo statements indicating the flow of the script. But I don't see any shell opening up with these echo statements showing up, after the unit boots to desktop. But the script was still executed with no problem
View 1 Replies
View Related
Feb 7, 2010
I am using Sphinx search on my webserver and it quits after a certain amount of time leaving my search page broken.Here is a bash script that I want to run every 10mins via cron:
Code:
#!/bin/bash
if pgrep searchd | grep "[0-9]"
[code]...
View 24 Replies
View Related
Apr 23, 2010
I've been switched to a new department at work and am totally clueless when it comes to scripting in bash. When I told them I was a fast learner, I didn't think they'd throw me into the deep end of the pool so fast. So to make a long story short. What is a great book to start learning scripting in bash? My supervisor already gave me a simple task to do. Conceptually it sounds quite easy in my head, but actually writing out a script is a bit more daunting and complexed than I first thought.
View 3 Replies
View Related
Feb 16, 2011
I want to write a c program with some shell scripts.Now For a simple C program. I am Setting a variable called val2 in bash, now I want to use bash variable val2 in C code. How do I do that?The above doesn't work (coz its spawning a different memory space and when shell script ends the variable dies with it as per my research but how do I keep them in same memory space)Also Is there any Good reference where they teach how to integrate C and Bash Together?
View 5 Replies
View Related
Jun 15, 2010
I have been scripting (or programming) in Bash shell for around 2+ years now. I have heard that ksh and zsh are better shells than bash. Are there any differences on the scripting side too, I mean is it easier to write a script in ksh or zsh rather than bash? Is there any benefit to code in ksh or zsh instead of bash.
View 1 Replies
View Related
Jun 25, 2010
I have an Ubuntu server in which a file is dumped every hour and a new file for the next hour and the process continues. If there is any problem due to which the creation of file stops then empty files are created every minute till the process is killed & started again. I need help to make a shell script to check if the empty files are being created and then kill the process and start it again.It would be a great help if anyone can help me regarding this.
View 9 Replies
View Related
Apr 9, 2010
Awhile back, PabloTwo pointed me to zenity as a way to create bash scripts with changeable parameters. That thread is here, for anyone interested in reading about it: [URL] Anyway, my problem is that I'm trying to capture input that contains double-dashes ("--") but zenity (or maybe or it's bash???) complains with the following error message:
"This option is not available. for all possible usages.
bash: [/code]: No such file or directory"
Here's an example of what I'm doing:
Code:
# Select the time of day
Flytime=`zenity --list --text="Select the Time" --radiolist --height=300 --width=300 --hide-column=2 --column="Select" --column="Code" --column="Time of Day"
"" "--timeofday=real" "Local Time"
[code]....
What I want to accomplish is for the variable $Flytime to contain either "--timeofday=real" or "--timeofday=dawn" (without the quotes) depending upon which radio button is selected. I have tried escaping "--timeofday" (e.g. "--timeofday" and even "--timeofday") but that's not working.
View 3 Replies
View Related
Aug 31, 2010
I need to code a media streamer in java but I found out that I would need the java media framework to simplify the task. I downloaded the bin and need to export it into the files where my jdk packages are at by default. I'd rather not set my path variables because I'm not so good at interfacing with BASH. I just want to start nautilus in sudo and drag and drop like I did with my python packages. I am just having trouble locating the jdk lib.I'm not using openjdk but sun-jdk 1.6.18. My OS is Lucid. The package is JMF2.1.1e. I'm pretty sure I just need the just the lib files from it and none of the executable.
View 1 Replies
View Related
Apr 16, 2011
I get no print to stdout on screen from the C code.Does bash somehow block or mask it?I get print from bash. I get this error in the non-test bash script like: let "rdval = $rdstr"syntax error: operand expected (error token is " ")The let command prints rdval= but I presume this is due to the printf test statements getting in the way.I am getting no compile errors. Why does the C code not print the values specified?
View 2 Replies
View Related
Mar 17, 2011
My question has to do with how environmental variables are passed from parent to child processes at the BASH SOURCE CODE level. I have a need to add an environmental variable that has the complete invocation line so that the child process can see it via ENVP.I have been studying the source for a quite a while and can't seem to find how to make the variable pass to the child. In EXECUTE_CMD.c I found a good place to set the variable: I made a routine similar to PUT_COMMAND_NAME_INTO_ENV called PUT_COMMAND_LINE_INTO_ENV which would add "?=THE FULL INVOCATION LINE" as an environmental variable but it doesn't make it to the child. (I've tried names other than '?' but they don't work either.
I'm thinking that there is either a LIST or a attribute associated with those environmental variables that should be passed to the child but I can't find it.
View 1 Replies
View Related
Jul 28, 2010
I am trying to write a bash script to open 1 screen session with multiple windows... each one running a different service. Is this possible? I tried several things, and I can start up multiple sessions really easy.. but not 1 session with multiple windows...
I want this so I can attach to that session and quickly move between the different windows.
View 4 Replies
View Related
Jul 9, 2010
Gnome sessions started hanging during login on a debian lenny box, and I can only think it's related to a recent package update as it was working fine before the last set. It affects all user accounts and hangs before the applications menu or any icons appear on the panels, but after after the top /bottom panels and the desktop background appears.
View 1 Replies
View Related