Welcome, Guest. Please login or register.

Author Topic: Linux s:user-startup  (Read 5279 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline odinTopic starter

  • Colonization had Galleons
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 6796
    • Show only replies by odin
Linux s:user-startup
« on: August 25, 2007, 08:38:04 AM »
I'm learning more about linux bit by bit, however the filestructure seems to be an overcomplicated mess. I'm looking to add something what I, were it an Amiga would add to s:user-startup.

What is a logical place to stick that on a Linux-based system? /var/lib/initscripts/ perhaps?

Offline Fraccy

  • Jr. Member
  • **
  • Join Date: Jan 2006
  • Posts: 64
    • Show only replies by Fraccy
Re: Linux s:user-startup
« Reply #1 on: August 25, 2007, 09:40:11 AM »
The main startup scripts are usually in /etc/init.d

Which scripts are called during startup depends on the runlevel (ie. whether you're starting up with a console or GUI, or some other arrangement). Different distributions often have their own 'user-friendly' methods for adding to the startup scripts, because runlevels can get rather confusing.

It's probably a good idea to use your distro's own method for adding a startup-script; if you try to do it yourself, it might not work (or might go wrong).

A busybox-based system (easily set up from scratch) dispenses with runlevels altogether and has a simple initscript: /etc/init.d/rcS

The Linux/Unix file structure actually makes a lot of sense. Don't forget, it's multi-user - if the Amiga was ever like this, you'd inevitably see something similar.

More details at: http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Linux s:user-startup
« Reply #2 on: August 25, 2007, 09:52:19 AM »
On debian or debian based distros, man update-rc.d
 

Offline ptek

  • Sr. Member
  • ****
  • Join Date: Jul 2002
  • Posts: 328
    • Show only replies by ptek
Re: Linux s:user-startup
« Reply #3 on: August 25, 2007, 01:28:43 PM »
Quote
The main startup scripts are usually in /etc/init.d


I'm also a Linux newbie and I'm wondering now what is the meaning of the ".d" extension ...
Onions have layers ...
 

Offline Fraccy

  • Jr. Member
  • **
  • Join Date: Jan 2006
  • Posts: 64
    • Show only replies by Fraccy
Re: Linux s:user-startup
« Reply #4 on: August 25, 2007, 04:30:04 PM »
(Just guessing...) the .d extension for init.d indicates that it's a directory containing init scripts.

There are similarly named directories in /etc, such as conf.d and env.d, but I don't think the .d extension is a general rule.
 

Offline dfreniche

  • Jr. Member
  • **
  • Join Date: Mar 2006
  • Posts: 87
    • Show only replies by dfreniche
    • http://blog.freniche.com
Re: Linux s:user-startup
« Reply #5 on: August 25, 2007, 05:31:31 PM »
Those scripts in turn launch daemons. in UNIX, a daemon is a service that runs in the background, providing a... well, a service. Examples are apache (the web server), dhcpd, etc.
If you see in UNIX (or MacOS, by the way, try Terminal in Finder, then ps -aux) anything ending in 'd', you can tell that's a daemon.
A1200D(Blizzard 68030,32MB,Wifi,IdeFix,CDROM), A1200D(Apollo 68030,8MB),A600,A500
I maintain a site on everything, Amiga too (in Spanish)
Regards to all amiga fans!   :-)
 

Offline dfreniche

  • Jr. Member
  • **
  • Join Date: Mar 2006
  • Posts: 87
    • Show only replies by dfreniche
    • http://blog.freniche.com
Re: Linux s:user-startup
« Reply #6 on: August 25, 2007, 05:41:16 PM »
In Linux you have runlevels. A runlevel simply defines a group of scripts to be launched at startup. Say you run at runlevel 1. Then, your Linux system will execute all scripts in /etc/rc1.d.
If you have a closer look at /etc, you have the /etc/rc?.d directories. One for every runlevel, from 0 (shutdown) to 6 (reboot). This is the way a SYSTEM V UNIX should work. In those dirs you only have links to the real scripts, stored at /etc/init.d. To add a script in, say, rc3.d,:
cd /etc/rc3.d
ln -s /etc/int.d/
The scripts in /etc/rc?.d have a 'S' or a 'K' and a number. The number is an order number. The S means Start (to be executed when the system fires up) and K means Kill (Stop when the runlevel in ending)
After all this theory, really, the equivalen to User-Startup in the file .bashrc found in your $HOME dir. The other are the equivalent to Startup-Sequence
A1200D(Blizzard 68030,32MB,Wifi,IdeFix,CDROM), A1200D(Apollo 68030,8MB),A600,A500
I maintain a site on everything, Amiga too (in Spanish)
Regards to all amiga fans!   :-)
 

Offline Fraccy

  • Jr. Member
  • **
  • Join Date: Jan 2006
  • Posts: 64
    • Show only replies by Fraccy
Re: Linux s:user-startup
« Reply #7 on: August 25, 2007, 06:02:54 PM »
Hey, thanks for that! I didn't associate .d and daemons at first, so here's something new I learned today... :-D
 

Offline murple

  • Hero Member
  • *****
  • Join Date: Jul 2007
  • Posts: 579
    • Show only replies by murple
    • http://www.murple.net
Re: Linux s:user-startup
« Reply #8 on: August 25, 2007, 06:33:50 PM »
.d does not mean daemon... you'll notice plenty of non-daemon .d directories such as php.d or yum.repos.d or profile.d... I dont know what it stands for (if anything at all) but it essentially means a subdirectory where certain similar configs (or subconfigs) are found. For example under /etc/rc.d you find directories for each runlevel configuration (rc).

You will not learn to use Linux by just messing around. At least, you will learn very slowly (as in years) and will get many things only partially right. Linux is, like any other unix, a very complex and powerful operating system. You need to read some manuals.

I *strongly* recommend (as in, if you dont, chances are you will give up in frustration) that you read some of the free online books at: http://tldp.org/guides.html

At the very least look at "Introduction to Linux"... but several of these will make your life MUCH easier.

There are several great print books too, a good start is the book "Running Linux" published by O'Reilly (see www.ora.com)

As for the original question, /etc contains most system-wide configuration and startup scripts. There can be other user-specific configs in your home directory.
 

Offline vpamicue

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 61
    • Show only replies by vpamicue
Re: Linux s:user-startup
« Reply #9 on: August 25, 2007, 06:47:05 PM »
If you use KDE 3 + and maybe even 2.x in /home/"loginname"/.kde is a directory called Auto Start drag the program you want to start to this directory and requester will come select link. It is exactly like the Amiga "Workbench Startup" directory.
The directoru should also be in your root directory /root/.kde/AutoStart

Hope this helps.
You do have to Show hidden files to see .xxx folders. :-D
VP AMICUE
Amiga Computer Users of Edmonton
\\"Your Amiga Source in Northern Alberta\\"
 

Offline ptek

  • Sr. Member
  • ****
  • Join Date: Jul 2002
  • Posts: 328
    • Show only replies by ptek
Re: Linux s:user-startup
« Reply #10 on: August 25, 2007, 07:45:33 PM »
Quote
You will not learn to use Linux by just messing around. At least, you will learn very slowly (as in years) and will get many things only partially right. Linux is, like any other unix, a very complex and powerful operating system. You need to read some manuals.


I would say that Linux is itself a gigantic programming language :-)

As an extra, is a great (robust) OS ;-)
Onions have layers ...
 

Offline ptek

  • Sr. Member
  • ****
  • Join Date: Jul 2002
  • Posts: 328
    • Show only replies by ptek
Re: Linux s:user-startup
« Reply #11 on: August 25, 2007, 07:53:46 PM »
@dfreniche,

About your signature : Don't worry about being an Amiga newbie. I visited some other platform forums and by comparison I realised people at amiga.org have none (or very very litle) arrogance. To say the truth (and sorry about this) I specially find the linux forums crowded of little arrogant people (most of them, there are exceptions of course) since some of them find themselfs like part of an elite (yes linux is not for all but that doesn't means linux masters cannot be helpfull and polite).

And thanks for your site and explanations (i'm linux newbie)

And welcome to the Amiga world!
Onions have layers ...
 

Offline murple

  • Hero Member
  • *****
  • Join Date: Jul 2007
  • Posts: 579
    • Show only replies by murple
    • http://www.murple.net
Re: Linux s:user-startup
« Reply #12 on: August 25, 2007, 10:24:27 PM »
Quote

The directoru should also be in your root directory /root/.kde/AutoStart


If you are doing most of your daily Linux user activity as root... do yourself a favor and STOP DOING THAT!!! That is perhaps the single stupidest thing you can do on any unix type system and is extremely extremely very super extremely much very dangerous and bad and not smart and dumb.
 

Offline murple

  • Hero Member
  • *****
  • Join Date: Jul 2007
  • Posts: 579
    • Show only replies by murple
    • http://www.murple.net
Re: Linux s:user-startup
« Reply #13 on: August 25, 2007, 10:30:39 PM »
Quote
I specially find the linux forums crowded of little arrogant people (most of them, there are exceptions of course) since some of them find themselfs like part of an elite (yes linux is not for all but that doesn't means linux masters cannot be helpfull and polite).


I think the main reason for that is that the First Commandment of unix-like OSes is "RTFM!" Most common problems are due to people who ignore the manuals and just try to figure things out themselves. That doesn't work with Linux. When people show up asking repetetive questions which are clearly explained in various manuals, its sort of like if somebody keeps going to the hospital saying "I keep sticking a fork in my toaster and it keeps electricuting me, how do I keep the toaster from electrocuting me when I stick a fork in it?"

I've found that Linux forums are often very helpful and un-arrogant if you first read the manuals and then phrase your questions in ways that show you took the 5 minutes to read the instructions... assuming you even have a question still after reading the instructions. Chances are, the instructions alone are enough to answer your question.
 

Offline dfreniche

  • Jr. Member
  • **
  • Join Date: Mar 2006
  • Posts: 87
    • Show only replies by dfreniche
    • http://blog.freniche.com
Re: Linux s:user-startup
« Reply #14 on: August 25, 2007, 10:59:25 PM »
@ptek
I love being a newbie. It's the only state of mind where you want to learn things all the time. I'm Amigan just since 2005 but I've used various flavours of MSDOS, Win, Linux, other UNIXes and MacOS. Why use only one system if you can try a bunch?
That said, i use Linux for everyday work and at home. It makes me feel comfortable. AmigaOS shocked me when I first try multitasking in an A500 unexpanded. I can connect it to my Linux box via serial port ! Then the frenzy started and now I own an A1200, an A600 and the 500. And use them everyday.
One of the biggest problems of "experts" is they take people out of their systems. If I start barking at someone for a basic Linux question, why anyone here should treat me with respect?
A1200D(Blizzard 68030,32MB,Wifi,IdeFix,CDROM), A1200D(Apollo 68030,8MB),A600,A500
I maintain a site on everything, Amiga too (in Spanish)
Regards to all amiga fans!   :-)