You are not logged in.

#1 2010-02-09 08:37:00

mosh
Member
Registered: 2007-05-06
Posts: 12

List of active daemons

Quick newbie question:
How do I get a list of all currently active daemons?

Offline

#2 2010-02-09 09:10:42

mcmillan
Member
Registered: 2006-04-06
Posts: 737

Re: List of active daemons

/var/run/daemons/

Offline

#3 2010-02-09 09:15:49

mosh
Member
Registered: 2007-05-06
Posts: 12

Re: List of active daemons

Thanks for the quick reply. smile

Offline

#4 2010-02-09 09:18:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: List of active daemons

This script from someone on these boards (possibly Xyne, but my memory fails...)

#!/bin/bash
# daemon status

 function chk_status(){
  target=$1
  if [ $target != "functions" ] && [ $target !=  "functions.d" ]
  then
    if [ -f "/var/run/daemons/$target" ]
     then
       stat="\e[1;32m[RUNNING]"
     else
       stat="\e[1;31m[STOPPED]"
     fi

    printf "$stat \t\e[1;34m$target\e[0;0m\n"
  fi
 }

 daemons=$(ls /etc/rc.d/)

 if [[ $1 != "" ]]
  then
   chk_status $1
 else
   for d in $daemons
    do
     chk_status $d
   done | sort
 fi

 exit 0

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB