ClearFoundation

ClearOS API

Class Daemon

Description

System daemons manager.

A meta file is used to organize and manage the daemons on the system. In an ideal world, we would be able to scan the list of init scripts in /etc/rc.d and generate the service list on the fly. Unfortunately there are some inconsistencies that make this impossible. The meta file holds the following information:

  • the RPM where the daemon lives
  • the daemon/process name (what you see with ps)
  • whether or not the daemon supports a "/etc/rc.d/init.d/<xyz> reload"
  • a short title (eg Apache Web Server)
Note: a few daemons are not really "running" per se, but are part of the kernel e.g. the firewall and bandwidth limiter.

Ideally, the constructor would require the same parameter as the Software class -- the name of the package. However, some packages can have more than one daemon.

Located in /api/Daemon.class.php (line 75)

Engine
   |
   --Software
      |
      --Daemon
Direct descendents
Class Description
Cups Cups print server class.
SpamAssassin SpamAssassin class.
Fetchmail Fetchmail class.
Snort Snort intrusion detection class.
Mysql Mysql class.
OpenVpn OpenVPN server.
Firewall Firewall base class.
Bacula Backup and restore system system using Bacula.
Cyrus Cyrus mail server class.
Ipsec IpSec class.
Layer7Filter Protocol filter (l7-filter) class.
Freshclam Freshclam class.
Httpd Httpd web server class.
Postfix Postfix mail server.
Ldap LDAP class.
DnsMasq Dnsmasq caching nameserver.
AutoFs Automount Utility.
Pcmcia PCMCIA server.
Syslog Syslog class.
SnortSam SnortSam intrusion prevention class.
Nmbd Netbios name server.
Amavis Amavis class.
Suva Suva utility class.
Postgrey Postgrey class.
Winbind Netbios name server.
Cron Cron server and crontab configuration.
Pptpd PPTP VPN class.
ClamAv ClamAV class.
Proftpd ProFTP FTP server.
Kolab Kolab groupware class.
Webconfig Webconfig class.
Syswatch System watch class.
Squid Squid web proxy class.
DansGuardian DansGuardian filtering software.
Samba Samba server.
Class Constant Summary
 CMD_CHKCONFIG = '/sbin/chkconfig'
 CMD_LS = '/bin/ls'
 CMD_PIDOF = '/sbin/pidof'
 CMD_SERVICE = '/sbin/service'
 PATH_INITD = '/etc/rc.d/rc3.d'
Variable Summary
string $initscript
string $package
string $processname
boolean $reloadable
string $title
Method Summary
Daemon __construct (string $initscript)
void __destruct ()
boolean GetBootState ()
string GetProcessName ()
boolean GetRunningState ()
string GetTitle ()
void Reset ()
void Restart ()
void SetBootState (boolean $state)
void SetRunningState (boolean $state)
Variables
string $initscript (line 85)
  • var: init script filename
  • access: protected
string $package (line 103)
  • var: software package name
  • access: protected
string $processname (line 91)
  • var: the process name
  • access: protected
boolean $reloadable (line 110)
  • var: true if daemon supports configuration reload
  • access: protected
string $title (line 97)
  • var: short title
  • access: protected

Inherited Variables

Inherited from Software

Software::$copyright
Software::$description
Software::$installsize
Software::$installtime
Software::$packager
Software::$pkgname
Software::$release
Software::$summary
Software::$version

Inherited from Engine

Engine::$errors
Methods
Constructor __construct (line 128)

Daemon constructor.

  • access: public
Daemon __construct (string $initscript)
  • string $initscript: filename of init script in /etc/rc.d.

Redefinition of:
Software::__construct()
Software constructor.

Redefined in descendants as:
GetBootState (line 167)

Returns the boot state of the daemon.

  • return: true if daemon is set to run at boot
  • throws: EngineException
  • access: public
boolean GetBootState ()
GetProcessName (line 227)

Returns the process name of the daemon.

  • return: process name
  • throws: EngineException
  • access: public
string GetProcessName ()
GetRunningState (line 197)

Returns the running state of the daemon.

  • return: true if the daemon is running
  • throws: EngineException
  • access: public
boolean GetRunningState ()
GetTitle (line 242)

Returns a short title for the daemon (eg Apache Web Server).

  • return: short tile for daemon
  • throws: EngineException
  • access: public
string GetTitle ()
Reset (line 257)

Restarts the daemon if (and only if) it is already running.

  • throws: EngineException
  • access: public
void Reset ()
Restart (line 294)

Restarts the daemon.

void Restart ()
SetBootState (line 317)

Sets the boot state of the daemon.

  • throws: EngineException, ValidationException
  • access: public
void SetBootState (boolean $state)
  • boolean $state: desired boot state
SetRunningState (line 349)

Sets running state of the daemon.

  • throws: EngineException, ValidationException
  • access: public
void SetRunningState (boolean $state)
  • boolean $state: desired running state

Inherited Methods

Inherited From Software

Software::__construct()
Software::GetCopyright()
Software::GetDescription()
Software::GetInstallSize()
Software::GetInstallTime()
Software::GetPackageName()
Software::GetPackager()
Software::GetRelease()
Software::GetRpmInfo()
Software::GetSummary()
Software::GetVersion()
Software::IsInstalled()
Software::__destruct()

Inherited From Engine

Engine::__construct()
Engine::AddValidationError()
Engine::CheckValidationErrors()
Engine::CopyValidationErrors()
Engine::GetValidationErrors()
Engine::Log()
Engine::__destruct()
Class Constants
CMD_CHKCONFIG = '/sbin/chkconfig' (line 113)
CMD_LS = '/bin/ls' (line 112)
CMD_PIDOF = '/sbin/pidof' (line 115)
CMD_SERVICE = '/sbin/service' (line 114)
PATH_INITD = '/etc/rc.d/rc3.d' (line 116)

Inherited Constants

Inherited from Software

Software::COMMAND_RPM

Inherited from Engine

Engine::COMMAND_API

Documentation generated on Fri, 28 Aug 2009 20:32:02 -0400 by phpDocumentor 1.3.2