Sponsored Content
Top Forums UNIX for Dummies Questions & Answers About the file /etc/rc.d/rc.local Post 302371272 by cqlouis on Saturday 14th of November 2009 03:32:14 AM
Old 11-14-2009
About the file /etc/rc.d/rc.local

My OS is RHEL5.0.

Code:
 
[root@node01 ~]# cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local

I appended echo "this is just for test " to file /etc/rc.d/rc.local,
I guest when I reboot my system, this is just for test will be displayed in the monitor.
But that didn't work.
Why?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to find whether a file is local or remote file?

Is there any system call to find whether a file is local or remote?? Thanks in advance!! -Jack Fds (3 Replies)
Discussion started by: jackfds
3 Replies

2. Shell Programming and Scripting

Avoiding rc.local file during reboot

Hi, I am tryin to install custom software during the linux reboot. So,I have changed rc.local file, but unfortunately I have added a code that is going on a infinite loop. And now I am in a pick. Is there anyway that I can avoid rc.local file while reboot. Can anyone help me... (2 Replies)
Discussion started by: eamani_sun
2 Replies

3. Ubuntu

Avoiding rc.local file during reboot

Hi, I am tryin to install custom software during the linux reboot. So,I have changed rc.local file, but unfortunately I have added a code that is going on a infinite loop. And now I am in a pick. Is there anyway that I can avoid rc.local file while reboot. Can anyone help me... (1 Reply)
Discussion started by: eamani_sun
1 Replies

4. Shell Programming and Scripting

Calculate the time difference between a local file and a remote file.

I m stuck with a issue. I need to calculate the time difference between two files.. one on the local machine and one on the remote machine using a script. Can any one suggest the way this can be achevied Thanks, manohar (1 Reply)
Discussion started by: meetmano143
1 Replies

5. Shell Programming and Scripting

file size comparision local file and remote file

Hi, I have written a script which would FTP a dump file to the FTP server and log the whole activity into a file. to confirm the success of the file copy i grep for "226 file receive OK" and then send out an email saying success. Now i want to make sure the bytes of the local file and... (4 Replies)
Discussion started by: dba.admin2008
4 Replies

6. Shell Programming and Scripting

Local max values of a file

I have a data file of two columns (corresponding to the x and y axes of a graph) separated by a comma. I want to find the local maximum values and print them to a file. It has been a while since I've done any scripting and I've forgotten everything. I have a few basic questions. 1.) How do... (1 Reply)
Discussion started by: jemm
1 Replies

7. Ubuntu

rc.local file question

Hi, I putted the following code in my rc.local file: logf=/tmp/rc.local.log if then echo Start >> $logf /usr/sbin/pppd nodetach debug call internet >> $logf echo Stop >> $logf ping -c 1 google.com >> $logf fi But after login rhere was no rc.local.log file in my temp folder: ... (1 Reply)
Discussion started by: Sapfeer
1 Replies

8. UNIX for Dummies Questions & Answers

Copy a file from a dvd to the local AIX file system

Hi, I am a newbie to AIX, so please bear with me. I have mounted a dvd drive on AIX. I am trying to copy the file that is on the dvd drive on to the local machine. However, I get an error: cp: c1m_0001.gz: A system call received a parameter that is not valid. Can some one point me to the... (1 Reply)
Discussion started by: anurag1510
1 Replies

9. AIX

Do I need to configure my local windows to FTP files from local windows to a UNIX AIX server?

Hi Friends, I have this script for ftping files from AIX server to local windows xp. #!/bin/sh HOST='localsystem.net' USER='myid_onlocal' PASSWD='mypwd_onlocal' FILE='file.txt' ##This is a file on server(AIX) ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies

10. Shell Programming and Scripting

Ssh cat file output into a file on local computer

Hello, I'm on a remote computer by SSH. How can I get the output of "cat file" into a file on the local computer? I cannot use scp, because it's blocked. something like: ssh root@remote_maschine "cat /file" > /locale_machine/file :rolleyes: (2 Replies)
Discussion started by: borsti007
2 Replies
LOCKOUT(1)							      lockout								LOCKOUT(1)

NAME
lockout - avoid slacking and impose productivity and discipline on yourself WARNING
This program is VERY DANGEROUS. If it fails, you may end up not knowing the root password to your own computer (in which case you need to boot into single-user mode). There are no known reports of this actually happening, but we don't know how stupid you are. Also, you should probably not run this on a multi-user system. SYNOPSIS
lockout lock HhMm | Hh | Mm lockout lock HH:MM lockout lock HH:MMam | HH:MMpm lockout lock HHam | HHpm lockout lock lockout unlock [force] lockout status DESCRIPTION
Lockout is a tool that imposes discipline on you so that you get some work done. For example, lockout can be used to install a firewall that does not let you browse the Web. Lockout changes the root password for a specified duration; this prevents you from secretly ripping down the firewall and then browsing the Web anyway. In case of an emergency, you can reboot your computer to undo the effects of lockout and to restore the original root password. Obviously, lockout lock and lockout unlock can only be run by root. lockout status can be run by any user. lockout without any parameters shows a brief help message. lockout lock takes one optional parameter. If no parameter is given, you are dropped in interactive mode and asked for the duration of the lock or the time at which the lock should be lifted. You can also supply this as a parameter on the command line. Lockout understands various time formats. You can specify a delay, e.g., 3h (3 hours), 1h30m (1 hour and 30 minutes), or 90m (1 hour and 30 minutes), or you can specify absolute time, e.g., 2pm, 2:30am, 15:30, etc. You will be asked to confirm the time at which lockout will unlock your system. If you type "yes", lockout executes /etc/lockout/lock.sh and changes the root password to something completely random. /etc/lock- out/lock.sh is a shell script that you write. It takes measures to make sure you stop slacking. For example, it could install a firewall that prevents outgoing connections to port 80. See the "EXAMPLES" section below. lockout unlock takes an optional force parameter. Without any parameters, lockout lock will check whether it is time to unlock the system and, if so, executes /etc/lockout/unlock.sh, which is a shell script that you write. It should undo the effects of /etc/lockout/lock.sh, executed when the system was locked. If you pass the force parameter to lockout unlock, lockout will forcibly unlock your system, whether it was really time for that or not. lockout unlock should be called every minute by cron. See "CONFIGURATION". lockout status will print out the time at which the system is going to be unlocked. CONFIGURATION
/etc/cron.d/lockout must contain the following two entries: */1 * * * * root /usr/bin/lockout unlock >/dev/null 2>&1 @reboot root /usr/bin/lockout unlock force >/dev/null 2>&1 The examples that follow assume you are using sudo(8) and you have a file, /etc/lockout/sudoers.normal which is the normal /etc/sudoers file, and /etc/lockout/sudoers.lock, which is the /etc/sudoers file when lockout locks your computer. This example also assumes you are using iptables(8). /var/lib/iptables/active should contain your default firewall rules, and /var/lib/iptables/work should contain the firewall rules that enforce discipline. See below for an example. /etc/lock/lock.sh imposes discipline. For example: #!/bin/sh /etc/init.d/iptables load work cp /etc/lockout/sudoers.lock /etc/sudoers /etc/init.d/sudo stop /etc/init.d/sudo start /etc/lock/unlock.sh undoes these effects. For example: #!/bin/sh /etc/init.d/iptables restart cp /etc/lockout/sudoers.normal /etc/sudoers /etc/init.d/sudo stop /etc/init.d/sudo start Your /var/lib/iptables/work may look something like this: *filter :INPUT ACCEPT [1047:99548] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [1104:120792] # allow incoming packets from localhost, ntp, # and existing connections -A INPUT -i lo -j ACCEPT -A INPUT -p udp -m udp --source-port ntp -m state --state ESTABLISHED -j ACCEPT -A INPUT -m state --state ESTABLISHED -j ACCEPT -A INPUT -p tcp -j DROP -A INPUT -p udp -j DROP # allow outgoing connections for email and DNS -A OUTPUT -d 127.0.0.1/8 -j ACCEPT -A OUTPUT -p tcp -m tcp --dport smtp -j ACCEPT -A OUTPUT -p tcp -m tcp --dport domain -j ACCEPT -A OUTPUT -p udp -m udp --dport domain -j ACCEPT -A OUTPUT -j DROP COMMIT EXAMPLES
lockout lock 2h30m [locks out for 2h and 30m] lockout lock 90m [locks out for 1h and 30m] lockout lock 3pm [locks out until 3pm] lockout lock 3:20am [locks out until 3:20am] lockout lock 15:20 [locks out until 3:20pm] lockout status [shows when the system is going to be unlocked] FILES
/etc/lockout/lock.sh: executed when running lockout lock /etc/lockout/unlock.sh: executed when running lockout unlock SEE ALSO
usermod(8), iptables(8), passwd(1), cron(8), crontab(1) BUGS
Arguably, a program that changes the root password to something random with the possibility of never recovering the original password might be considered a bug by itself. Other than that, no known bugs. AUTHOR
Thomer M. Gil, http://thomer.com/lockout/ lockout 2004-09-08 LOCKOUT(1)
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy