LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-18-2001, 09:56 AM   #1
gretp
LQ Newbie
 
Registered: Feb 2001
Location: Washington,DC
Posts: 4

Rep: Reputation: 0
Unhappy


What I am really trying to do is to create a simple script in the /etc/init.d directory that prints something (like,"Hello, I am your friendly computer.." or "I love you". whatever, it doesn't matter,) the run level, and if the script is starting or stopping something. I want to use vi to create it. But I am not sure whether I should create a directory under /etc/init.d
or...what Should I do? and also, another question is how to us command, ln to create a hard link to the file in /etc/rc2.d and /etc/rc3.d? the last one is how I can bring the system up to run level 3?? Thanks in advance.
 
Old 02-18-2001, 04:56 PM   #2
devnull
Member
 
Registered: Feb 2001
Posts: 84

Rep: Reputation: 15
you change the runlevel with the "init"-command (you can also use /sbin/telinit, but that's just a link). So, to bring the system into runlevel 3, type init 3 on the console. To make it the default-runlevel, edit your /etc/inittab and change the line with "initdefault...".

Why do you want to create a hardlink? Create a softlink instead! Syntax: ln -s "origin" "link-name"
man ln will give you more details!

The first part of your question confuses me! Maybe my english is to bad.
If you want to do some scripting, create a directory in your home-dir and not in the /etc/init.d-dir.
init.d is a directory for important system-services! Don't play around there!
The current system-runlevel can be shown (depending on your system!) with "runlevel" (as root) or on some systems with "echo $RUNLEVEL".
The echo-command (and also a "HERE-Document" will print out a message.
To see, if the script is starting or stopping something, you have to consider an "if"-statement or "case" (e.g.)

Maybe someone else can help you more.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration