01-04-2008
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Problem
I have an application which basically runs lots of UNIX programs remotely, using the Telnet protocol. For each program it remotely executes, it stores the process ID (PID) for that process.
At regular intervals, I would like my application to take the PID for every process still... (5 Replies)
Discussion started by: 1cuervo
5 Replies
2. UNIX for Dummies Questions & Answers
Hi
I'm writing a script which will be run by cron every X minutes.
I don't want cron to run my script again if the previous one has not yet finished.
When the script first runs, I had the idea to store the Process ID in a file. When cron tries to run the script again, I would check the... (5 Replies)
Discussion started by: Bab00shka
5 Replies
3. UNIX for Dummies Questions & Answers
In my last job someone gave me the command to put in my .profile that let me know when a job I had running in the background finished. It was a word about 5 char long. I can't remember it! (4 Replies)
Discussion started by: nkeller
4 Replies
4. Shell Programming and Scripting
So, the script I've been working on, since I was starting to learn Shell scripting is now complete.
This was coded in ksh, and I am very proud of it.
What this script does, is syncs up uid's across the network. So if you have 10 servers, with 10 usernames with different UID's - this will... (1 Reply)
Discussion started by: syndex
1 Replies
5. Shell Programming and Scripting
Hi all,
I am writing a C shell script that starts a program. The program forks of several child processes. Only when all child processes are done, I want to archive my log files. Below is what I have so far, but unfortunately it doesn't work.
MyProgram
if (-e processes.txt) then
rm... (2 Replies)
Discussion started by: Carla
2 Replies
6. Shell Programming and Scripting
I have a file contains
TASK gsnmpproxy {
CommandLine = $SMCHOME/bin/gsnmpProxy.exe
}
TASK gsnmpdbgui {
CommandLine = $SMCHOME/bin/gsnmpdbgui.exe
I would like to comment and than uncomment specific task eg TASK gsnmpproxy
Pls suggest how to do in shell script (9 Replies)
Discussion started by: madhusmita
9 Replies
7. Shell Programming and Scripting
I have an task definition listing xml file that contains a list of tasks such as
<TASKLIST
<TASK definition="Completion date" id="Taskname1" Some other
<CODE name="Code12"
<Parameter pname="Dog" input="5.6" units="feet" etc /Parameter>
<Parameter... (3 Replies)
Discussion started by: MissI
3 Replies
8. Shell Programming and Scripting
I have a script which uses cli curl to download the source code of a webpage and then tests if a specific string exists in the source.
The problem is that the website has a slow response, so the eval expression hasn't completed when the test starts.
The test returns a negative, and the curl... (8 Replies)
Discussion started by: locoroco
8 Replies
9. Shell Programming and Scripting
I am running a macro script from the command line. But the script doesn't wait until the task has finished.
firefox imacros://run/?m=macro_script.iim
firefox imacros://run/?m=macro_script2.iim
How do I get it to wait until the macro has been completed?
I am using imacros, a firefox... (1 Reply)
Discussion started by: locoroco
1 Replies
10. Shell Programming and Scripting
Hello,
I have a script that is running multiple instances of an application in parallel.
# learn on f0
emergent -nogui -p $ScriptLoc/$PROJ fold_tag=f0 &
sleep 5
# learn on f1
emergent -nogui -p $ScriptLoc/$PROJ fold_tag=f1 &
sleep 5
# learn on f2
emergent -nogui -p... (4 Replies)
Discussion started by: LMHmedchem
4 Replies
LEARN ABOUT DEBIAN
capng_change_id
CAPNG_CHANGE_ID(3) Libcap-ng API CAPNG_CHANGE_ID(3)
NAME
capng_change_id - change the credentials retaining capabilities
SYNOPSIS
#include <cap-ng.h>
int capng_change_id(int uid, int gid, capng_flags_t flag);
DESCRIPTION
This function will change uid and gid to the ones given while retaining the capabilities previously specified in capng_update. It is not
necessary and perhaps better if capng_apply has not been called prior to this function so that all necessary privileges are still intact.
The caller is required to have CAP_SETPCAP capability still active before calling this function.
This function also takes a flag parameter that helps to tailor the exact actions performed by the function to secure the environment. The
option may be or'ed together. The legal values are:
CAPNG_NO_FLAG
Simply change uid and retain specified capabilities and that's all.
CAPNG_DROP_SUPP_GRP
After changing id, remove and supplement groups that may come with the account.
CAPNG_CLEAR_BOUNDING
After changing the uid and gid, clear the bounding set regardless to the internal representation already setup.
RETURN VALUE
This returns 0 on success and a negative number on failure. -1 means capng has not been initted properly, -2 means a failure requesting to
keep capabilities across the uid change, -3 means that applying the intermediate capabilities failed, -4 means changing gid failed, -5
means dropping supplemental groups failed, -6 means changing the uid failed, -7 means dropping the ability to retain caps across a uid
change failed, -8 means clearing the bounding set failed, -9 means dropping CAP_SETPCAP failed.
Note: the only safe action to do upon failure of this function is to probably exit. This is because you are likely in a situation with par-
tial permissions and not what you intended.
SEE ALSO
capng_update(3), capng_apply(3), prctl(2), capabilities(7)
AUTHOR
Steve Grubb
Red Hat June 2009 CAPNG_CHANGE_ID(3)