Sponsored Content
Operating Systems Linux Red Hat running my own script during startup Post 302536811 by getrue on Wednesday 6th of July 2011 09:43:50 AM
Old 07-06-2011
Quote:
I have written a script and I want it to be run during startup before the user log in.
* K = stop during startup S = start during startup
Code:
#runlevel
N 5
# ls -l /etc/rc5.d/
total 236
lrwxrwxrwx  1 root root 18 Nov 11  2009 K89netplugd -> ../init.d/netplugd 
lrwxrwxrwx  1 root root 19 Nov 11  2009 K90bluetooth -> ../init.d/bluetooth
lrwxrwxrwx  1 root root 18 Nov 11  2009 K94diskdump -> ../init.d/diskdump
lrwxrwxrwx  1 root root 23 Nov 11  2009 K99microcode_ctl -> ../init.d/microcode_ctl
lrwxrwxrwx  1 root root 15 Nov 11  2009 S25netfs -> ../init.d/netfs
lrwxrwxrwx  1 root root 14 Nov 11  2009 S26apmd -> ../init.d/apmd
lrwxrwxrwx  1 root root 16 Nov 11  2009 S28autofs -> ../init.d/autofs
lrwxrwxrwx  1 root root 16 Nov 11  2009 S40smartd -> ../init.d/smartd
lrwxrwxrwx  1 root root 15 Nov 11  2009 S44acpid -> ../init.d/acpid
lrwxrwxrwx  1 root root 11 Nov 11  2009 S99local -> ../rc.local
#

You have three options.

1- #/etc/rc.local // add line
2- #/etc/rc5.d/ // #touch 777 Sxxangel and edit like above
3- #crontab -e // add this line "@reboot /path/to/shell.script"

That's all from me. Smilie
This User Gave Thanks to getrue For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Startup script

New in Unix, I am adding a line "route add 57.14.y.y 57.14.x.x" every day after rebooting the system. Where can I add the line so during boot up (the system is re-started every day by design (???) the line is executed? (I tried the /etc/rc2.d/S90 but for some reason the line needs to be added... (2 Replies)
Discussion started by: texaspanama
2 Replies

2. Shell Programming and Scripting

Running a Cron Script only @ Startup Pls Help!!

Hi friends i have a script "backup.sh" which is stored in "/var/lib/pgsql" directory. I want it to run as a cron so that it executes every time the system starts. I tried the follwing method I logged in as the root user and typed "crontab -e" The file was completly blank so i put the... (3 Replies)
Discussion started by: perk_bud
3 Replies

3. Solaris

stop solaris 8 sendmail from running on startup

sorry i got this already... (3 Replies)
Discussion started by: itik
3 Replies

4. AIX

running fsck on aix in startup

Hi, I would like to know in which file I can get the option of enabling/disabling of running fsck on particular file system. As I know in /etc/filesystems these parameter should be there just like in Linux /etc/fstab I have created file system aix test but unable to find the option of... (1 Reply)
Discussion started by: manoj.solaris
1 Replies

5. AIX

startup script

Hi I need the below script to be started whenever I reboot my aix server ? #cat cdbegin /cdirect/cdunix/ndm/bin/cdpmgr -i /cdirect/cdunix/ndm/cfg/cbspsdb01/initparm.cfg Please suggest how to add this to the startup ? (2 Replies)
Discussion started by: samsungsamsung
2 Replies

6. Shell Programming and Scripting

Perl cisco copy running to startup

Hi all, i have a small simple perl that i cant make it work it is really stupid but i cant find solution and i needed fast. im trying to copy running to startup on a cisco router and show me the output like is ok Destination filename ? Building configuration... so the code i have is ... (0 Replies)
Discussion started by: IvanMP
0 Replies

7. Shell Programming and Scripting

Apache tomcat startup script not booting at startup.

I copied the script from an AskUbuntu post - #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO ... (14 Replies)
Discussion started by: Hijanoqu
14 Replies

8. Shell Programming and Scripting

Startup script

I can't quite find a clear answer on how to properly write a start up script. Does anybody have any ideas?? (3 Replies)
Discussion started by: Huitzilopochtli
3 Replies

9. UNIX for Advanced & Expert Users

Script not running at startup

I am having check.sh script and check.service which I include to /etc/systemd/system/ chmod 744 /usr/local/bin/check.sh chmod 664 /etc/systemd/system/check.service systemctl daemon-reload systemctl enable check.servicecheck.sh: websockify 5555 localhost:7000 & date >... (9 Replies)
Discussion started by: tomislav91
9 Replies
SCRIPTREPLAY(1) 						   User Commands						   SCRIPTREPLAY(1)

NAME
scriptreplay - play back typescripts, using timing information SYNOPSIS
scriptreplay [options] [-t] timingfile [typescript [divisor]] DESCRIPTION
This program replays a typescript, using timing information to ensure that output happens at the same speed as it originally appeared when the script was recorded. The replay simply displays the information again; the programs that were run when the typescript was being recorded are not run again. Since the same information is simply being displayed, scriptreplay is only guaranteed to work properly if run on the same type of terminal the typescript was recorded on. Otherwise, any escape characters in the typescript may be interpreted differently by the terminal to which scriptreplay is sending its output. The timing information is what script(1) outputs to standard error if it is run with the -t parameter. By default, the typescript to display is assumed to be named typescript, but other filenames may be specified, as the second parameter or with option -s. If the third parameter is specified, it is used as a speed-up multiplier. For example, a speed-up of 2 makes scriptreplay go twice as fast, and a speed-up of 0.1 makes it go ten times slower than the original session. OPTIONS
The first three options will overide old-style arguments. -t, --timing file File containing script timing output. -s, --typescript file File containing the script terminal output. -d, --divisor number Speed up the replay displaying this number of times. The argument is a floating point number. It's called divisor because it divides the timings by this factor. -V, --version Display version information and exit. -h, --help Display a help message and exit. EXAMPLE
% script --timing=file.tm script.out Script started, file is script.out % ls <etc, etc> % exit Script done, file is script.out % scriptreplay --timing file.tm --typescript script.out SEE ALSO
script(1) COPYRIGHT
Copyright (C) 2008 James Youngman Copyright (C) 2008 Karel Zak This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. Released under the GNU General Public License version 2 or later. AUTHOR
The original scriptreplay program was written by Joey Hess <joey@kitenet.net>. The program was re-written in C by James Youngman <jay@ gnu.org> and Karel Zak <kzak@redhat.com>. AVAILABILITY
The scriptreplay command is part of the util-linux package and is available from Linux Kernel Archive <ftp://ftp.kernel.org/pub/linux/utils /util-linux/>. util-linux September 2011 SCRIPTREPLAY(1)
All times are GMT -4. The time now is 12:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy