Set up TTL on process


 
Thread Tools Search this Thread
Operating Systems Solaris Set up TTL on process
# 8  
Old 09-28-2010
Create a wrapper (eg: mySsh) setting this limit to a single ssh command:
Code:
#!/bin/ksh
ulimit -t 3600
ssh "$@"

# 9  
Old 09-28-2010
I need to take baby steps. Where would I put this wrapper (eg: mySsh) and what does the
Code:
"$@"

mean? Also, is ther a way to see what the current ulimit is set?
# 10  
Old 09-28-2010
Quote:
Originally Posted by jastanle84
Where would I put this wrapper (eg: mySsh)
Anywhere in your PATH.
Quote:
and what does the
Code:
"$@"

mean?
all parameters
Quote:
Also, is ther a way to see what the current ulimit is set?
The default is unlimited:
Code:
ulimit -a

# 11  
Old 09-28-2010
Here is a copy of my profile file:

Code:
server-root# cat profile
#ident  "@(#)profile    1.18    98/10/03 SMI"   /* SVr4.0 1.3   */

# The profile that all logins get before using their own .profile.

trap ""  2 3
export LOGNAME PATH

if [ "$TERM" = "" ]
then
        if /bin/i386
        then
                TERM=sun-color
        else
                TERM=sun
        fi
        export TERM
fi


#       Login and -su shells get /etc/profile services.
#       -rsh is given its environment in its .profile.

case "$0" in
-sh | -ksh | -jsh)

        if [ ! -f .hushlogin ]
        then
                #       Allow the user to break the Message-Of-The-Day only.
                trap "trap '' 2"  2
                /bin/cat -s /etc/motd
                trap "" 2
        fi
esac

umask 037
trap  2 3
TMOUT=900;export TMOUT
if [ `/usr/bin/id | grep -c 'uid=0'` -eq 1 ]
then
PS1=`uname -n`"-"`id | cut -d"(" -f2 | cut -d")" -f1`"# ";export PS1
else
PS1=`uname -n`"-"`id | cut -d"(" -f2 | cut -d")" -f1`"$ ";export PS1
fi
/usr/bin/mesg n 2> /dev/null

Where would you suggest I put the mySsh file and where and how in the profile file would I enter the path to the mySsh file?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Htop process viewer - set column width

I try to enlarge the htop column's width. I've found a solution, but it seems very specific and also too difficult. Is there any simpler way to make all the characters in a column visible? (0 Replies)
Discussion started by: plaidshirtuser
0 Replies

2. UNIX for Advanced & Expert Users

How to set postgres process in monit file?

Dear Friends, I need to add the postgres process in monit file ( Debian machine ). How to add that process in monit?. If anyone know the solution for this, pls let me know. ---------- Post updated at 02:27 PM ---------- Previous update was at 12:21 PM ---------- I have found the... (0 Replies)
Discussion started by: rekha_sri
0 Replies

3. Solaris

Child killing parent process and how to set up SMF

Hello, A little background on what we are doing first. We are running several applications from a CLI, and not all of them are fully functional. They do on occasion core dump, not a problem. We are running a service that takes a screen scrape of those apps and displays them in a more user... (5 Replies)
Discussion started by: Bryan.Eidson
5 Replies

4. Red Hat

process fails if setuid bit is set

Hi, OS : Linux I have an executable (P1) owned by user say "abcd" and the setuid bit is set. And there is another executable (P2) which brings up the process (P1). When the setuid bit is set, the process P1 is failing, if the setuid bit is not set there is no issue. I was wondering if... (6 Replies)
Discussion started by: ahamed101
6 Replies

5. Shell Programming and Scripting

How to get and process mysql result set in shell script

Hi All, I am in a problem here is the description, Actually in my shell script i am firing a mysql query which returns multiple records and i have to process each record one by one. So could any one please suggest me how to solve my problem? Thanks in Advance Ashok Sharma (4 Replies)
Discussion started by: ashok1979
4 Replies

6. IP Networking

TTL for IP addr from DNS through C code

Hi All, I know that getaddrinfo() return the multiple IP addresses (if present) for a hostname. But, I want to know how to get the TTL value for this list from DNS. I want to get this TTL value and cache this IP address list for that much time and then again go for DNS resolution if TTL expires. ... (2 Replies)
Discussion started by: softindia
2 Replies

7. AIX

3004-505 Cannot set process environment

Guys I have an AIX 5.3 box.I am getting following messages if i try to switch to any non root user. bash-3.00# su - sys 3004-505 Cannot set process environment. bash-3.00# su - daemon 3004-505 Cannot set process environment. bash-3.00# su - adm 3004-505 Cannot set process environment.... (4 Replies)
Discussion started by: ak835
4 Replies

8. UNIX for Advanced & Expert Users

login error(can not set process env.)

I have created user in AIX 4.3.3 which the member of staff group. but during login ( with su command) it gives the error "can not set process environment " but when it is member of another group -dba -which is the group for oracle database- it works properly. Pls let me know the solution. ... (5 Replies)
Discussion started by: amit
5 Replies

9. UNIX for Advanced & Expert Users

TTL field???

Hi all, I wonder, how I can change Time To Live field for icmp packet in Redhat 7.1, kernel 2.4.2-2? I looked up in /proc/sys/net/ipv4 and did find this field in there. There should be a way to change TTL. If it's in header file, in which one? Thank you all :p (11 Replies)
Discussion started by: solvman
11 Replies
Login or Register to Ask a Question