General :: Restricting 'du' To Child Directories Only?
Feb 15, 2011
I'm trying to write a script that uses the 'du' command to make essentially a text-based filelight type program. It should scan the current directory for the file's sizes and display them in order largest to smallest (or vice versa). The user should be able to go throughout the file tree and see child directories scanned for the sizes as they're accessed. I just need to know one more thing- how can I restrict the displayed results to the current working directory? would a grep for the output of pwd suffice? just getting some thoughts before i try and possibly dig myself a hole.
View 1 Replies
ADVERTISEMENT
Feb 16, 2010
I need some kind of step by step process to restrict my users to only have access to directories that I specify ? For example user joe can only access his home directory, read access to /tmp and read access to /var/log/httpd
View 1 Replies
View Related
Apr 13, 2010
Is there a way to restrict users that are logged into the shell via SSH/Telnet/SFTP from using the 'cd' command to move into certain directories, yet not use the chmod command to do it? For instance, restrict users logged in from accessing the /var/www/ folder but have it still accessible using a web browser. Also, would this defeat the purpose since they could just wget from it if its still web accessible through a browser?
View 8 Replies
View Related
Jul 30, 2009
I am troubleshooting something and I got this problem.
If I do "pstree -p"
It shows,
Code:
[code]....
However, it does NOT show up in "ps -elf"
Code:
ps -elf | grep soffi
0 S whho 7734 1 0 80 0 - 36435 - 11:14 pts/2 00:00:03 /usr/lib/openoffice/program/soffice.bin -splash-pipe=5
0 S whho 7833 7759 0 80 0 - 751 - 11:21 pts/3 00:00:00 grep soffi
I was wondering if 7735, 7736, 7737, 7743 were really processes. Then I checked /proc, I could cd to /proc/7735, /proc/7736, etc, but I could not ls them out. I looked at the man page of "pstree", it says,
Code:
Child threads of a process are found under the parent process and are shown with the process name in curly braces, e.g.
icecast2---13*[{icecast2}]
So, what does all this mean? Does it mean that 7735, 7736, 7737, 7743 are just threads but not processes? If so, why could I cd to /proc/<id> but not see them in "ps -elf".
View 10 Replies
View Related
May 23, 2011
I have a doubt about signals in C programming. I have done this little program to explain it. It creates a child process with fork and, when the child ends, receives the SIGCHLD signal and wait for its termination.Ok, quite easy, BUT when I execute this code the SIGCHLD signal is received twice, first as an error (returns -1) and the second one to finish the child process.I don't understand the meaning of the first received signal. Why is it generated? Is the code wrong? (if you add the SIGINT and press Ctrl+C during the execution it also receives two signals instead of one)
Code: #include <stdio.h>
#include <unistd.h>
#include <string.h>
[code]....
View 4 Replies
View Related
Dec 19, 2009
i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.
View 14 Replies
View Related
May 15, 2011
I want to make a webserver with multiple users allowed to login through SFTP to a specific folder, www.Multiple users are added, lets say user1 and user2, and all of them belonging to the www-data group. The www directory has an owner www-data and a group www-data.
I have used chmod -R 775 on the www folder, but after I try to create a folder test through my SFTP server (using Filezilla) the group of the directory created has only r and x permissions, and I am not able to log in with the second user user2 and create a directory within www/test due to a lack of w permission to the group.
I also tried using chmod 2775 on www directory, but without luck. Can somebody explain to me, how can I make it so that a newly created directory inherits the root directory group permissions?
View 2 Replies
View Related
Apr 22, 2010
I have an internet and mail server installed CentOS, and I want to restrict client machines to access a certain website, e.g. if i want restrict users from accessing the website: www.mydomain.com, How do I do it?
View 6 Replies
View Related
Mar 23, 2011
I am writing a script, in that my requirement is, if all the fill types stored in one directory from that we need to separate different different directories based on the file types.
for example in a directory(anish). 5 different types files
1- directory
2- .txt files
2- .sh files
like that and my requirement is the (1- directory is moved to one new directory(dir) which we are given in the script)and (2 .txt files are moved to another new directory(test) which we are given in the script)and ( 2 .sh files are moved to another new directory(bash) which we are given in the scrip)finally the directory anish should be empty..using bash script.how it is possible !!
View 7 Replies
View Related
Dec 7, 2009
Consider the following code:
Code:
int main()
{
int i=0;
pid_t pid;
for(i=0;i<2;i++)
[code]....
I get the following output:
Parent: chid_pid=4356 i=0 parent's pid=4355
This is child 4356 i=0
This is child 4357 i=1
[code]....
I can observe instead of two children(as I expect) processes there are three. This is because child process 4356 creates its own child. Why all the messages of the type "This is child X i=Y" are concentrated one under another? How exactly fork works? Is affected by the fact that I have a dual-core processor?
View 3 Replies
View Related
Feb 4, 2010
I have following script.
Code:
#!/bin/bash
export VAR="shell"
echo " $VAR in parent "
bash
echo "shell in child "
If i execute this script, the output is just
Code:
shell in parent
Why can't I see the output shell in child ?
View 2 Replies
View Related
Dec 12, 2009
I want to restrict the Visitors to my Webserver whom i want to give access But the persons whom i want to give access. have Dynamic IP. I want to use DynDNS and update IP address of person. Based on the Hostname Pointing to Dynamic address of person.
View 5 Replies
View Related
Dec 17, 2010
What happens to a child process that dies and has no parent process to wait for it and what's bad about this?
View 2 Replies
View Related
Jul 27, 2011
In my program, I fork() to get a child process. Because of some problem, child process terminates by a segmentation fault. Parent process is still running. I have compiled my code with -g option. I have done: ulimit -c unlimited. I am not getting core dump of the child process. How can I get the core dump of child process?
View 1 Replies
View Related
May 20, 2011
I have created three child process from one parent. And different child has different functions. Child 2 has got function to load file called "wc" to count file1 and and its required to get their files by command line arguments. I can get the files through command line but couldn't get the files when child 2 process start.
View 9 Replies
View Related
Nov 17, 2010
I want to check all the child processes attached to a specific process. Say for a example; my process is a java process. Then I wanna know what are the processes attached to that java process. At the moment I use the command # ps aux|grep java; this gives the details about the currently running java process. So I can kill the whole java process using #kill -9 {pid} ...but there are sub processes attached (I guess child processes) to java process. I wanna view all of them & kill whatever the process I like not the whole thing. I'm using Red hat 5 enterprise edition. and currently a weblogic application server is running on that.
View 2 Replies
View Related
Sep 6, 2010
I work on Linux for ARM processor for cable modem. There is a tool that I have written (as the job demands) that sends/storms customized UDP packets using raw sockets. I form the packet from scratch so that we have the flexibility to play with different options. This tool is mainly for stress testing routers.I actually have multiple interfaces created. Each interface will obtain IP addresses using DHCP. This is done in order to make the modem behave as virtual customer premises equipment (vcpe).
When the system comes up, I start those processes that are asked to. Every process that I start will continuously send packets. So process 0 will send packets using interface 0 and so on. Each of these processes that send packets would allow configuration (change in UDP parameters and other options at run time). Thats the reason I decide to have separate processes. I start these processes using fork and excec from the provisioning processes of the modem. The problem now is that each process takes up a lot of memory. Starting just 3 such processes, causes the system to crash and reboot.
I have tried the following:-
1-I have always assumed that pushing more code to the Shared Libraries will. when I tried moving many functions into shared library and keeping minimum code in the processes, it made no difference to my surprise.
2-I also removed all arrays and made them use the heap. However it made no difference. This maybe because the processes runs continuously and it makes no difference if it is stack or heap?
3-I suspect the process from I where I call the fork is huge and that is the reason for the processes that I make result being huge. I am not sure how else I could go about. say process A is huge -> I start process B by forking and excec. B inherits A's memory area. So now I do this -> A starts C which inturn starts B will also not help as C still inherits A?. I used vfork as an alternative which did not help either. I do wonder why.
View 1 Replies
View Related
Apr 21, 2010
Recently I have renovated an old computer which once belonged to my dad (the old HDD crashed, and I just bought a new one to replace it). My parents want me to fix this computer for my 5-year-old sister to use. I decided to use Linux Mint as the OS because everything (flash, mp3, etc.) is already configured.
How do I create a user account in Linux Mint with limited access for my sister, so that it won't mess up the entire system?
All she does is surf the web, so I'm just worried that she might accidentally mess up a system setting that I eventually will have to fix it.
View 2 Replies
View Related
Apr 26, 2011
I have setgid permission on my home directory (/home/XXXX) the permission look like below.
Code:
drwxrws--- 2 toshi jadu 4096 Apr 26 16:54 getset
If I create new directory in this getset folder the permission of getset folder could not inherit.
Code:
#cd getset
#mkdir test2
#ls |grep test2
drwxr-s--- 2 toshi jadu 4096 Apr 26 16:56 test2
As I know the setgid utility allow to inherit the permission from parent directory to child directory.
View 4 Replies
View Related
Apr 21, 2011
I have a script that calls other scripts/commands which may or may not spawn other process. From my understanding, when I do a ps -ef, the highest numbered process ID is supposed to be the parent ID of all the other related child processes, is this correct? In most or all circumstances, I do a ps -ef | grep <processid> of my script and anything that spawns off that process IDs I assumed are the child processes of my script. If I want to terminate my script and all other child processes, then I kill the parent ID which is the highest numbered PID and this will subsequently kill all other child process IDs, is this correct?
Now, my question is whether there is any quick way of showing what are the child processes of a parent ID instead of what am currently doing now which is visually checking which one is the parent ID and "assuming" that the highest numbered PID is the parent ID of all the other processes. Below is a sample output of running ps -ef | grep exp | grep -v grep. I assume from the output below that the parent process/ID is PID 11322, is that correct?
Code:
oracle 11154 11153 0 21:20 ? 00:00:00 /bin/sh -c (. ~oracle/.profile; /bin/ksh /usr/local/oracle/scripts/expdp_o
oracle 11155 11154 0 21:20 ? 00:00:00 /bin/sh -c (. ~oracle/.profile; /bin/ksh /usr/local/oracle/scripts/expdp_o
oracle 11190 11155 0 21:20 ? 00:00:00 /bin/ksh /usr/local/oracle/scripts/expdp_schema.ksh dev01
oracle 11322 11190 0 21:20 ? 00:00:00 expdp
View 2 Replies
View Related
Aug 27, 2010
Iv got an assignment to complete and I'm stuck at the basic level.
A part of the assigned problem is :
The main process will read the file, and will create N number of child processes (Where N is taken as input) as early as possible before all the children starts its execution. Before creation of each child, the main process should read the file to store all the required data in then corresponding data structure. Child processes should not read the file for getting their information.
As far as my knowledge about this , the child executes before the parent. How do I make the parent not pass the control to it's children before it finishes creating all the children?
View 3 Replies
View Related
Aug 26, 2009
I wonder how one can, if at all, run an X program in the background *in an emulator sub-shell process*. What I mean is to launch a program in an emulator, e.g, by xterm -e gedit
but with gedit (in this example) running in the background from inside the xterm sub-process, so that the xterm will accept other commands. In the above, gedit will run in the foreground, and of course, if you do
xterm -e gedit &
then xterm will run in the background, not gedit.In short, I would like to achieve the same thing as "gedit &" as you manually do in xterm, but from another shell. What I aim to do is write an X init script to achieve this result (to have the emulator open and a program or two running from it, in the background, at the X startup).
View 2 Replies
View Related
Nov 2, 2010
I'm studying about signal in Linux Kernel and I got a problem about signal handler and output buffer.
I just want to know about stdout buffer related parent process and child process.
The problem is - parent process received SIGINT signal_handler that I implement is called. And after signal_handler is called, it print string "pid : xxx state : RUNNING" ... but after end of signal_handler function, child process might be print string but it isn't print at all.
I'm not asking right code, but I want to know why is this happened and concepts about signal handler, buffer - between parent process and child process.
here is a code signal_handler:
Quote:
void TC3_handler()
{
pid_t pid;
ProcState ps;
pid = GetProcessId();
[Code]....
chlid process counts number in infinite loop, but after call signal_handler, it can't print at all.. just waiting for SIGINT..
View 2 Replies
View Related
Jul 22, 2010
I am facing an issue where the process starts hanging. When I closely look at the logs I come to know that some of the child processes that are forked by the parent process are not finished.
1) Is it possible that the child processes that are not finished occupy the socket memory of the parent process and ultimately a point is reached where no socket memory is available to fork new child processes.
2) What is the standard limit of socket memory in linux?
3) What is the fate of such child processes (as I have mentioned above)?
4) How to debug such cases so that the exact problematic area is identified?
View 2 Replies
View Related
May 23, 2011
I installed Centos 5, httpd 2.2.3 and php5.3.6 with yum.
We have a website which can upload JPEG file to the server via php. But when we uploaded file, it showed the error
Quote:
child pid 13810 exit signal Segmentation fault (11)
I tried to run gdb on my computer and it showed that
Quote:
0xb6d1a600 in ?? () from /usr/lib/libjpeg.so.62
View 1 Replies
View Related
Feb 15, 2011
well i have just started with shell scripting...how to find all child processes of a parent process given to script as argument.
View 10 Replies
View Related
May 17, 2011
I have a SSD that is a SATA-IF YOU NEED MORE INFORMATION PLEASE DO NOT HESITATE TO CONTACT ME. and can run at 3.0 Gb/s - in the error log it is being restricted to 1.5.... I have no propritary drivers, (apparently) that need updating - is there anything else I can do to get the full speed?
View 3 Replies
View Related
May 30, 2010
I have setup firefox for certain users, with specific extensions. I would like to know which directories to restrict so that no new extensions can be installed, but the currently installed extensions will be able to update without a problem.ba
View 1 Replies
View Related
Jun 29, 2010
I have a desktop (picard), and I want to be able to connect to it from my sisters laptop (zuma) to quickly scp files from my machine to hers. At the same time I don't want the whole world to be able to connect to my machine via SSH. We're connected through a router. I've tried adding the line
"ListenAddress 192.168.0.0"
to /etc/ssh/sshd_config, but this prevents me from being able to connect to my machine from another on the network. From my understanding of the ListenAddress directive, I would assume "ListenAddress 192.168.0.0" would allow my sister's address through (192.168.0.192).
Am I missing something?
View 1 Replies
View Related
Feb 4, 2011
In my office i want to setup a Linux machine for public usage , in this machine i want to restrict/deny access to certain applications (ex:- k3b, xterm , pdf reader etc) for certain users/group of users as per the office policies.
1)By what method/procedure i can achieve this objective ?
View 3 Replies
View Related