I am trying to find a way to check the current status of a file. Such as some cron job processes are dependent on the completion of others. if a file is currently being accessed / modified or simply open state I will wait until it is done being processed before attempting the next process on that... (3 Replies)
Hi,
look at the following code:
The client after estabilishing a connection with the server does the following:
if ((peter = fopen(argv, "r")) == NULL){
printf("errore\n");
exit(0);
}
... (11 Replies)
I have a requirement to close all the file descriptors from 3 to 1024 for a particular application.
Right now, this is how I do it ..
for ( int i = 3 ; i <= 1024; ++i )
close(i);
The change I am looking at is, I want to do away with the number 1024 and replace it with a constant which... (4 Replies)
Im working on writing a small operating system. I am currently working on implementing dup, dup2, pipe, and close and I need to implement some type of file descriptor table in my PCB.
I was wondering if there is anyone who is familiar with linux/unix implementation of these tables who could... (6 Replies)
Hello All,
Im opening a file desciptor in perl and sending data using print CMD "$xyz".
is there a limit to the length of the string that I can give to this CMD at a time. (3 Replies)
I am trying to write a script which will only show me the file descriptor count for a process/pid. My script will return me the count only not the whole output. For example, I would like my script to return the output 23 this case, not the whole output.
Can anybody please help me how do I get... (11 Replies)
Hi,
I am trying to read a file line-by-line in a while loop, and perform some tasks which involves non-interactive SSH to a remote server. The code looks something like this --
#!/usr/bin/ksh
export myFile=/path/to/my/file.load
while read line
do
do something
## Adding the SSH... (2 Replies)
Greetings.
I am happily using constructs like the following; I have set -x to show fine distinctions.
$ exec 4> afile
+ exec
+ 4> afile
$ print -u4 This is the first line in afileAs you can see from the -x expansion, the shell performed the exec command and redirected file descriptor to... (4 Replies)
Discussion started by: rpaskudniak
4 Replies
LEARN ABOUT DEBIAN
checkrestart
checkrestart(1) debian-goodies checkrestart(1)NAME
checkrestart - check which processes need to be restarted after an upgrade
SYNOPSIS
checkrestart [ -hvpa ] [ -b blacklist_file ] [ -i package_name ]
DESCRIPTION
The checkrestart program tries to determine if there are processes in the system that need to be restarted after a system upgrade. This is
necessary since an upgrade will usually bring new system libraries and running processes will be still using the old versions of the
libraries. In stable Debian GNU/Linux systems this is typically needed to eliminate a system exposure to a vulnerability which might have
been fixed by upgrading a library which that process makes use of.
Consequently, checkrestart is sometimes used as an audit tool to find outdated versions of libraries in use, particularly after security
upgrades. Administrators should not, however, rely on its output completely (see BUGS below).
This script needs to run as root in order to obtain the information it needs for analysis.
OPTIONS -h,--help
Show the program help and exit.
-v,--verbose
Generate detailed output. This output includes the list of all processes found using deleted files or descriptors as well as the
deleted files and descriptors found.
-p,--package
Only process deleted files that belong to a package, ignoring deleted files which do not have an associated package in the package
system.
-a,--all
Process all deleted files regardless of location. This makes the program analyse deleted files even if they would be discarded
because they are located in locations, such as /tmp , which are known to produce false positives. It will take preceded if used
simultaneously with the -p option.
-b file,--blacklist=file
Read a blacklist of regular expressions from file. Any files matching the patterns will be ignored.
-i name,--ignore=name
Ignore services that are associated to the package name provided in name.
EXIT STATUS
The program will exit with error (1) if a non-root user tries to run it. Otherwise, it will always exit with error status 0.
BUGS
This program might fail if the output of the lsof utility changes since it depends on it to detect which deleted files are used by pro-
cesses. It might also output some false positives depending on the processes' behaviour since it does not check yet if the (deleted) files
in use are really libraries.
If you find a false positive in checkrestart please provide the following information when submitting a bug report:
-- The output of checkrestart using the -v (verbose) option.
-- The output of running the following command as root:
lsof | egrep 'delete|DEL|path inode'
Checkrestart is also sensitive to the kernel version in use. And might fail to work with newer (or older) versions.
A rewrite to make it less dependent on lsof could improve this, however.
SEE ALSO lsof(8)AUTHOR
checkrestart was written by Matt Zimmerman for the Debian GNU/Linux distribution.
COPYRIGHT AND LICENCE
Copyright (C) 2001 Matt Zimmerman <mdz@debian.org> Copyright (C) 2007,2010-2011 Javier Fernandez-Sanguino <jfs@debian.org>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) any later version.
On Debian systems, a copy of the GNU General Public License may be found in /usr/share/common-licenses/GPL.
debian-goodies December 19 2006 checkrestart(1)