473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Running system command

Hi and thanks in advance for your help.

I am trying to restart a Squid Proxy server
within a C cgi program.

I have added the following:
system("/usr/local/squid/sbin/squid -k reconfigure");

but get this error in the log file when I run the program:
"squid: ERROR: Could not send signal 1 to process 19175: (1) Operation not
permitted"

I have also tried:
system("su squid -c /usr/local/squid/sbin/squid -k reconfigure");
but get this error:
"su: must be run from a terminal"

How should I run the "/usr/local/squid/sbin/squid -k reconfigure" command?

Apache runs as nobody.nobody and Squid runs as squid.users
but the squid executable is chmod to 755.

Any and all help is greatly appreciated.

Chip

Feb 1 '06 #1
4 2409
Chip wrote:
I am trying to restart a Squid Proxy server
within a C cgi program.

I have added the following:
system("/usr/local/squid/sbin/squid -k reconfigure");

but get this error in the log file when I run the program:
"squid: ERROR: Could not send signal 1 to process 19175: (1) Operation not
permitted"

I have also tried:
system("su squid -c /usr/local/squid/sbin/squid -k reconfigure");
but get this error:
"su: must be run from a terminal"

How should I run the "/usr/local/squid/sbin/squid -k reconfigure" command?


I'd try the squid-users mailing list.
http://www.squid-cache.org/mailing-lists.html
Feb 1 '06 #2
Chip wrote:
I am trying to restart a Squid Proxy server
within a C cgi program.

I have added the following:
system("/usr/local/squid/sbin/squid -k reconfigure");


this question isn't on topic here. This news group is concerned
with the C langauge and not with platform specific extensions.

I suggest you repost your question in a suitable Unix ng. Try
something like comp.unix...

<snip>
--
Nick Keighley

Feb 1 '06 #3
Thanks for your help.

I needed to change userid with:
setuid(1002);

Chip
"Nudge" <ho******@kma.eu.org> wrote in message
news:43***********************@news.free.fr...
Chip wrote:
I am trying to restart a Squid Proxy server
within a C cgi program.

I have added the following:
system("/usr/local/squid/sbin/squid -k reconfigure");

but get this error in the log file when I run the program:
"squid: ERROR: Could not send signal 1 to process 19175: (1) Operation not permitted"

I have also tried:
system("su squid -c /usr/local/squid/sbin/squid -k reconfigure");
but get this error:
"su: must be run from a terminal"

How should I run the "/usr/local/squid/sbin/squid -k reconfigure"
command?
I'd try the squid-users mailing list.
http://www.squid-cache.org/mailing-lists.html

Feb 1 '06 #4
*** topposting corrected ***
Chip wrote:
"Nudge" <ho******@kma.eu.org> wrote in message
Chip wrote:
I am trying to restart a Squid Proxy server
within a C cgi program.

I have added the following:
system("/usr/local/squid/sbin/squid -k reconfigure");
.... snip ...
I'd try the squid-users mailing list.
http://www.squid-cache.org/mailing-lists.html


Thanks for your help.

I needed to change userid with: setuid(1002);


For future reference, please do not toppost in c.l.c, and please do
observe topicality. While "system" is a part of standard C,
"squid" is definitely not, nor is setuid etc.

Some useful references about C and c.l.c:
<http://www.ungerhu.com/jxh/clc.welcome.txt>
<http://www.eskimo.com/~scs/C-faq/top.html>
<http://benpfaff.org/writings/clc/off-topic.html>
<http://anubis.dkuug.dk/jtc1/sc22/wg14/www/docs/n869/> (C99)
<http://www.dinkumware.com/refxc.html> (C-library}
<http://gcc.gnu.org/onlinedocs/> (GNU docs)
<http://clc-wiki.net> (C-info)

--
"The power of the Executive to cast a man into prison without
formulating any charge known to the law, and particularly to
deny him the judgement of his peers, is in the highest degree
odious and is the foundation of all totalitarian government
whether Nazi or Communist." -- W. Churchill, Nov 21, 1943
Feb 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Spiffy | last post by:
hello, i'm fairly new to python programming and programming in general, but i have written a python prog that creates a MIDI file (.mid) and I want to be able to play it from another prog which is...
6
by: jsw_nz | last post by:
Helo, my first post here.... I am trying to run an agent application that converts and imports two tables from MS Access into mySql. (Intelligent Converters - Access2mySql) I have run similar...
24
by: Thom Little | last post by:
During an uninstall, how can I check to see if the application I an uninstalling is currently running? -- -- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd. --
1
by: Peter Rilling | last post by:
I have an EXE that I would like to be able to run from either the command-line or as a windows service. Is there a way that I can tell which context the program is running in? Basically, if it...
0
by: Titof | last post by:
Hello, i want to create an active webpage that displays the status of users quotas on a volume of a server. I installed IIS on this server and installed Win2k server Resource Kit because the...
9
by: mareal | last post by:
I have noticed how the thread I created just stops running. I have added several exceptions to the thread System.Threading.SynchronizationLockException System.Threading.ThreadAbortException...
3
by: ° ^F®êâK^ ° | last post by:
Blank hi there, I just want to explain my problem. There is an application which is coded by me running. It is an vb.net application having user controls windows forms and something like visual...
7
by: Mike | last post by:
What i want to do is have my c++ program, run a DOS program and copy a script from that DOS program to a file. I simply have no idea, how, or if it's plausable, to run DOS within a c++ program. ...
3
by: WP | last post by:
Hello, I have a very simple script (or would you call it a batch file?) with the following content: connect to mydb2; DROP TABLE staff_employee_address; DROP TABLE...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.