Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am looking for a GUI program, that shows running services from /etc/init.d (and /etc/init), and allows to manage (start / stop / runlevel) them. What can you recommend?

Background: even though I like working with the command line, this could ease things a bit on a test machine dedicated for trying out different services, so that you can see what is running and what not. For example: tomcat 5.5, tomcat 6, tomcat 7 on one machine for testing ... add two RDBMS in some versions, Apache httpd, ...

Last but not least: some CLI tool with decent ncurses menu will do as well.

share|improve this question

4 Answers 4

up vote 2 down vote accepted

Try sysv-rc-conf to alter the runlevel settings.

and chkconfig to see what's running

Don't forget that ubuntu (and others?) are starting to use the Upstart Startup Manager, so you'll have to keep an eye on the /etc/init directory too

share|improve this answer

Once upon a time I wrote a zenity-GUI myself. In short words: It looks for files in init.d, greps for the case statements, and tries to guess what should be displayed on the fly.

Maybe it doesn't work well for all services, but for my work (cups, postgresql, ...) it's sufficient.

As a side note, it shows how to dynamically fit your window to screensize (maximum) and content size (width, length).

Here it is:

#!/bin/bash
#
# oetv.sh
# Show all servives in /etc/init.d in a list, and let the user choose how to start it.
#
# (c) 2008 Stefan Wagner, license GPLv3
# 
# Search /etc/init.d/ for all executable files
# Get their number, and the maximum name size to produce a fitting window

width=0
height=0

# The font will influence the optimal window size
# But I don't know how to get them. 
# Probably depending on windowmanager, desktop, usersettings 

function xyFromList 
{
    anz=0 
    wmax=0 
    for file in $1
    do 
        anz=$((anz+1))
        len=${#file}
        [ $len -gt $wmax ] && wmax=$len
    done;
    width=$((wmax*9+50))
    height=$((anz*26+160))
}

dienstlist=$(ls /etc/init.d/ )
xyFromList "$dienstlist"

dienst=$(zenity --width=$width --height=$height --list --text "Service schalten" --column "Dienst" $dienstlist)
[ "foo"$dienst == "foo" ] && exit

# select options for the service, and display an apropriate window

optionen=$(egrep -h "[a-z]+\)" /etc/init.d/$dienst | sed 's/^[ \t]*//;s/).*/)/;s/#.*//;s/)//g;s/|/ /g' | sort -u)
xyFromList "$optionen"
aktion=$(zenity --width=$width --height=$height --list --text "Service schalten" --column "Befehl" $optionen)
[ "foo"$aktion == "foo" ] && exit
result=$(gksudo /etc/init.d/$dienst $aktion)
zenity --info "$aktion" --text "$result"

On my website I have screenshots, and german comments http://home.arcor.de/hirnstrom/minis/index.html#oetv.sh

share|improve this answer

On my Redhat (err, Centos) box:

curses: ntsysv

gui: system-config-services

On another note, remember to add the descriptive comment stanza to the top of your file. chkconfig and other tools (like ntsysv) read this.

share|improve this answer

If you also consider a web alternative, I suggest you to have a look at webmin.

share|improve this answer
    
Good suggestion but overkill –  pwn4g3 Aug 9 '10 at 22:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.