Ubuntu Servers :: Prevent A BASH Script From Being Called To Run Again Until It Exits

Sep 1, 2011

I'm planning on writing a BASH script for my website's server that will process data from user input via HTML forms, and then write data to the website's HTML documents. My question regards how to deal with the possibility that two users send form information very close to the same time, thus having the BASH script being called again while the first instance of the script has not yet finished.

I don't even know what happens in general when a BASH script is called while it is still running. Even if that is ok, and a new, separate script process is started (or whatever really happens), how am I supposed to prevent issues that could come from two different instances of the script trying to write to the same file at the same time? Is there a way to force the BASH script to finish its work before launching again, in the event of multiple requests?

View 6 Replies


ADVERTISEMENT

General :: CentOS 5.4 - Bash Script Exits SU Or SSH Session

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

Programming :: Bash And Can't Find How To Say "if File1 Exists And File2 Exits Then..."

Aug 17, 2010

I'm learning Bash and can't find how to say "if file1 exists and file2 exits then...".I thought this may work:

Code:
file1="/root/file1"
file2="/root/file2"

[code]....

View 5 Replies View Related

Programming :: Loading Environment Into Bash Script Called By Cron?

Mar 18, 2010

Script programming question for the experts. I have written a bash script that works fine if I execute from the shell interactively. However, once I schedule it to be executed via cron, it just wouldn't work. I believe this has to do with cron running in a different environment than the one I am in when I putty in.

The bash shell script does refer to environment variables in the .cshrc file. I guess these aren't available to the cron? How can I load them into the script if I want them to be available to the cron locally within the script?

View 1 Replies View Related

Programming :: Destructor Called On Objects In Deque Without It Being Called Explicitly

Jul 13, 2011

I feel there's a bit of a misunderstanding going on between C++ and me...My problem is that I have a deque of pointers to a class, and create objects then add them to the deque in a for loop. However, the destructor is called on the object as soon as the loop quits.

Code:

This prints:

Code:

Now, if I change the deque from deque<Test*> to deque<Test> then it works fine - I get:

Code:

However, I can't do this with my actual code, because I am creating a deque of pointers to an abstract class, so it won't let me instantiate the class. (This is all so that I can take advantage of polymorphism, and call functions on a set of similar objects without worrying what type of object I'm dealing with).

So, I suppose my question is: what is the correct way to create that deque of pointers to the abstract class? I don't seem to be barking up the right tree currently.

View 4 Replies View Related

Ubuntu Servers :: Uninstall - Unable To Get One Software Up And Running (called Hprsm)

Mar 4, 2010

I installed Ubuntu 9.10 server on a HP Proliant DL380 G3 for testing. I neede to install some software from HP (Value add software pack) In this software pack I was unable to get one software up and running ( called hprsm ) I tried installing several times and allways ended with " The hprsm RPM installation failed! " I then tried to uninstall the software " dpkg --purge ... " and "rpm -e ... " and even " rpm -e --force-debian .... " but I can not uninstall it. Now when I install other software i keep getting " The hprsm RPM installation failed! " when I do " find / -name hprsm " I get :

[Code]....

View 6 Replies View Related

OpenSUSE :: 11.3 Kde4 - Prevent Konsole/htop/bash To Use Bold Character?

Aug 9, 2010

As exposed in a previous thread : 11.3 64b nvidia kde4 : font color bug in konsole I have a problem in the konsole terminal . I chose the Fixed [misc] font and i want the size 3. But for some unknown reasons konsole wants to display some chracaters and some words in bold . As This font doesn't exist in size 3 in bold, it displays the bold characters in size 7, which is the smallest available bold size for this font set (Fixed [Misc]) . It makes any of these bold characters unreadable as they are too large compared to the room they have to be displayed. How can i prevent konsole , bash , htop or any program responsible for this behaviour, to display such bold character ?

View 3 Replies View Related

Ubuntu Servers :: Prevent PHP From Accessing Files Above Wwwroot

Sep 12, 2010

I'm running Apache2 and PHP5, hosting multiple virtual domains on my server. The directories of the domains (/var/www/<domain>) aren't publicly readable, so the websites can't access each others content as the scripts are run using different user accounts. They can, however, access other folders on the system that have public access for any user. I tried using the following PHP code, which listed the filesystem root:

Quote:

<?php
$handle=opendir("../../../..");
while($file=readdir($handle)){
echo $file . "<br/>";
}
?>

I will be hosting sites for other people so I don't want them to be able to access my entire server with PHP. Is there any way i can do this?

View 2 Replies View Related

Ubuntu Servers :: Prevent Certain Group Of Users From Using Sudo At All

Jul 1, 2011

I have a box with about 30-40 users on it, and I need to prevent a certain group of users from using sudo at all. Is this even possible.

View 4 Replies View Related

Programming :: Bash Code To Prevent Redundantly Including Files, Like Php's "include_once"?

Jul 13, 2010

I wrote some bash code to prevent redundantly including files, like php's "include_once". I've simplified it here so don't worry that it appears not to do anything:

Code: alias .='Include'
alias source='Include'
export __INC__functions=1

[code]....

View 1 Replies View Related

Ubuntu Servers :: Postfix And Prevent Clients To Connect To Port 25 Without Authentication?

Jan 29, 2011

I'm a NOOB setting up Postfix but managed quite well by following the Ubuntu Server guide. I have managed to set it up using SSL but testing a mail client like thunderbird I can also connect to port 25 using no authentication. Connecting using SSL on port 465 by editing "master.cf" file works but 25 i still open.

1. How do I prevent clients to connect to port 25 without authentication?
2. I guess I have to have port 25 open in order to receive mail from the outside world?

View 2 Replies View Related

General :: Prevent Postfix From 'retrying' Emails To Yahoo - Mail Servers?

Jun 12, 2011

I have a problem with my VPS not being able to send any emails to Yahoo! addresses. Each time someone with a mail account tries to send something to a Yahoo! address, the email stays stuck in the mail queue and a 'delayed mail (still trying)' message is sent back to the user. I understand that Yahoo! has a tendency to block mail servers on a whim, but what I'd like to know is, how can I prevent Postfix from specifically retrying to send emails to Yahoo! mail servers? I don't want to stop retries to other mail servers.

View 1 Replies View Related

Ubuntu :: Desktop Not Repainted When VLC Exits?

Sep 8, 2010

I'm running VLC (full screen mode) on Ubuntu 10.04 with the gnome desktop. When I exit from VLC, it does not repaint the desktop. It leaves the entire screen white. I can click on the screen, and this causes the rectangle formed by the upper left corner of the screen and the current mouse position to get repainted. So, by clicking on the screen near the bottom right corner will repaint the desktop (mostly). Does anyone know how to fix this?

View 2 Replies View Related

Ubuntu :: Firefox Prompt Whenever Exits Certain Sites

Jul 15, 2010

Whenever I exit certain sites, a prompt opens saying something along the lines of "Wait! You're gonna miss out on a crazy deal! .....!" And you have to press Ok to exit page or press Cancel to stay on site. On Chrome this doesn't show up. What addon will get rid of this. I'm hoping you guys are the firefox experts I think you are.

View 1 Replies View Related

Fedora Servers :: Windows PC Antivirus Picked Up A Trojan Horse Called "PHP/Rst.AK Trojan"

Feb 19, 2009

after compressing one of my sites and downloading it to my Windows PC my Antivirus picked up a trojan horse called "PHP/Rst.AK Trojan" Im still very new to all this and was wondering how i go about removing malware etc from my fedora 8 server. IS there a free virus scaning software i should be using ?

View 3 Replies View Related

OpenSUSE :: KDE Help Center On 11.2 Does Not Exits

Jul 12, 2010

I will describe the steps that produce the error:

0.My home directory is leon
1.Open KDE Help Center
2.Go to Search Tab
3.Application Manual Index Status OK
4.Select Application Manual Index
5.Write the search term "lskat" and press Search button
6.Click on the only result

The following message box appears: The file or folder help:file:///home/leon/.kde4/share/apps/khelpcenter/index/kde_application_manuals.tmp/index.html
does not exits

Also in the main window of khelpcenter the following message appears: There is no documentation available for /file:/home/leon/.kde4/share/apps/khelpcenter/index/kde_application_manuals.tmp/index.html

View 4 Replies View Related

Ubuntu Multimedia :: Flash Exits Fullscreen Every 10 Minutes / Fix This?

Jul 6, 2010

I am using lucid and the adobe-flashplugin 10 package. When I watch programmes in fullscreen on the BBC iPlayer or Channel4-on-demand player it works fine but switches back to windowed mode after about 5 or 10 minutes. I put it back into fullscreen and the same thing happens after the same sort of time. I read this thread about flash switching out of fullscreen when the volume is adjusted, but I'm not adjusting the volume...how can I fix this?

View 3 Replies View Related

Fedora :: Texlive Package Exits In F12?

Nov 30, 2009

is texlive package exits in fedora 12 ?i haven't found it.in previous release of fedora i was just installing kile and latex was working but in fedora 12 i think that tex doesn't exist.i wanna to know if it exist or not

View 2 Replies View Related

Ubuntu :: Flash Exits Out Of Full Screen When Changing Volume

May 14, 2010

i know this is normal when you use ubuntu but i was wondering if there was a way to change this or fix this. i noticed when you play a flash movie (like a videos video) in full screen and you change the volume using the volume keys on the keyboard, it exits out of full screen mode.

View 4 Replies View Related

Ubuntu Installation :: Exits Back To Login Screen After Boot

Nov 21, 2010

I had Kubuntu 10.04 installed, I screwed up a bunch of stuff in it and it would hang after the login screen. I reinstalled Kubuntu 10.10 (formatted the partition with Kubuntu on it) but I kept my /home partition in tact. NOw, when I log in, i starts to load, and then KICKS ME OUT, back into the log in screen. The user does exist, I can access the user from the console, but when I try to get into Kubuntu, it kicks me back out to login. What on earth is going on? I've tried failsafe mode as well as regular login. neither works.

View 2 Replies View Related

Debian :: Squeeze Archiver Exits With An Error Of 256?

Nov 2, 2010

I'm getting the following error when trying to extract a rar file using Squeeze in XFCE.

"Command exited with status 256."

View 1 Replies View Related

OpenSUSE :: Debugger Exits Without Stopping At Breakpoints?

Sep 14, 2010

openSUSE 11.1
KDevelop 3.5.5 using KDE 3.5.10 "release 21.12.1"
gdb 6.8.50.

Problem: When I attempt to debug my program with breakpoints set the debugger does not stop at breakpoint. Message in gdb window is:

/bin/sh -c libtool gdb .../C++/Graphyxs/debug/./src/graphyxs --interpreter=mi2 -quiet
(gdb) set print static-members off
(gdb) Process exited

Attempted fix: Some forum posts suggest KDevelop upgrade. Upgraded from 3.5.4 to 3.5.5; gdb upgrade not available in openSUSE.

Other posts recommend assurance that debugger options are properly set. KDevelop Project Options has Compiler Flags -O0 -g3 with "debug" configuration.

View 1 Replies View Related

OpenSUSE :: Yast Exits After Install Of Packages?

Nov 18, 2010

Is it possible to configure Yast Software Manager module so that it does not completely exit when done installing a package? It get's annoying to search for a package and install it, the software manager exits, you then have to reopen it, install another etc. a few minutes later.

Seems this would be a config option, but if so I can't seem to find it.

View 5 Replies View Related

General :: Script Has 5 Functions But Exits Only After 2nd Function?

Jan 25, 2011

Quote:
logcountfunction()
{
awk ' {
# when executing the script pass the logfile as parameter on the command prompt with the name of the file
#export file_name= "&1"

[Code]....

my problem is that when i execute this script only the first two functions are being called.once the DBcounttry_finalnofunc() is done ,the script exits.The rest of the functions are not being called.

View 1 Replies View Related

Debian Multimedia :: On Resume X Server Exits With Errors

Oct 2, 2015

I have new hardware (Nvidia Geforce GTX 960) which required new drivers. I'm running jessie but had to install the driver version 352.30 from the experimental repo. Everything seems to work fine, except after a suspend. On resume, the X server exists with errors, and I'm dropped back to the Linux console.

I've done a fair amount of searching, but the problem most people seem to have is corruption or black screen. I'm getting something equally annoying but less severe: I just get dropped back to the shell, but as soon as I restart the X server with startx everything continues to work... until the next suspend.

My full Xorg.0.log is at [URL] .... . Here are the errors that appear after the suspend:

Code: Select all[  1772.779] (--) NVIDIA(GPU-0): DFP-6: disconnected
[  1772.779] (--) NVIDIA(GPU-0): DFP-6: Internal DisplayPort
[  1772.779] (--) NVIDIA(GPU-0): DFP-6: 960.0 MHz maximum pixel clock
[  1772.779] (--) NVIDIA(GPU-0):
[  1772.792] (II) NVIDIA(0): Setting mode "DFP-6:nvidia-auto-select"
[  1772.792] (WW) NVIDIA(0): Failed to set the display configuration

[Code] ....

The monitor is a Dell P2715Q running in its native 3840x2160 resolution at 60Hz.

View 1 Replies View Related

Fedora Networking :: Can't Create Vpn Connection - Cannot Save And Exits Out

Jun 17, 2010

I am running Fedora 13 Gnome. When I try to create a VPN connection using Network Manager (vpnc) it says that it cannot save the connection and exits out. I can provide other information if necessary.

View 3 Replies View Related

General :: Echo Command Error - File Exits

Mar 17, 2010

I faced a issue with updating a file contents with echo command which fails with error as below:
echo "foo" > bar //to create a file named "bar"
echo "foobar" > bar //to edit its contents

The latter fails, it prompts "File exists" i.e.
~>echo "foo" > bar
~>echo "foobar" > bar
bar: File exists.
~>cat bar
foo
~>

View 4 Replies View Related

Fedora :: Kernel Build Links To Folder That Doesn't Exits?

Oct 7, 2009

I am having problems install VirtualBox and followed the errors to see that the link for Build (2.6.29) links to a non existent folder.

I also find it weird that there is actually a 2.6.30 kernel folder as well.

Not sure if this is just n00b issue, but VBox won't install and I was wondering why one of the kernels listed would link to nothing...

View 11 Replies View Related

General :: Grep Exits Abnormally With Code 123 When Running Rgrep On Emacs

Oct 7, 2010

I'm running GNU Emacs 23.1.1 on "Ubuntu 10.04.1 LTS" and any search I perform using the built-in M-x rgrep on the standard Linux kernel source code (vanilla) ends prematurely with the following error printed to the emacs echo area:Grep exited abnormally with code 123.I have been seeing it for a while on Redhat systems as well, and with other (large) code bases.

View 2 Replies View Related

Ubuntu Servers :: New Users Don't Have Bash History?

Nov 23, 2010

installed Ubuntu Server Edition and I've found that my first user has a bash history and I can turn on a coloured prompt by editing my .bashrc etc but new users don't have that!I did : useradd -d /home/newb -m newbpasswd newband the correct looking .bashrc file appears to be in /home/newb but it is being ignore by bash when logged in as newb. Instead I am presented with just a dollar prompt instead of "newb@server"how can I sort out my users with proper prompts?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved