Friday, January 2, 2009

Adding Start Up Service With Webmin

We all know that Webmin is like a swiss army knife for Linux SysAds, but again, there are some programs you want to start running as your machine boots or to shut down the program when you invoke a shut down command or a reboot.

I personally use this during power failures when the system wakes up, I want all programs to be up and running.

As an example, ive downloaded and compiled inadyn, a dynamic DNS updater for Linux.

First important thing to know is the directory where the program is located.. When logged in in your shell, go to the directory where the program is located and type pwd (that is print working directory) and it will give you your current location.

In my case the result is: /root/inadyn/bin/linux/

Then you should know if theres a proper shut down command for the program, in inadyns case, theres none. Also, take note of the program name.. In my case the program name is inadyn and I run the program using ./inadyn

Theres a trick here, since if you run it, it will be just on standby.. and when you quit, the program shuts down.. The trick here is to add an & at the end to run it on background..

So to complete it, /root/inadyn/bin/linux/./inadyn&

So we have our command to run..

Go log in to your Webmin website and go to the System tab and select Bootup and Shutdown. Select the Create new bootup and shutdown action ..

After, you could add in your commands and give it a name.. Take note of the name, it should not contain spaces.. Just add a more complete description so you know what runs which when you get back to the list.

Going back to the shut down process, I invoked a killall -9 inadyn so it will force kill the program upon shutting down. This might not be a good idea since killing it on the -9 level is like 'end task' in Windows jargon. It may not properly do last minute saving of data.

An in depht article about killin in -9 is discussed here:

You might want to go easy on the killing. :)

Thursday, January 1, 2009

The Art of Compiling in Linux

Most of the people complain about compiling programs in Linux. Particularly those applications which require getting your hands dirty by using shell commands.

I have been compiling eggdrops and emechs from my IRC days back then and PVPGN and running a game server. Im currently compiling an otserv in Fedora 9 and thankfully, the instructions are in Debian and Ubuntu: .. hey how bad can it be? You could still yum your way through the needed libraries.

Important thought before you start is to know the important libraries needed. Most of the time they are the -devel or -dev libraries since you are compiling a program right? But the problem is most of the -devel libraries are dependent to their parent application. Say for example mysql-devel is dependent to mysql.i368.. So nonetheless you have to install the pair.

An important thing in compiling.. remember to:
1.) Check the libraries needed by the program you are compiling
2.) always remember: ./configure, make, make install

People really wouldnt bother compiling their own and just getting the executables.. But thats not always the case.. If you have the source and the only executables are in windows exe.. what do you do? Thats where everything comes in..

With the source files, you could port it into different platforms as long as the libraries are supported.

Try it out yourself, get an eggdrop IRC bot and compile away.