well, opengrok for opensolaris code base but no opengrok for linux codebase, one could start one however but the cost involved in setting up and maintaining is too greater I suppose. kernel.org maintains only kernel source tarballs. It has been left to the individual distro maker to distribute source code along with the product OS but practices are seldom distribute the source along with the code(I guess debian is an exception and thats why it provides more than 20-30 disks)
There is this : http://lxr.linux.no/
LXR (formerly "the Linux Cross Referencer") is a software toolset for indexing and presenting source code repositories. LXR was initially targeted at the Linux source code, but has proved usable for a wide range of software projects.
Update:
Another link I came across is http://fxr.watson.org/ , which has all the popular distro sources cross reference. Pretty useful for systems programmers.
Many questions. Let's take a couple and see if we can't clear things up.
Q1
I understand that the equivalent services are in /etc/init where the services start/stop. But I assume that if I install a package it does not necessarily create a startup script in /etc/init right?
No when you install applications on Linux distros (ones that make use of package managers such as dpkg/APT, RPM/YUM, pacman, etc.), as part of the software being installed the package manager has a scripting "feature" similar to those found in Windows that can add scripts, create scripts, add users to the system, and start services after they're installed.
Q2
So how does one know what has been installed and is available in Linux (like we can in Windows from Start -> Programs)?
Easy. The same package managers that I mentioned above have commands you can use to query the system to find out what applications have been installed, what files are related to these packages etc. etc.
Example
On Red Hat based distros you can use the command rpm
to find out information about the packages installed.
$ rpm -aq | head -5
libgssglue-0.4-2.fc19.x86_64
pygame-1.9.1-13.fc19.x86_64
perl-HTML-Parser-3.71-1.fc19.x86_64
ibus-libs-1.5.4-2.fc19.x86_64
libnl-1.1-17.fc19.x86_64
To find out what files are part of a package:
$ rpm -ql pygame | head -5
/usr/lib64/python2.7/site-packages/pygame
/usr/lib64/python2.7/site-packages/pygame-1.9.1release-py2.7.egg-info
/usr/lib64/python2.7/site-packages/pygame/LGPL
/usr/lib64/python2.7/site-packages/pygame/__init__.py
/usr/lib64/python2.7/site-packages/pygame/__init__.pyc
How can it show me just the executable pieces to that are included in the package (the applications)? Most of the time executables are installed in certain locations on Linux, /usr/bin
or /bin
are 2 such directories. I usually search the RPM packages like so for these:
$ rpm -ql pygtk2 | grep "/bin"
/usr/bin/pygtk-demo
$ rpm -ql httpd | grep -E "bin/|sbin/" | head -10
/usr/sbin/apachectl
/usr/sbin/fcgistarter
/usr/sbin/htcacheclean
/usr/sbin/httpd
/usr/sbin/rotatelogs
/usr/sbin/suexec
Best Answer
If this service is what you are installing, then you will probably need to know each distributions service management anyway as you should be writing your init scripts/config correctly for those platforms you want to support.
systemd -
systemctl start xyz.service
Fedora 15+, RHEL7, Arch, Debian 8+, Ubuntu 15+, openSUSE 12.3+
Upstart -
service xyz start
Ubuntu, Fedora 9+, RHEL6
SysV -
/etc/init.d/xyz start
RHEL5, Debian, Suse
OpenRC -
/etc/init.d/xyz start
Gentoo (supports Net/FreeBSD)
SMF -
svcadm enable svc:/prefix/xyz
Solaris, Opensolaris based (illumos, smartos etc)
rc -
/etc/rc.d/xyz start
BSDs
launchd -
launchctl start xyz
OSX
SysV is the Linux standard (
/etc/rc.d/xyz
) that most new init systems continue to support the scripts from, so that's your base point.systemd is where Linux is heading
I'm not aware of a utility that can run on a lot of platforms but most config management software can do cross platform service management. Unfortunately that means you would need the config management software installed as well (or at least the underlying modules and runtime ruby/python). This is fine if you're managing the install on your own machines, as you could do all you install from the config tool. Not so good if you are trying to distribute software to anyone.
The following config management examples would interact with whatever the local default service manager is and start
xyz
if it is not already running. You don't need to be aware of anything more.A Chef recipe can manage a
service
resourcePuppet
service
Ansible
service
module