Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

start shell script at boot before user logs in

Posted on 2006-11-17
3
Medium Priority
?
255 Views
Last Modified: 2010-04-20
I need to start a shell script at boot before the user even logs in. The script will have 1 parameter needed to run. (Fedora 4)
0
Comment
Question by:JPERKS1985
  • 2
3 Comments
 
LVL 57

Accepted Solution

by:
giltjr earned 2000 total points
ID: 17969019
put it in /etc/rc.d/rc.local
0
 
LVL 14

Expert Comment

by:ygoutham
ID: 17970543
putting a entry in /etc/rc.d/rc.local will run the script as root.  who supplies the parameter???  does the script know by itself. if so, good and if the script does not do any great damage go ahead and since it has all privileges be careful.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 17971351
ygoutham does bring up a good security point.  Anything from rc.local is executed as root.  You can use su or sudo to exectue commands as a different user.

You also need to make sure that STDERR/STDOUT is re-directed to a log file.  Otherwise you will not know if they actually did what intended.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question