Programming :: Stop Semaphores In C?

Feb 26, 2011

i'm writting a program, that creates semaphores and shared memory. It asks from the user to give anything to write in the shared memory. Now, i want this program to do this,not only once, but repeat, and stop as soon as the user gives the word "quit". i added a while loop, but i don't know how to stop the program.

View 13 Replies


ADVERTISEMENT

Programming :: C - Semaphores, Initiate Semaphores Seems To Be Failing?

Jun 28, 2010

I'm running the following code to initiate semaphores:

Code:
int init_semaphore(key_t semkey, int nsems)
{

[code]...

View 3 Replies View Related

Software :: Posix Semaphores Posting For More Than One Thread At A Time?

Apr 12, 2011

I would like to know can we post more than one thread at a time.I have code like below

Code:
#include <stdio.h>
#include <unistd.h>

[code]...

View 2 Replies View Related

Programming :: C# ; Can't Stop Application Properly?

Jun 8, 2011

I'm developping a C# app in Windows using VS2010. It has one form and communicates as a client with a server.A receive thread displays incoming data while buttons and a timer send data. All workingThe form has a button that calls the below method to disconnect from the server.

Code:
public bool disconnect()
{

[code]...

View 2 Replies View Related

Programming :: Stop User From Invoking Own Signal?

Apr 27, 2011

I have a signal handler in my tool, which is registered and used between some particular interval (i am using timer). Now this signal handler should NOT allow any other handler to be registered or invoked after this handler is once registered. Is there any way to accomplish this?

[code]...

View 6 Replies View Related

Programming :: How To Start/stop Squid Service Using PHP

Oct 21, 2009

Im using PHP and Sun Solaris to do something for Squid Proxy Server. im using......

- LAMP / SAMP
- Linux / Solaris 10
- Squid Server
- PHP

actually i need to know that someone knows about how to start/stop Squid Service using PHP code.

View 2 Replies View Related

Debian Programming :: Script Doesn't Stop And Just Hangs

May 16, 2014

The script below doesn't stop sickbeard, and just hangs. I really can't figure out why.

#!/bin/sh
### BEGIN INIT INFO
# Provides: SickBeard
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6

[Code] ...

View 1 Replies View Related

Programming :: Perl - Stop Range Search At End Of An Array?

Dec 7, 2010

I have data that looks similar to this -

Quote:

John Smith (Address)
123 Main St
Unit 1

[code].....

So I need everything between each name, but I am not guaranteed that each time I match a name that I will have the same amount of lines, so I do a range pattern search line this to get all lines, no matter if there is 5 or 10 or 15. I simply do a loop that goes through the whole array until I hit the match, and this is my search pattern.

Code:

if ($LINE =~ /^s+$SELECTED_NAME/ ... $LINE =~ /(Address)/) {
push @ADDRESS_INFO, $LINE;
}

This works perfectly... until I hit the end and it doesn't get its final pattern match because it's at the end and there is no next entry with a (Address) line. So as a 'hack', I ended up inserting a final scalar at the end of the array that just says (Address) so it knows it's at the end. Ideally though, I'd like to do an "or" statement that says search for Address || return true if I hit the end of the array. How would I match on "End Of Array" essentially?

View 1 Replies View Related

Programming :: Stop Reading Process Without Be Hanged At The Code In Python?

Dec 11, 2010

I have a Python program looks like this one :

Code: import os
import time
process = os.popen("top").readlines()

[code]...

View 2 Replies View Related

Programming :: Bash Step Incremental Loop To Stop On Each Increment?

Jul 17, 2011

How do I get this loop to stop on each increment? This script does work but I would like it to stop at each increment, remember what the value of $n is, then continue until it gets to 7. I have worked so hard on this. My brain is hurting now.

[Code]...

View 2 Replies View Related

Programming :: Make A Script That Will Check Service/s Status Whether Running Or Stop?

Sep 6, 2010

how to make a script that will check service/s status whether running or stop and also will run stop services?

View 9 Replies View Related

Programming :: START And STOP Oracle Automatically On System Startup And Shutdown?

Aug 17, 2009

I have installed Oracle 11g on 5.3. Now, I am trying to START and STOP oracle automatically on system startup and shutdown. I am following this link To have this effect, I have created /etc/init.d/dbora

Code:

#!/bin/sh
# chkconfig: 345 99 10
ORA_HOME=/oracle/app/oracle/product/11.1.0/db_1

[code]....

View 4 Replies View Related

Programming :: Script To Check Startup For Start Restart Stop Centos?

Jun 16, 2010

I have startup scriptsI want to test themI need a script to do the followingstart restart stop for 100 times (or i can set how many cycle)

View 1 Replies View Related

Programming :: Php Stop "internal Row Pointer" When Fetch From Mysql?

Apr 16, 2011

I need to call php function for fetching data from mysql but I dont want to move internal row pointer (IRP) forward. Or even get the actual IRP position then fetch data and move IRP back to remembered position. Function mysql_data_seek() is not suitable for my example because I am trying to fetch data recursive here is code (See the pseudocode commented section):

Code:
<?php
include_once("connection.php");

[code]...

View 1 Replies View Related

General :: Difference Between Restarting/stopping Apache Using 'service Httpd Restart/stop' And Apachectl Restart/stop

Oct 11, 2010

whats the difference between restarting/stopping apache using 'service httpd restart/stop' and apachectl restart/stop. I know that using 'service httpd restart' is actually a script in /etc/init.d/httpd but what about apachectl?

View 1 Replies View Related

Programming :: Start Stop Portal 1 And Portal 2?

Nov 9, 2010

We have multiple servers. WebSphere Portal is running on the servers. Node 1 portals are called WebSphere_Portal and node portals are called WebSphere_Portal_2. We want same script to start and stop portal in all environments.

I am getting following errror message

: No such file or directory1: !/bin/bash
'/WebPortalUptest.sh: line 24: syntax error near unexpected token `in
'/WebPortalUptest.sh: line 24: `case $host in

[Code]...

View 6 Replies View Related

Red Hat / Fedora :: Command To Stop That File/process Or Is It Just Kill The Process To Stop The Process?

Nov 11, 2010

I've some file with .sh extensions that runs some softwares.Now,how do I stop running that filesI know we run the command ./start_tomcat.sh to start the apache.Is there any command to stop that file/process or is it just kill the process to stop the process

View 2 Replies View Related

Ubuntu Installation :: OpenLDAP Slapd / Can't Stop The Service With Service Slapd Stop?

Oct 20, 2010

I am trying to setup LDAP server on Ubuntu 10.04 and am sticking to the old /etc/ldap/slapd.conf file configuration.

I had to comment ldapi:/// from /etc/default/slapd since it was giving 'Address already in use error'. Also had to juggle with pid directory and file issues

After that I was able to start the slapd daemon (service slapd start) but now I am running into multiple issues:

1. Can't stop the service with service slapd stop

Code:
## Service stop returns 0, maybe because start-stop-daemon is not giving error
#service slapd stop
Stopping OpenLDAP: slapd.
# echo $?
0

Will switching to BDB database resolve this ?Also can't I slapcat at non-root user ??

View 2 Replies View Related

Fedora Security :: User Access To Start And Stop Tomcat But Also Gives User Access To Start And Stop Other Services "/etc/sudoers"

Mar 13, 2009

I am trying to give access to ONE single user to start and shutdown tomcat server. The problem being, when I enter syntax: username ALL= /etc/init.d/tomcat5, /usr/local/tomcat/webapps, PASSWD:ALL This gives the user access to start and stop tomcat but also gives user access to start and stop other services within /etc/init.d - such as httpd etc... What is the proper way to give user access to start and stop service, and limiting that power to only one service....

View 2 Replies View Related

Ubuntu :: Can't Stop Gdm Normally

Mar 12, 2011

In Ubuntu 10.04, we're supposed to use the following command to stop the X server (assuming the usual Gnome desktop environment): Code: sudo service gdm stop.The problem is, this has never worked correctly for me. I see a bunch of messages about things being shutdown, then it hangs. I've waited up to several minutes for something to finally happen so I can log in to the command line, but nothing ever happens.What I've always ended up doing is pressing Ctrl+Alt+F4 to switch to a different console. I was then able to log in there and do stuff that required the X server to be shut down, such as installing Nvidia drivers.

Is that how it's supposed to work? It doesn't seem right.Can't post the error message where the command hangs, because obviously I have to be running the GUI to post here. But I'll jot it down next time I try the command.

View 6 Replies View Related

Programming :: 3D Programming - Difference Between JOGL And C++ OpenGL Programming?

Aug 27, 2010

I am interested in learning 3D programming. The thing is, I would hate to put too much effort to learn something that doesn't have future and is dying. My favorite language at the time is Java. My goal is professional programming.

So I have several questions:
1. Should I learn JOGL or start learning C++ and do C++ openGL programming?
2. Is there a big difference between JOGL and C++ openGL programming?
3. Is it worth to learn openGL? Does it have a future?
4. Is it a big difference between openGL and directX coding?
5. If choosing Java, then JOGL or LWJGL?

Why and what is the main difference between them?

View 4 Replies View Related

Fedora :: How To Stop Gtk-recordmydesktop

Nov 14, 2010

Recordmydesktop sounds great. I installed it in F14 with both the gtk and the qt gui. Both of them start the recorder, but I can't find any way to stop it.

I really thought something like this would have some reasonable controls, like a time I could set for it to stop, on some way to stop it manually, but the only way I can find to stop it is to kill the process. If this were true then it would be junk, so surely there is some way to control it.

View 11 Replies View Related

OpenSUSE Hardware :: The Fan Does Not Stop?

Mar 10, 2011

I just installed Opensuse 11.4 in my desktop:

HP Pavilion P6210es
IPMEL_AE (Evans)
Chipset Intel G41 Express
Intel Core 2 Quad Q8300
RAM 4GB

[Code]...

It is in a HD, and I have 2 HD more one with Win7 and the last with Ubuntu 10.10. When I run OpenSUSE 11.4 a fan does not stop, it is always turning. It is is very annoying. It does not happen with the others OS.

View 3 Replies View Related

General :: How To Stop Redirection To /dev/pts/x

Jul 10, 2010

This is an examination senario. We have mulitple users logging into a RHEL-4 server using putty. These people are part of a same group. They are giving UNIX shell script exam.They are helping each other copy the code by using redirection to /dev/pts/x. Is there any way I can stop this redirection?

View 1 Replies View Related

General :: How To Stop Fan Programmatically

May 27, 2011

My system doesn't reacts at writing values below 255 to /sys/class/hwmon/hwmon0/device/pwm(2,3) which correspond to 3-wire case fans connected via M/B (ga-890gpa-ud3h) headers. The idea was taken from [url]

ls /sys/class/hwmon/hwmon0/device/

It indeed shows the actual speed:

But refuses to write to fanX_input: permission denied (even for root).

More specs: kernel 2.6.38.4, sensors output is:

I do not run any daemons for fan control, but suppose the speed may be set by CPU in-kernel governor. How to stop a fan under this conditions without doing hardware tricks?

Upd: part of pwmconfig's output:

Devices:

Found the following PWM controls:

hwmon0/device/pwm2 is currently setup for automatic speed control. In general, automatic mode is preferred over manual mode, as it is more efficient and it reacts faster. Are you sure that you want to setup this output for manual control? (n) y hwmon0/device/pwm3 hwmon0/device/pwm3 is currently setup for automatic speed control.

In general, automatic mode is preferred over manual mode, as it is more efficient and it reacts faster. Are you sure that you want to setup this output for manual control? (n) y

Test:

Warning! This program will stop your fans, one at a time, for approximately 5 seconds each! This may cause your processor temperature to rise! If you do not want to do this hit control-C now!

Hit return to continue:

Would you like to generate a detailed correlation (y)? y

This was stopping CPU fan. And:

View 2 Replies View Related

Ubuntu :: Stop 10.4 From Autolocking?

Apr 23, 2010

anyone know how can I stop ubuntu 10.4 from autolocking?

View 5 Replies View Related

Ubuntu :: When Does Sshd Stop

Jul 7, 2010

I see in /etc/init/ssh.conf that sshd is designed to start on filesystemstop on runlevel SI understand that runlevel S is single user.Which says to me that sshd is not stopped on shutdown (runlevel 0).Also, sshd is in /usr/sbin/sshd and furthermoresudo lsof -p <sshd_pid>shows that it uses lib files in /usr/lib.So, my question is, if sshd is not stopped on shutdown YET sshd uses files in /usr, then how can/etc/rc0.d/S40umountfsever successfully umount /usr during shutdown when /usr is on its own partition? sshd should still be using the files, meaning the file system is busy. right?Yet, I'm pretty sure that my shutdowns used to complete successfully. (Edit : I guess they didn't - see next post)

View 2 Replies View Related

Ubuntu :: Fan Won't Stop Running?

Sep 12, 2010

I have a HP Pavilion dv5t series . The fan won't stop running, it started running right after all those updates came thought. The fan starts right when you turn the computer on, and it won't stop. The computer is also very hot, so the fan isn't being effective, How can I fix this before my computer dies?

View 2 Replies View Related

Ubuntu :: Random Log Out / Stop This?

Jun 5, 2011

I have been experiencing some random log out, specially in times like downloading big files, and consequently messing up my downloads. It's like browsing internet, a few other applications opened an out of nowhere a black screen an command boot load and then log in screen asking for password. This has been happening since I installed natty. I experience any kind of crash alert, freezing or slowdown before it happens, just out of the sudden it happens.

Any advice, help? How do I report a bug without a clear idea of what's going on?

View 1 Replies View Related

General :: Stop A KDE X-server?

Jan 8, 2010

I'm running a pc with dual boot windows7/suse.

I'm trying to install my NVIDIA video driver but keep getting the error message that an X-Server is running. I am assuming that would be my desktop.

How do I stop an X-Server in KDE? I think I know how it is done in Gnome.

View 7 Replies View Related







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