General :: How To Launch Clean Bash Session
Apr 25, 2011how to launch a non-login bash session that doesn't inherit its parents environmental variables, and doesn't source /etc/bashrc?
View 2 Replieshow to launch a non-login bash session that doesn't inherit its parents environmental variables, and doesn't source /etc/bashrc?
View 2 RepliesHow to start an X server as root with a session of non-root application?Should be something like xinit 'su -c openbox user
View 2 Replies View RelatedI've written a script (that doesn't work) that looks something like this:
#!/bin/sh
screen -dmS "somename" somecommand
for i in {0..5}; do
screen -dmS "name$i" anothercommand $i
done
For some reason, if I copy and paste this into a terminal, it creates 7 detached screen sessions as I expect. If I run it from within a script, however, I get only the first session, "somename," when I run screen -ls.
Edit: If the same can be accomplished another way (e.g. with multiple screen windows instead of sessions), I would be open those solutions as well.
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.
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 View RelatedDesktop computer (AMD64) running F12. Nothing unusual about it, stock install. Thinkpad laptop running Windows XP. Putty is installed, I can SSH to Fedora.
If I'm at the laptop, in a Putty session, how can I (for example) type "firefox" and have the resultant Firefox window appear on-the-laptop?
I generally have X running all the time on the desktop because I can't get the wireless network connection to function without NetworkManger (not that I really care because I'm rarely at a console screen and need net access).
i am wondering if it is possible to do this all i can find with google is idea proposals and brainstorms i know i could make a separate account and call it guest user bu that user would get to keep data/settings where as a guest session places a temporary account in the /tmp folder which combined with a ram disk for /tmp would result in some really fast performance since i use a ssd for / which would make the traditional hdd only used for /var also since /tmp would be a ram disk it would be like the guest is using a live cd with security restrictions and performance enhancements on top of this there would be no trace of the guest on my computer after shutdown
View 4 Replies View RelatedI am on an xubuntu live cd setting up gentoo linux. I use screen to make sure that all my compiling and whatnot runs in the background and I won't accidently exit it. I have a script that I have written that autoruns starting my screen session, whenever I insert my thumbdrive. A seprete script should be passed along to screen telling it to chroot into my gentoo setup. However, whenever I use screen -X ./myscript.sh it says that it is an unknown command. How can I pass it along to screen?
View 1 Replies View RelatedBasically, the problem is, we have a bunch of computers in a computer lab, that we want to students to access, but not modify in ANY way. That includes backgrounds or whatnot. And after restart, any changes they may have made, change back. Also, they can't have read access to the administrator account on the computer.
This needs to give a permission denied, or something:
Code:
cd /home/(admin account username)
ls
The Guest Session is exactly what we are looking for, but try as I might, I can't get it to work. Because, we don't want to have to login as administrators, then activate guest session, just for our students to use the computers. The idea being, we can leave the computers in there, and not worry about the students breaking anything.
One thread I tried was: [URL]. However, using his method, will log the student into the account, and after about 5 seconds, log them back out.
The other method listed lower in the thread,
Code:
/usr/bin/guest-session
Seems to work, but upon logging out, fails to launch the gdm
Only way to restore is restarting the computer.
I would love to auto-start tomboy at startup. How can I do this ? [Moderator edit: fixed Subject so nobody would expect an automatic Lunch. Is that the same as a free one? ]
View 2 Replies View RelatedI just downloaded a game Cube 2: Sauerbraten and I am trying to make a shortcut in Application->Games.
Basically to launch a game I have to double-click on a file, which is a script that invokes the rest of the game. After double clicking a dialog shows up that asks me whether I want to edit the file, run in terminal, or just run. I have no problem running it this way, but my shortcut in Applications->Games does not work. I have tried setting shortcut option to "Application" and "Application in Terminal" and nothing happens.
As of now the shortcut command points directly to that start script. I have also tried to do "sh /path/to/game" and still no success. How do I make that shortcut work?
I'm trying to launch CoverGloobus (a fantastic little album art and current song display) and Rhythmbox simultaneously through a BASH script. Problem is that when I attempt to run the script the first time, CoverGloobus doesn't launch, but Rhythmbox does. Here's my script as it is right now:
Code:
#! /bin/bash
#Opens Rhythmbox and CoverGloobus
rhythmbox && covergloobus
done
I've double-checked the commands in gnome-terminal, and they're the right ones for launching the applications. Here's where it gets odd, though. The second time I run the script, CoverGloobus and Rhythmbox launch simultaneously. I've reproduced this scenario multiple times.
I want to write a bash script that will launch a command when ever I plug my phone in. how would I monitor the port in a script.
View 2 Replies View RelatedWhat is the best way to lauch bash script on user logon and logoff?
View 1 Replies View RelatedI'm building my own lightweight desktop with LXDE. After installing minimal Ubuntu (command line mode) from alternative CD, I installed xorg, x11 and lxde-core. After restarting I got this error when starting graphical interface:
Quote:
Xsession: unable to launch "/usr/bin/startlubuntu" X session ---
"/usr/bin/startlubuntu" not found; falling back to default session.
After clicking "Okay" button I could see LXDE interface as normal.
This is my /etc/lxdm/lxdm.conf:
Code:
[base]
# autologin=dgod
# session=/usr/bin/startlxde
# numlock=0
[code]....
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 RelatedI 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.
I have problem with my printer HP Deskjet D1460. My printer is configured and works. When I send a file on the print, the printer clings a sheet of paper and starts to print, but a paper as was clean so clean and remains, after printing.
View 2 Replies View RelatedI configured cron to clean my /tmp directory, should I also add other locations to clean and especially /var/tmp.
View 4 Replies View RelatedInfo about session timeout.
I use tmout = 15 min in my /etc/profile (along with readonly tmout). i have some issues i need to address, looking for ideas.
1. what is considered a idle "session" ?
2. if i & a process to the background and do nothing is this a idle session?
3. if user uses su to a higher level, are there now two sessions? is the tmout for user suspended until su user time outs or leaves su session?
4. i have some users who will run long sql queries. is there a workaround to have the session remain active until process has finished?
Is there any difference between apt-get clean and aptitude clean? Do they both remove the same caches? Should I know any other commands for cleaning up wasted space on my ubuntu laptop?
View 1 Replies View RelatedI got this script that backs up a server and then keeps only the last 10 backups and removes the rest.Problem is, the part where it deletes any backups older than the last 10, it never reaches that. I'm guessing it is because the ftp session somehow exits the script entirely, especially if there is a problem with the ftp session. But just to make sure, I'm wondering if you all can look at the code to see if I am making it exit accidentally.Here's the code. I left out data like ip address and directory/file names for my security purposes.
Code:
#ftp in and grab the file
ftp -in xx.xx.xx.xx << EOF
[code]...
hypothetically speaking, can i write a script in which a telnet session is opened and then some more commands are forwarded to that session?
View 4 Replies View RelatedI have a very bad attempt at hashing the components of an tcp session to assign/locate the session in a hash table bucket. I am pretty sure that it has a very high collision rate and when there are a very large number of tcp sessions my application is having to search a long linked list to find the session within the bucket.
All the hashing functions I have found take a single string input where I need to input several integers and hash them into a single result. My guess is that any real hashing function is going to produce better results than what I am currently doing.
[Code]...
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:
Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END
[code]...
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
Is there a session manager I can use with 10.10? I would like to try Openbox but am not sure how to select it as a startup session. I would like to be able to choose between kde, gnome and openbox.
View 1 Replies View RelatedI am putting together some new systems for my customer and I'm having some trouble with a script that we use to back up files to a DVD R. The problem is that I can't write a 2nd session to the DVD unless I eject the disk and reload it. The drives are slimline type drives, Sony BD-5730S and Teac DV-W28S-V93, so they won't reload without human intervention. Opsys is CentOS 5.4 or RHEL 5.4. I've tried both AMD and Intel based mother boards. If i try this on Fedora 11 or 12 it works fine. This works on IDE attached drives but not a SATA attached drives. Fedora appears to use something called genisoimage instead of mkisofs. I can't get genisoimage to run on CentOS or RHEL.
Here's the code to setup the test files:
rm -f /tmp/BDtest/*
mkdir /tmp/BDtest
dd if=/dev/zero of=/tmp/BDtest/blank.iso bs=10M count=1
for NUM in {1..160}
[Code].....
I have a basic question regarding how to clean up linux disk space. I use "df" to check my disk and found out usage is 100%. SO I use "du -b | sort -r -n > tmp.txt" and found out that /var/spoon/clientmqueue/ has taken the biggest disk space. I deleted the file in that directory using "rm". But after that, I run "df" again, still got 100% usage.
View 2 Replies View RelatedI bought a linuk netbook some months ago, & a friend tried to put windows in it.... Well now i cant get either on it, clean it out & re-install linuk,it does't have a a disk drive in it.
View 14 Replies View Related