Get Ubuntu Get Ubuntu

Download Ubuntu now for free, request a free CD or buy it on DVD or CD

Get Support Get Support

Free documentation and community support, or buy professional support

Get Involved Get Involved

Share technical know-how with other users, or help to promote Ubuntu

Get Developing Get Developing

Share your development expertise and help shape the future of Ubuntu

User login

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 9 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Navigation

Who's new

  • xiaqinghua1989
  • pertapacilik
  • saifulfaizan
  • mayonks
  • naiimullah

Who's online

There are currently 0 users and 4 guests online.

Subscribe to Ubuntu Malaysia by e-mail

Delivered by FeedBurner

Search

Symbolic link

bizkut's picture


Screenshot-Login Screen Settings.png

I use Ubuntu like dancing bear; The magic in that is this: its not that the bear dances so beautifully, but that the bear dances at all.

So here's my Dancing Bear recipe for configuring Xampp to start up automatically for Ubuntu 9.10.

The first thing you need to know: There is something wrong with the directions the show for doing this in the Xampp FAQs. This isn't really anyone's fault. But the commands they offer for finding out crucial data aren't right. So don't freak out.

You really only need to know three basic things to set this up. Four if you count one of my excuses as a thing you need to know.

  1. You need to know how to list and look at directories from the command line.
  2. You need to know what runlevel the root user works at.
  3. You need to know what a symbolic link is.
  4. You need to not care about not having your machine log in automatically.

So lets get to it:

1. I'm not going to go over this. Even a dancing bear can type cd and ls to change directories and list them. That is, I think, the minimum required to call oneself a dancing bear.

2. The root user in Ubuntu works in Run Level 2.
How do I know this? Because if I change to Super User, by entering the terminal command "sudo su" I can type "runlevel" from the root-level command line. This tells me I'm running at "N 2." This is important, because it means that you have to put your symbolic links to the lammp launch script into /etc/rc2.d/

3.Go then. Make some symbolic links. But before you do, know this: You're making symbolic links to /opt/lampp/lampp in the /etc/rc2.d/ directory. You are going to give these symbolic links special names that will tell the system, when it's booting or shutting down, whether to call /opt/lampp/lampp in the context of starting xampp, or stopping xampp. If the symbolic links name starts with an S, that means, call it in the context of "start" when the symbolic link starts with a K, that means call the script int he context of "kill."
So what you need to do is create two symbolic links to /opt/lampp/lampp. I do this by changing to the /etc/rc2.d/ directory, and then using these commands:

  • sudo ln -s /opt/lampp/lampp S99lampp
  • sudo ln -s /opt/lampp/lampp k01lampp

What should happen then is that two little symbolic links will appear in the /etc/rc2.d/ directory. Those links are what tell the system to run the lampp start up script when the system is starting. You should also run "sudo update-rc.d lampp defaults" from the command line, but I don't know why or if it really matters. Remember, its not that the bear dances beautifully.

4. Finally, and here's something you'll just need to suck it up and get over: The way my system works, the machine does not enter Run Level 2 until you've logged into the system. That means, since my whole goal was to make the lampp server start without my intervention, I enabled the Ubuntu desktop system to automatically log me in. Problem solved. Unless you really don't care about security don't run your system that way, it's stupid. One day you will get burned.



Original Source: http://writelarge.com/content/dancing-bear-guide-setting-xampp-start-system-login-ubuntu-910
bizkut's picture

I just gave an impromptu lesson on symbolic links (symlinks) and hard links, complete with ASCII art, in #ubuntu-offtopic, and Topyli commented that simple explanations of this for beginners are hard to find, so here's a summary.

The purpose of a link is to allow you to have two (or more) paths to access the same data without having the data exist on disk multiple times, thus giving convenience without sacrificing disk space. So why are there two kinds of links and how do they work?

Symlinks (ln -s REALPATH LINK) work like this:

LINK --> REALPATH --> DATA

While hard links (ln PATH1 PATH2) work like this:

PATH1 --> DATA <-- PATH2

See what's happening here? In the symlink case, your link points to another path, which points to the data. In the hard link case, two paths point to the same data directly. I think I could get a lesson on pointers in C out of this ASCII art if I wanted to. If you want a bit more background, your hard disk's filesystem contains a table of inode numbers, which is just like the Index at the back of a book. Symlinks are when you get "(see also: rubber ducky)" and hard links are when you get "Rubber ducky: 5" and "Sesame Street: 5" both showing up in the Index. Since we can have multiple filesystems mounted on one machine (for example my /home is on a separate partition), it is important to note that while a symlink can point to something located on another disk (or in a book "Further reading: Little Red Riding Hood"), a hard link only knows about data on its own filesystem (ie same partition). So, if you want to link from your hard disk to a flash drive, you need to use a symlink. This makes sense since your hard disk can't know if your flash drive rearranges things while it's plugged into another computer.

How do these show up in ls? Hard links look like normal files. For symlinks ls -l --color will show LINK -&gt REALPATH. If REALPATH is deleted, this will be highlighted as red text on a black background.

Speaking of deletion, how does that work? Well, if you remove LINK, REALPATH and DATA will still exist. If you remove REALPATH, DATA goes away too and LINK just points at nothing (though if you add REALPATH back, LINK will start working again, as it only goes by filename). As for hard links, DATA goes away once no more inode numbers point to it. As mentioned before, hard links point directly to the data, so this means removing all links and the original filename. So if I remove the original filename (PATH1), PATH2 will still point to DATA.

I hope that's a straightforward enough explanation of how it works.



Original Source: http://ubuntulinuxtipstricks.blogspot.com/2009/11/links.html