How applications are managed in Linux? - linux

I am looking for design suggestions/documents etc. which contains specifics of system applications management in Linux (Ubuntu, Debian etc.)
Can you please point to a source of information or suggest a design?

I'm not sure to understand what you mean by system applications management (certainly it can mean several different things).
In practice, Linux distributions have some package management system to deal with that issue. init or systemd (etc....) is in charge of starting/stopping/managing daemons and servers. Its configuration is related to packaging.
Read also Ubuntu Packaging Guide and How To Package For Debian and Debian new Maintainer guide etc...
If you are coding some service application, read Advanced Linux Programming and about daemon(3) & syslog(3)
Also, study the source code of relevant system applications (similar to the one you are dreaming of), since Linux is generally (mostly) free software.

Related

What to consider when writing distribution-independent Linux applications?

I wish to write a graphical tool with which one could configure and query information about a Linux system.
In order to achieve some independence from the underlying Linux distribution, I am planning to require that the target system uses systemd, and that the target system has the PackageKit console program installed.
With this, I will have excluded Slackware Linux, since it does not use systemd.
What other considerations should I have in mind when designing such a tool? With the use of an abstraction layer away from the package manager, and with the use of systemd, are there any other things that I would have to consider?

How to verify cross platform installation steps

I have to check installation steps of my application on different production machines. I want to check how can I install my application on HP UX. I have only linux/windows machines but dont have real physical HP unix machine. Is there any way i can check installation steps of HP unix. I am thinking of any virtual environment or any flavour that run on linux or windows which gives accessiblity and functionality of HP unix.
I am looking something to cross check platfrom installation steps.
The short answer is no. HP-UX is as different from Linux as Linux is from Windows (almost). There would be many differences in libraries, patches, installed utilities, build tools, etc.
A few examples:
HP-UX does not come pre-installed with the bash shell
HP-UX uses a proprietary software packager and installer called swinstall (analogous to RPM but completely different)
Partition layout is different
Many common utilities behave differently. "echo" is one of many examples. This will affect things if your build process uses shell utilities
Even if you can test the install, don't you need to test the product's operation on HP-UX?
Not saying it's impossible. If your application uses basic, nonspecific utilities for install, it might work. There is no way to know without a running installation. Unfortunately you need Itanium hardware and the O/S.
My recommendation would be to get your application working on Solaris and any other Unixes first. The more platforms you test on, the more portable your code will become on all of them. Then, put out some feelers and find someone with a system you can borrow time on.
Worst case, find an Itanium server like an rx2620 on eBay, should not cost too much. Even better if the seller forgets to wipe the O/S :). You'll need a terminal and possibly null modem. 11.31 (11iv3) is the latest version of the O/S.

node.js on Windows. When and why?

Note: There is a similar question called 'installing nodejs on windows machine'.
And various answers explaining how by installing cygwin you can get it working there.
now, I don't want to install cygwin.
I just wish I could run nodejs on a windows box.
I want a "nodejs.exe" to kick off.
Can somebody explain to me
1) why nodejs has not been ported on windows - what are the technical reasons for not providing an exe ?
2) are there any plans to have nodejs on windows ?
I really would like to use it but I can't accept that I have to accept cygwin.
That's just not right.
Update:
For optimum node on windows development I recommend you use the Windows Azure powershell for node.js. It's a powershell optimised for using node, npm and the azure APIs. (the azure apis are optional. I would still use this powershell if I didn't use azure).
When : v0.6
Currently you can get a binary file that (kind of) works under windows. Go ask on the node.js IRC channel. They'll hook you up.
Basically if you read up on node.js road plans you will find that proper windows support is planned for 0.6, we are currently on v0.4.7 and the v0.5.x beta is in full storm.
I won't give an ETA but it's soon.
IRC can be found at the Community links
PDF showing v0.6 road plan
July 2011 update:
#nodejs v0.5.1 is the first to ship with an official Windows executable. We're hoping to get some good feedback.
Microsoft has officially gotten involved with joyent in making node.js run natively on windows.
Running Node under Windows presents several technical problems, mostly related to how Windows' internal design differs from that of Linux and the "change in mindset" required to port Unix applications to Windows.
Background
Linux was designed to be a replacement for Unix, a well-known multitasking operating system, so from day one it has been a multi-user/multi-process, server-oriented operating system. The idea of multiple processes sharing system resources is key to its internal design.
Windows was initially designed as a single-user/single-process desktop operating system and so did not support shared access to system resources. In 1993 Microsoft released a newly redesigned version of Windows--called Windows/NT--to better support the shared resource, multitasking model required by servers, but due to its existing installed base of users, Microsoft required NT to also support all the features of its single-user/single-tasking forebearer.
Windows 7 is a direct descendant of NT and Microsoft's need to support legacy users continues to this day (and in the opinion of many, has severely muddled Windows' internal design.)
Further, Microsoft hired a systems architect named Dave Cutler to design NT. Dave is best known for designing a competitor to Unix called VMS, the internal design of which differs significantly from that of Linux, which has caused a lot of problems for developers interested in porting their Unix programs to Windows.
The clearest example of this "impedance mismatch" between the internal design of Windows and Linux is how they handle event-driven, non-blocking input/output (io) on which Node relies to perform its (apparent) multitasking magic in a single thread of operation.
Linux supports two system-level functions called select() and epoll() which can be used to asynchronously inform a process of changes within the operating system that affect it. Node relies heavily on these functions but Windows doesn't support either, relying instead on "Change Notifications" (mostly) to handle event-driven io.

Any lightweight *nix environment for programming

Is there any lightweight *nix OS dedicated for programming purposes?
Actually, I have a full installation of Mandriva in my computer; but sometimes in Windows I must use Virtualbox to run some *nix OS.
Because I only need the OS for only programming in this case, so I just want to ask you about it. Of course, I searched about this on the net; but I also want to have your opinions...
Basically I need C/C++, Java, Python environment.
The only Linux distro you should use is Arch Linux. Please read why it is so great for developers :)
I'm an Arch Linux user, so my opinion may be biased.
Actually, a machine that you do development on shouldn't be lightweight. It should be heavy. full of compilers, interpreters, profilers, debuggers, IDEs, editors, benchmarks, checked-out code from repos, development versions of system libraries, test suites, generated large test files, backup tools, virtual machines, chroots, music to set-up comfort environment, mail, office suite to do the paperwork.
I mean, install Putty and connect to your machine (a), or do all development on virtual machine (b), that is kept on external hard drive (that's what I did, when I needed this), so you can use it everywhere where VirtualBox can run.
As for linuxes, I personally would like to use Gentoo Linux, as it can be customized to be lightweight. But unless you're really experienced with all linux administration stuff, customization may take a lot of time. So as a (c) variant, I'd advise to use any distribution (like your Mandriva), because normally base system takes about 10% of "weight" that you need for development on top of that.
And, by the way, boot speed is irrelevant on VirtualBox, since you can save virtual machine state entirely on hard drive and restore it within seconds.
I recommend xubuntu. I keep a full programming environment on a 4GB thumb drive with me at all times... just in case. :-)
I have a Debian install with X, windowmaker, firefox, vim, gcc, make and dependencies. Also, source control tools. Not much more, other than stuff that's useful in shell scripts. About 1.4G used on disk. Boots quickly. Very little BS involved.
I used to use OpenBSD on my old laptop. Similar to the above, but even more minimalist. You upgrade the OS with tar and patch. :-) Very nice, very small. Only reason I switched away from it is because I got a new machine which needed ndiswrapper for wifi...
PS: seems like this should be a community wiki...
Don't forget about Cygwin, which gives you a Unix-like environment right within your Windows box.
What about something like Puppy or DSL?
They aren't dedicated to programming, but they are small and lightweight.
I'd use something like GRML.
It really depends on what you are trying to do in terms of development.
Questions I would ask myself before development.
a) Who is the audience of the applications?
b) Is it a web based application or a desktop application?
c) How heavy is the number crunching part?
The first questions sometimes dictate the programming language you will be using. If it is for system administrator, I believe you will be writing a console application with command line interface, that the choice would be using programming language like shell scripts languages, C, C++, and a few other script languages like Python and Ruby.
For second question, If you are doing a web based application or mobile application, you would need to get the SDK with the libraries, and it would pretty much dictate the environment you will be working on.
For the number crunching part, you would need to look into libraries like CUDA or Fortran libraries that are designed for these type of applications.
Personally I use the Gentoo and Puppy Linux distro. If you need do C, Java and python, you could just download the stage3 tar ball of Gentoo linux, download the SDK from Oracle, and you are set to go.
Sometimes people want to do the developement in Windows environment, and don't want to miss the Unix tools, using cygwin and mingw in Windows environment would be viable options.
I recommend trisquel mini is the best which is also ubuntu based. I am using it.I installed eclipse ide in it with 1 gb ram. It uses only 200 mb for running os for more information visit my https://hassan004.blogspot.com/2022/01/weight-linux-distro-trisquel-mini.html

shifting from windows to *nix programming platform

How to migrate to *nix platform after spending more than 10 years on windows? Which flavor will be easy to handle to make me more comfortable and then maybe I can switch over to more stadard *nix flavors?
I have been postponing for a while now. Help me with the extra push.
Linux is the most accessible and has the most mature desktop functionality. BSD (in its various flavours) has less userspace baggage and would be easier to understand at a fundamental level. In this regard it is more like a traditional Unix than a modern Linux distribution. Some might view this as a good thing (and from certain perspectives it is) but will be more alien to someone familiar with Windows.
The main desktop distributions are Ubuntu and Fedora. These are both capable systems but differ somewhat in their userspace architecture The tooling for the desktop environment and default configuration for system security works a bit differently on Ubuntu than it does on most other Linux or Unix flavours but this is of little relevance to development. From a user perspective either of these would be a good start.
From a the perspective of a developer, all modern flavours of Unix and Linux are very similar and share essentially the same developer tool chain. If you want to learn about the system from a programmer's perspective there is relatively little to choose.
Most unix programming can be accomplished quite effectively with a programmer's editor such as vim or emacs, both of which come in text mode and windowing flavours. These editors are very powerful and have rather quirky user interfaces - the user interfaces are ususual but contribute significantly to the power of the tools. If you are not comfortable with these tools, this posting discusses several other editors that offer a user experience closer to common Windows tooling.
There are several IDEs such as Eclipse that might be of more interest to someone coming off Windows/Visual Studio.
Some postings on Stackoverflow that discuss linux/unix resources are:
What are good linux-unix books for an advancing user
What are some good resources for learning C beyond K&R
Resources for learning C program design
If you have the time and want to do a real tour of the nuts and bolts Linux From Scratch is a tutorial that goes through building a linux installation by hand. This is quite a good way to learn in depth.
For programming, get a feel for C/unix from K&R and some of the resources mentioned in the questions linked above. The equivalent of Petzold, Prosise and Richter in the Unix world are W Richard Stevens' Advanced Programming in the Unix Environment and Unix Network Programming vol. 1 and 2.
Learning one of the dynamic languages such as Perl or Python if you are not already familiar with these is also a useful thing to do. As a bonus you can get good Windows ports of both the above from Activestate which means that these skills are useful on both platforms.
If you're into C++ take a look at QT. This is arguably the best cross-platform GUI toolkit on the market and (again) has the benefit of a skill set and tool chain that is transferrable back into Windows. There are also several good books on the subject and (as a bonus) it also works well with Python.
Finally, Cygwin is a unix emulation layer that runs on Windows and gives substantially unix-like environment. Architecturally, Cygwin is a port of glibc and the crt (the GNU tool chain's base libraries) as an adaptor on top of Win32. This emulation layer makes it easy to port unix/linux apps onto Cygwin. The platform comes with a pretty complete set of software - essentially a full linux distribution hosted on a Windows kernel. It allows you to work in a unix-like way on Windows without having to maintain a separate operating system installations. If you don't want to run VMs, multiple boots or multiple PCs it may be a way of easing into unix.
Ubuntu is nicely balanced, with a user friendly desktop but the potential to set up a fully functional programming environment.
I would advise experimenting with virtual machines - there is no reason to ditch your current setup until you've tried a few of the major distributions. VMware and others have a wide variety of server and desktop builds available.
I guess it also depends on what programming languages your are comfortable with.
If you worked with C# in the past then you could look at using the knowledge by running Mono , or maybe look at using Java (which is syntactically very similar). Either way Linux would be good.
I personally would recommend you look at the Mac's OS X. Its a unix BSD based OS, but with a really slick user interface over the top. To me it feels like the best of both the Windows and Unix worlds.
I do all my unix development on it, deploying onto Ubuntu servers. If you do look at a Mac, definitely take a look at the MacPorts project, which packages a large amount of the open source unix/linux software up making installation of programming tools incredibly easy.
Ubuntu seems to be very user-friendly, and has a lot of specific information for it in forums etc. So support-wise you'll be covered.
I experienced the shift from windows to ubuntu as very much do-able, things you can do graphically in windows can be done exactly the same in ubuntu (maybe some exceptions) and a bit more. A computer savvy individual should not have any problems.
However, it helps greatly if you are familiar with the basic shell commands (you'll need them as a programmer!). Some are the same as on windows but especially ls (dir) sometimes has me wracking my brain for "what was that command again", and vice versa when I'm back on windows.
Take some time to try them out. (for example: pwd, ls, mv, rm, ps, kill)
Finally, when installing programs often a simple "sudo apt-get install X " does all the work for you, even more user friendly than the windows installer executables I find.
Edit: You might want to try a VMware player and try a few linux distributions to play around in before you install the dual boot.
Get a macbook pro. OSX is the smoothest flavour of unix and the laptop should give you the push you need.
Then when you're feeling more confident, you can decide whether or not you want to spend most of your time configuring your soundcard, running ./autoconfigure && make, and debugging package manager screwups.
Any modern version of Unix (or Linux) you can get running on your machine will be fine.
Here are the ones that I would consider:
Ubuntu. As others have noted, this is often considered to be the easiest to use. However some parts are not "standard" Unix. For example, the startup scripts do not use init. This is mostly a good thing, but if you're trying to learn Unix may not be what you need.
Fedora. Bleeding edge but with rough edges.
Slackware. Possibly the most Unix-like Linux distribution (some would say dated!).
One of the *BSDs: FreeBSD, OpenBSD, NetBSD. Different approach to some things than Linux.
Solaris. This is "proper" Unix. Seems bare-bones compared with Linux but worth playing with to see what's "standard."
In fact, I would consider running at least a couple of them, most run fine as a VM. One of the good and bad things about Unix is that what's standardised is more the philosophy than many of the details. There's no Visual Studio, there's no C# (by that I mean no canonical high level language; I know about Mono).
Excellent answers. A few comments:
Almost all distros support LiveCDs, to let you try before installing. folks mentioned VMWare and VirtualBox, also note that Ubuntu's WUBI installer lets you install Linux under Windows without repartitioning; very nice; I used it when I first switched to my 64-bit system, since I wasn't sure how good the driver support was. Ubuntu 9.04 works great in 64, though. Also, since Ubuntu is so popular, that are many versions, Kubuntu uses KDE instead of Gnome, Mint and Xubuntu are both lighter weight.
Expect to run side-by-side for a while when transitioning from Windows. Cygwin has some nice downloadable manuals for people getting used to bash, and basic information about how *nix works underneath, targeted at Windows users. There are tons of useful sites; the Ubuntu community forums have a tremendous amount of information, for both beginners and advanced.
For getting used to developing under Linux, check the Linux documentation project. In addition to KDevelop, there's Anjuta, Eclipse, and many more. Some are light, some are heavyweight.
One thing that can ease the transition is to use software that runs in both operating systems. Firefox, Thunderbird, OpenOffice, Subversion, and hundreds if not thousands of others run fine in both Linux and Windows. And with very little effort, you can use the same folders for application settings and data for many of these. Firefox and Thunderbird can easily use the same folders/files on an NTFS partition. Makes dual booting much easier. Instructions are on the Ubuntu community site and other locations.
Note that some Linux software isn't NTFS friendly; in Linux keep your Subversion working folders on a native partition.
One caveat for sharing application settings; some applications store absolute paths; as a workaround, you can create symlinks that look like Windows drive letters.
After you get comfortable with Linux, branch out and try non-Windowsy applications and tools. Sometimes different is better. Lots of people use Emacs and Vim for good reasons.
Try Kubuntu as a distro and Kdevelop and Qt to start programming with, it's all very civilised.
Kate's an ok notepad-esque text editor if you want to go that way but I don't see why you'd want to get in to Vi or Emacs apart from the geeky appeal of using something really arcane.

Resources