A full-featured desktop on a single CD that can still work on older equiptment.







 

Services menu

Starting and stopping services is simple under Slackware, if you know where to look. When a service or daemon is installed in the system, it has a startup script written to /eetc/rc.d. If you want it to run when the system starts up, you make its script in the rc.d folder executable. If you want to keep it from running, unset the executable bit.

If you don't know what you are doing, or you just want to save time, or you want to see displayed what is/isn't running all nice and neat, then run the services menu when logged in as root. You will see what is below . . .
these changes take effect when you reboot the computer.



Services Menu



Displays installed services (that have startup scripts) and shows a checkmark for each that is set as executable -- in other words, that will be run when the system starts.

The script is written in Python and uses wxGTK. It is called absServices.py. It looks for:
		Automounting
		atalk
		bind
		cups
		dnsmasq
		httpd
		inetd
		ip_forward
		lprng
		mysqld
		samba
		saslauthd
		scanluns
		sendmail
		syslog
		hplip
		sshd
		nfsd


ToDo

  1. Auto-generate each services item based upon what startup scripts are in the rc.d folder.

  2. Put the list into a scrollng window, in case there are a lot of them.


Script is below:




#!/usr/bin/env python

# set_services.py

import wx
import xdialog
import sys
import os
import wx.lib.scrolledpanel as scrolled

services_xpm = [
"16 16 4 1",
" 	c None",
".	c #CD0606",
"+	c #881350",
"@	c #43229C",
"....+...........",
".   @      @   .",
".   @     @@@  .",
".   @    @@@@@ .",
".   @   @@@@@@@.",
".   @      @   .",
".   @      @   .",
".   @      @   .",
".   @      @   .",
".   @      @   .",
".   @      @   .",
".@@@@@@@   @   .",
". @@@@@    @   .",
".  @@@     @   .",
".   @      @   .",
"...........+...."
]


class MyFrame(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(400, 300))
        self.panel = scrolled.ScrolledPanel(self, -1, size=(-1, -1), style = wx.VSCROLL|wx.SUNKEN_BORDER, name="self.panel" )
	ptX = 10

	icon = wx.BitmapFromXPMData = wx.BitmapFromXPMData(services_xpm)
	icon1=wx.EmptyIcon()
	icon1.CopyFromBitmap(icon)
	self.SetIcon(icon1)
	self.CenterOnScreen()
	fontBold = wx.Font(14, wx.DEFAULT, wx.DEFAULT, wx.FONTWEIGHT_BOLD)	
	
	self.topbox = wx.BoxSizer(wx.VERTICAL)
	self.vbox = wx.BoxSizer(wx.VERTICAL)
	self.hbox = wx.BoxSizer(wx.HORIZONTAL)

############################# services checkboxes ################################################################################

	self.txt = wx.StaticText(self.panel, -1, "Select Services")
	self.txt.SetForegroundColour((30, 30, 60))
	self.txt.SetFont(fontBold)
	self.vbox.Add(self.txt, 0, wx.ALIGN_CENTER | wx.TOP, 12)
	self.txt2 = wx.StaticText(self.panel, -1, "to run on system startup")
	self.vbox.Add(self.txt2, 0, wx.ALIGN_CENTER | wx.BOTTOM, 12)
	


	if os.access("/etc/rc.d/rc.hal", os.R_OK):
		ptX += 20
		self.cb1 = wx.CheckBox(self.panel, -1, 'Automounting', (10, ptX))
		self.vbox.Add(self.cb1, 0, wx.EXPAND)
		self.cb1.SetToolTip( wx.ToolTip('hald - hardware daemon, used for automounting. REQUIRES REBOOT to take effect.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setat, id=self.cb1.GetId())
		self.hal_state = False
		if os.access("/etc/rc.d/rc.hal", os.X_OK):
			self.cb1.SetValue(True)
			self.hal_state = True	


	if os.access("/etc/rc.d/rc.bind", os.R_OK):
		ptX += 20
		self.cb2 = wx.CheckBox(self.panel, -1, 'BIND server', (10, ptX))
		self.vbox.Add(self.cb2, 0, wx.EXPAND)
		self.cb2.SetToolTip( wx.ToolTip('BIND (Berkeley Internet Name Domain)\nis a Domain Name System (DNS) server.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setbind, id=self.cb2.GetId())
		self.bind_state = False
		if os.access("/etc/rc.d/rc.bind", os.X_OK):
			self.cb2.SetValue(True)
			self.bind_state = True
						

	if os.access("/etc/rc.d/rc.cups", os.R_OK):
		ptX += 20
		self.cb3 = wx.CheckBox(self.panel, -1, 'CUPS print server', (10, ptX))
		self.vbox.Add(self.cb3, 0, wx.EXPAND)
		self.cb3.SetToolTip( wx.ToolTip('The Common UNIX Printing system. \nIf you have a printer connected, you will want this.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setcups, id=self.cb3.GetId())
		self.cups_state = False
		if os.access("/etc/rc.d/rc.cups", os.X_OK):
			self.cb3.SetValue(True)
			self.cups_state = True
						
					
	if os.access("/etc/rc.d/rc.dnsmasq", os.R_OK):
		ptX += 20
		self.cb4 = wx.CheckBox(self.panel, -1, 'dnsmasq DHCP/DNS server', (10, ptX))
		self.vbox.Add(self.cb4, 0, wx.EXPAND)
		self.cb4.SetToolTip( wx.ToolTip('DNS forwarder and DHCP server.\n[Not needed for a client -- for example, to connect to cable internet service.]') )
		self.Bind(wx.EVT_CHECKBOX, self.Setdnsmasq, id=self.cb4.GetId())
		self.dnsmasq_state = False
		if os.access("/etc/rc.d/rc.dnsmasq", os.X_OK):
			self.cb4.SetValue(True)
			self.dnsmasq_state = True
			
			
	if os.access("/etc/rc.d/rc.httpd", os.R_OK):
		ptX += 20
		self.cb5 = wx.CheckBox(self.panel, -1, 'The Apache web server', (10, ptX))
		self.vbox.Add(self.cb5, 0, wx.EXPAND)
		self.cb5.SetToolTip( wx.ToolTip('Apache, the most widely used web server on the net.') )
		self.Bind(wx.EVT_CHECKBOX, self.Sethttpd, id=self.cb5.GetId())
		self.httpd_state = False
		if os.access("/etc/rc.d/rc.httpd", os.X_OK):
			self.cb5.SetValue(True)
			self.httpd_state = True
			
			
	if os.access("/etc/rc.d/rc.inetd", os.R_OK):
		ptX += 20
		self.cb6 = wx.CheckBox(self.panel, -1, 'The BSD Inetd daemon', (10, ptX))
		self.vbox.Add(self.cb6, 0, wx.EXPAND)
		self.cb6.SetToolTip( wx.ToolTip('Inetd daemon (this allows:  time, ftp, wx.comsat, talk, finger, and auth).') )
		self.Bind(wx.EVT_CHECKBOX, self.Setinetd, id=self.cb6.GetId())
		self.inetd_state = False
		if os.access("/etc/rc.d/rc.inetd", os.X_OK):
			self.cb6.SetValue(True)
			self.inetd_state = True
			

	if os.access("/etc/rc.d/rc.ip_forward", os.R_OK):
		ptX += 20
		self.cb7 = wx.CheckBox(self.panel, -1, 'Activate IP packet forwarding', (10, ptX))
		self.vbox.Add(self.cb7, 0, wx.EXPAND)
		self.cb7.SetToolTip( wx.ToolTip('Packet forwarding allows your Linux machine to act as a router.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setip_forward, id=self.cb7.GetId())
		self.ip_forward_state = False
		if os.access("/etc/rc.d/rc.ip_forward", os.X_OK):
			self.cb7.SetValue(True)
			self.ip_forward_state = True
		
			
	if os.access("/etc/rc.d/rc.lprng", os.R_OK):
		ptX += 20
		self.cb8 = wx.CheckBox(self.panel, -1, 'LPRng print server', (10, ptX))
		self.vbox.Add(self.cb8, 0, wx.EXPAND)
		self.cb8.SetToolTip( wx.ToolTip('The LPRng printing system (print spooler choice #2)') )
		self.Bind(wx.EVT_CHECKBOX, self.Setlprng, id=self.cb8.GetId())
		self.lprng_state = False
		if os.access("/etc/rc.d/rc.lprng", os.X_OK):
			self.cb8.SetValue(True)
			self.lprng_state = True
					

	if os.access("/etc/rc.d/rc.mysqld", os.R_OK):
		ptX += 20
		self.cb9 = wx.CheckBox(self.panel, -1, 'The MySQL database server', (10, ptX))
		self.vbox.Add(self.cb9, 0, wx.EXPAND)
		self.cb9.SetToolTip( wx.ToolTip('MySQL, an SQL-based relational database daemon.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setmysqld, id=self.cb9.GetId())
		self.mysqld_state = False
		if os.access("/etc/rc.d/rc.mysqld", os.X_OK):
			self.cb9.SetValue(True)
			self.mysqld_state = True
			

	if os.access("/etc/rc.d/rc.pcmcia", os.R_OK):
		ptX += 20
		self.cb10 = wx.CheckBox(self.panel, -1, 'PCMCIA/Cardbus card services', (10, ptX))
		self.vbox.Add(self.cb10, 0, wx.EXPAND)
		self.cb10.SetToolTip( wx.ToolTip('This supports PCMCIA or Cardbus cards used with laptops.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setpcmcia, id=self.cb10.GetId())
		self.pcmcia_state = False
		if os.access("/etc/rc.d/rc.pcmcia", os.X_OK):
			self.cb10.SetValue(True)
			self.pcmcia_state = True
			

	if os.access("/etc/rc.d/rc.rpc", os.R_OK):
		ptX += 20
		self.cb11 = wx.CheckBox(self.panel, -1, 'rc.rpc -- NFS (Network FileSystem) daemon', (10, ptX))
		self.vbox.Add(self.cb11, 0, wx.EXPAND)
		self.cb11.SetToolTip( wx.ToolTip('Needed to serve or mount NFS (Network File System) partitions.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setrpc, id=self.cb11.GetId())
		self.rpc_state = False
		if os.access("/etc/rc.d/rc.rpc", os.X_OK):
			self.cb11.SetValue(True)
			self.rpc_state = True
									

	if os.access("/etc/rc.d/rc.samba", os.R_OK):
		ptX += 20
		self.cb12 = wx.CheckBox(self.panel, -1, 'The Samba file/print server', (10, ptX))
		self.vbox.Add(self.cb12, 0, wx.EXPAND)
		self.cb12.SetToolTip( wx.ToolTip('Samba is a file and print server for Windows networks.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setsamba, id=self.cb12.GetId())
		self.samba_state = False
		if os.access("/etc/rc.d/rc.samba", os.X_OK):
			self.cb12.SetValue(True)
			self.samba_state = True
			
															
	if os.access("/etc/rc.d/rc.saslauthd", os.R_OK):
		ptX += 20
		self.cb13 = wx.CheckBox(self.panel, -1, 'The SASL authentication server', (10, ptX))
		self.vbox.Add(self.cb13, 0, wx.EXPAND)
		self.cb13.SetToolTip( wx.ToolTip('SASL is an authentication method often used by mail servers.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setsaslauthd, id=self.cb13.GetId())
		self.saslauthd_state = False
		if os.access("/etc/rc.d/rc.saslauthd", os.X_OK):
			self.cb13.SetValue(True)
			self.saslauthd_state = True
			

	if os.access("/etc/rc.d/rc.scanluns", os.R_OK):
		ptX += 20
		self.cb14 = wx.CheckBox(self.panel, -1, 'Scan for extra LUNs', (10, ptX))
		self.vbox.Add(self.cb14, 0, wx.EXPAND)
		self.cb14.SetToolTip( wx.ToolTip('Logical Unit Numbers are scanned to detect USB and other devices.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setscanluns, id=self.cb14.GetId())
		self.scanluns_state = False
		if os.access("/etc/rc.d/rc.scanluns", os.X_OK):
			self.cb14.SetValue(True)
			self.scanluns_state = True
				

	if os.access("/etc/rc.d/rc.sendmail", os.R_OK):
		ptX += 20
		self.cb15 = wx.CheckBox(self.panel, -1, 'The Sendmail mail server', (10, ptX))
		self.vbox.Add(self.cb15, 0, wx.EXPAND)
		self.cb15.SetToolTip( wx.ToolTip('The Sendmail server allows your machine to send and receive mail.\nNOT needed if you use a mail client (such as Sylpheed or Firebird) to send and recieve mail from your ISP.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setsendmail, id=self.cb15.GetId())
		self.sendmail_state = False
		if os.access("/etc/rc.d/rc.sendmail", os.X_OK):
			self.cb15.SetValue(True)
			self.sendmail_state = True
			
				
	if os.access("/etc/rc.d/rc.syslog", os.R_OK):
		ptX += 20
		self.cb16 = wx.CheckBox(self.panel, -1, 'The Linux system logging utilities', (10, ptX))
		self.vbox.Add(self.cb16, 0, wx.EXPAND)
		self.cb16.SetToolTip( wx.ToolTip('The syslogd and klogd daemons log important messages under /var/log.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setsyslog, id=self.cb16.GetId())
		self.syslog_state = False
		if os.access("/etc/rc.d/rc.syslog", os.X_OK):
			self.cb16.SetValue(True)
			self.syslog_state = True
			
				
	if os.access("/etc/rc.d/rc.sshd", os.R_OK):
		ptX += 20
		self.cb17 = wx.CheckBox(self.panel, -1, 'The SSHD (secure shell) daemon', (10, ptX))
		self.vbox.Add(self.cb17, 0, wx.EXPAND)
		self.cb17.SetToolTip( wx.ToolTip('The SSHD (secure shell) daemon" $RC_SSHD "SSHD allows secure encrypted logins to your machine.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setsshd, id=self.cb17.GetId())
		self.sshd_state = False
		if os.access("/etc/rc.d/rc.sshd", os.X_OK):
			self.cb17.SetValue(True)
			self.sshd_state = True
						
						
	if os.access("/etc/rc.d/rc.nfsd", os.R_OK):
		ptX += 20
		self.cb18 = wx.CheckBox(self.panel, -1, 'Network File System daemon', (10, ptX))
		self.vbox.Add(self.cb18, 0, wx.EXPAND)
		self.cb18.SetToolTip( wx.ToolTip('Network File System allows files to be shared over a network.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setnfsd, id=self.cb18.GetId())
		self.nfsd_state = False
		if os.access("/etc/rc.d/rc.nfsd", os.X_OK):
			self.cb18.SetValue(True)
			self.nfsd_state = True						
							
	if os.access("/usr/sbin/crond", os.R_OK):
		ptX += 20
		self.cb19 = wx.CheckBox(self.panel, -1, 'crond command daemon', (10, ptX))
		self.vbox.Add(self.cb19, 0, wx.EXPAND)
		self.cb19.SetToolTip( wx.ToolTip('crond - daemon to execute scheduled commands.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setcrond, id=self.cb19.GetId())
		self.crond_state = False
		if os.access("/usr/sbin/crond", os.X_OK):
			self.cb19.SetValue(True)
			self.crond_state = True
						
						
	if os.access("/usr/sbin/atd", os.R_OK):
		ptX += 20
		self.cb20 = wx.CheckBox(self.panel, -1, 'atd command daemon', (10, ptX))
		self.vbox.Add(self.cb20, 0, wx.EXPAND)
		self.cb20.SetToolTip( wx.ToolTip('atd - daemon to execute scheduled commands.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setat, id=self.cb20.GetId())
		self.at_state = False
		if os.access("/usr/sbin/atd", os.X_OK):
			self.cb20.SetValue(True)
			self.at_state = True	


	if os.access("/etc/rc.d/rc.atalk", os.R_OK):
		ptX += 20
		self.cb21 = wx.CheckBox(self.panel, -1, 'Netatalk Appletalk file/print server', (10, ptX))
		self.vbox.Add(self.cb21, 0, wx.EXPAND)
		self.cb21.SetToolTip( wx.ToolTip('The Netatalk server is a file and print server for Macintosh networks.') )
		self.Bind(wx.EVT_CHECKBOX, self.Setatalk, id=self.cb21.GetId())
		self.atalk_state = False
		if os.access("/etc/rc.d/rc.atalk", os.X_OK):
			self.cb21.SetValue(True)
			self.atalk_state = True
						
										
	if os.access("/etc/rc.d/rc.hplip", os.R_OK):
		ptX += 20
		self.cb22 = wx.CheckBox(self.panel, -1, 'HP printer support', (10, ptX))
		self.vbox.Add(self.cb22, 0, wx.EXPAND)
		self.cb22.SetToolTip( wx.ToolTip('Support for over 1000 HP printers. If you have an HP printer, turn this on!') )
		self.Bind(wx.EVT_CHECKBOX, self.Sethplip, id=self.cb22.GetId())
		self.hplip_state = False
		if os.access("/etc/rc.d/rc.hplip", os.X_OK):
			self.cb22.SetValue(True)
			self.hplip_state = True
																		
			
	self.btnClose = wx.Button(self.panel, -1, 'Close')
	self.btnClose.SetToolTip( wx.ToolTip('Close without making any changes.') )
	self.hbox.Add(self.btnClose, 0, wx.ALIGN_CENTER | wx.ALL, 4)
	self.btnApply = wx.Button(self.panel, -1, 'Apply')
	self.btnApply.SetToolTip( wx.ToolTip('Make the changes indicated in red.') )
	self.btnApply.Enable(False)
	self.hbox.Add(self.btnApply, 0, wx.ALIGN_CENTER | wx.ALL, 4)
		
        self.Bind(wx.EVT_BUTTON, self.OnClose, id=self.btnClose.GetId())
	self.Bind(wx.EVT_BUTTON, self.ApplyChanges, id=self.btnApply.GetId())


	self.topbox.Add(self.vbox, 0, wx.ALIGN_LEFT | wx.LEFT | wx.RIGHT | wx.BOTTOM, 20)
	self.topbox.Add(self.hbox, 0, wx.ALIGN_CENTER | wx.ALL, 4)
	
	self.panel.SetSizer(self.topbox)
	self.topbox.Fit(self)
	
	width, height = self.GetSizeTuple()
	#self.SetSizeHints(width, height, width, height)
	self.SetSizeHints(width + 16, 100, -1,-1)
	self.panel.SetupScrolling(scroll_x=False)
	
	
######################################

    def Sethal(self, event):
	if (self.cb1.GetValue() != self.hal_state):
		self.cb1.SetForegroundColour((255, 0, 0))
	else:
		self.cb1.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()	


    def Setbind(self, event):
	if (self.cb2.GetValue() != self.bind_state):
		self.cb2.SetForegroundColour((255, 0, 0))
	else:
		self.cb2.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()


    def Setcups(self, event):
	if (self.cb3.GetValue() != self.cups_state):
		self.cb3.SetForegroundColour((255, 0, 0))
	else:
		self.cb3.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setdnsmasq(self, event):
	if (self.cb4.GetValue() != self.dnsmasq_state):
		self.cb4.SetForegroundColour((255, 0, 0))
	else:
		self.cb4.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	
	
    def Sethttpd(self, event):
	if (self.cb5.GetValue() != self.httpd_state):
		self.cb5.SetForegroundColour((255, 0, 0))
	else:
		self.cb5.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()


    def Setinetd(self, event):
	if (self.cb6.GetValue() != self.inetd_state):
		self.cb6.SetForegroundColour((255, 0, 0))
	else:
		self.cb6.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()


    def Setip_forward(self, event):
	if (self.cb7.GetValue() != self.ip_forward_state):
		self.cb7.SetForegroundColour((255, 0, 0))
	else:
		self.cb7.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	
	
    def Setlprng(self, event):
	if (self.cb8.GetValue() != self.lprng_state):
		self.cb8.SetForegroundColour((255, 0, 0))
	else:
		self.cb8.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setmysqld(self, event):
	if (self.cb9.GetValue() != self.mysqld_state):
		self.cb9.SetForegroundColour((255, 0, 0))
	else:
		self.cb9.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setpcmcia(self, event):
	if (self.cb10.GetValue() != self.pcmcia_state):
		self.cb10.SetForegroundColour((255, 0, 0))
	else:
		self.cb10.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setrpc(self, event):
	if (self.cb11.GetValue() != self.rpc_state):
		self.cb11.SetForegroundColour((255, 0, 0))
	else:
		self.cb11.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setsamba(self, event):
	if (self.cb12.GetValue() != self.samba_state):
		self.cb12.SetForegroundColour((255, 0, 0))
	else:
		self.cb12.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setsaslauthd(self, event):
	if (self.cb13.GetValue() != self.saslauthd_state):
		self.cb13.SetForegroundColour((255, 0, 0))
	else:
		self.cb13.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setscanluns(self, event):
	if (self.cb14.GetValue() != self.scanluns_state):
		self.cb14.SetForegroundColour((255, 0, 0))
	else:
		self.cb14.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()	
	

    def Setsendmail(self, event):
	if (self.cb15.GetValue() != self.sendmail_state):
		self.cb15.SetForegroundColour((255, 0, 0))
	else:
		self.cb15.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setsyslog(self, event):
	if (self.cb16.GetValue() != self.syslog_state):
		self.cb16.SetForegroundColour((255, 0, 0))
	else:
		self.cb16.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	

    def Setsshd(self, event):
	if (self.cb17.GetValue() != self.sshd_state):
		self.cb17.SetForegroundColour((255, 0, 0))
	else:
		self.cb17.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()		
					

    def Setnfsd(self, event):
	if (self.cb18.GetValue() != self.nfsd_state):
		self.cb18.SetForegroundColour((255, 0, 0))
	else:
		self.cb18.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()	



    def Setcrond(self, event):
	if (self.cb19.GetValue() != self.crond_state):
		self.cb19.SetForegroundColour((255, 0, 0))
	else:
		self.cb19.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()		
					

    def Setat(self, event):
	if (self.cb20.GetValue() != self.at_state):
		self.cb20.SetForegroundColour((255, 0, 0))
	else:
		self.cb20.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()	


    def Setatalk(self, event):
	if (self.cb21.GetValue() != self.atalk_state):
		self.cb21.SetForegroundColour((255, 0, 0))
	else:
		self.cb21.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
	
	
    def Sethplip(self, event):
	if (self.cb22.GetValue() != self.hplip_state):
		self.cb22.SetForegroundColour((255, 0, 0))
	else:
		self.cb22.SetForegroundColour((0, 0, 0))
        self.Refresh()
	self.check_states()
			
#################################################################


    def check_states(self):
    
    	self.btnApply.Enable(False)

		
	try:
    		if self.cb1.GetValue() != self.hal_state:
			self.btnApply.Enable(True)
	except:
		pass


	try:
    		if self.cb2.GetValue() != self.bind_state:
			self.btnApply.Enable(True)
	except:
		pass
		
		
	try:
    		if self.cb3.GetValue() != self.cups_state:
			self.btnApply.Enable(True)
	except:
		pass
		

	try:
    		if self.cb4.GetValue() != self.dnsmasq_state:
			self.btnApply.Enable(True)
	except:
		pass
		
		
	try:
    		if self.cb5.GetValue() != self.httpd_state:
			self.btnApply.Enable(True)
	except:
		pass


	try:
    		if self.cb6.GetValue() != self.inetd_state:
			self.btnApply.Enable(True)
	except:
		pass
		
		
	try:
    		if self.cb7.GetValue() != self.ip_forward_state:
			self.btnApply.Enable(True)
	except:
		pass
		

	try:
    		if self.cb8.GetValue() != self.lprng_state:
			self.btnApply.Enable(True)
	except:
		pass
		
		
	try:
    		if self.cb9.GetValue() != self.mysqld_state:
			self.btnApply.Enable(True)
	except:
		pass


	try:
    		if self.cb10.GetValue() != self.pcmcia_state:
			self.btnApply.Enable(True)
	except:
		pass
		
		
	try:
    		if self.cb11.GetValue() != self.rpc_state:
			self.btnApply.Enable(True)
	except:
		pass

	try:
    		if self.cb12.GetValue() != self.samba_state:
			self.btnApply.Enable(True)
	except:
		pass
		

	try:
    		if self.cb13.GetValue() != self.saslauthd_state:
			self.btnApply.Enable(True)
	except:
		pass
		
		
	try:
    		if self.cb14.GetValue() != self.scanluns_state:
			self.btnApply.Enable(True)
	except:
		pass


	try:
    		if self.cb15.GetValue() != self.sendmail_state:
			self.btnApply.Enable(True)
	except:
		pass
		
		
	try:
    		if self.cb16.GetValue() != self.syslog_state:
			self.btnApply.Enable(True)
	except:
		pass
		
		
	try:
    		if self.cb17.GetValue() != self.sshd_state:
			self.btnApply.Enable(True)
	except:
		pass		
		
		
	try:
    		if self.cb18.GetValue() != self.nfsd_state:
			self.btnApply.Enable(True)
	except:
		pass	

	try:
    		if self.cb19.GetValue() != self.crond_state:
			self.btnApply.Enable(True)
	except:
		pass		
		
		
	try:
    		if self.cb20.GetValue() != self.at_state:
			self.btnApply.Enable(True)
	except:
		pass

	
    	try:
    		if self.cb21.GetValue() != self.atalk_state:
			self.btnApply.Enabled(True)
	except:
		pass
	
	
    	try:
    		if self.cb22.GetValue() != self.hplip_state:
			self.btnApply.Enabled(True)
	except:
		pass
					
#############################################################################		
		
    def OnClose(self, event):
        self.Close(True)

#############################################################################	

    def ApplyChanges(self, event):
    
    	changed_state = False

	try:
    		if self.cb1.GetValue() != self.hal_state:
			if self.cb1.GetValue() == True:
				os.chmod("/etc/rc.d/rc.hal", 0755)
			else:
				os.chmod("/etc/rc.d/rc.hal", 0644)
			changed_state = True	
	except:
		pass			


	try:
    		if self.cb2.GetValue() != self.bind_state:
			if self.cb2.GetValue() == True:
				os.chmod("/etc/rc.d/rc.bind", 0755)
			else:
				os.chmod("/etc/rc.d/rc.bind", 0644)
			changed_state = True	
	except:
		pass
		
			    
	try:
    		if self.cb3.GetValue() != self.cups_state:
			if self.cb3.GetValue() == True:
				os.chmod("/etc/rc.d/rc.cups", 0755)
			else:
				os.chmod("/etc/rc.d/rc.cups", 0644)
			changed_state = True	
	except:
		pass
	
	    
	try:
    		if self.cb4.GetValue() != self.dnsmasq_state:
			if self.cb4.GetValue() == True:
				os.chmod("/etc/rc.d/rc.dnsmasq", 0755)
			else:
				os.chmod("/etc/rc.d/rc.dnsmasq", 0644)
			changed_state = True	
	except:
		pass
	
	
	    
	try:
    		if self.cb5.GetValue() != self.httpd_state:
			if self.cb5.GetValue() == True:
				os.chmod("/etc/rc.d/rc.httpd", 0755)
			else:
				os.chmod("/etc/rc.d/rc.httpd", 0644)
			changed_state = True	
	except:
		pass
	

			    
	try:
    		if self.cb6.GetValue() != self.inetd_state:
			if self.cb6.GetValue() == True:
				os.chmod("/etc/rc.d/rc.inetd", 0755)
			else:
				os.chmod("/etc/rc.d/rc.inetd", 0644)
			changed_state = True	
	except:
		pass
	
	
	    
	try:
    		if self.cb7.GetValue() != self.ip_forward_state:
			if self.cb7.GetValue() == True:
				os.chmod("/etc/rc.d/rc.ip_forward", 0755)
			else:
				os.chmod("/etc/rc.d/rc.ip_forward", 0644)
			changed_state = True	
	except:
		pass
	

			    
	try:
    		if self.cb8.GetValue() != self.lprng_state:
			if self.cb8.GetValue() == True:
				os.chmod("/etc/rc.d/rc.lprng", 0755)
			else:
				os.chmod("/etc/rc.d/rc.lprng", 0644)
			changed_state = True	
	except:
		pass
	
	    
	try:
    		if self.cb9.GetValue() != self.mysqld_state:
			if self.cb9.GetValue() == True:
				os.chmod("/etc/rc.d/rc.mysqld", 0755)
			else:
				os.chmod("/etc/rc.d/rc.mysqld", 0644)
			changed_state = True	
	except:
		pass
	
	
			    
	try:
    		if self.cb10.GetValue() != self.pcmcia_state:
			if self.cb10.GetValue() == True:
				os.chmod("/etc/rc.d/rc.pcmcia", 0755)
			else:
				os.chmod("/etc/rc.d/rc.pcmcia", 0644)
			changed_state = True	
	except:
		pass
	

	try:
    		if self.cb11.GetValue() != self.rpc_state:
			if self.cb11.GetValue() == True:
				os.chmod("/etc/rc.d/rc.rpc", 0755)
			else:
				os.chmod("/etc/rc.d/rc.rpc", 0644)
			changed_state = True	
	except:
		pass
	
	
	    
	try:
    		if self.cb12.GetValue() != self.samba_state:
			if self.cb12.GetValue() == True:
				os.chmod("/etc/rc.d/rc.samba", 0755)
			else:
				os.chmod("/etc/rc.d/rc.samba", 0644)
			changed_state = True	
	except:
		pass
	
			    
	try:
    		if self.cb13.GetValue() != self.saslauthd_state:
			if self.cb13.GetValue() == True:
				os.chmod("/etc/rc.d/rc.saslauthd", 0755)
			else:
				os.chmod("/etc/rc.d/rc.saslauthd", 0644)
			changed_state = True	
	except:
		pass
	
			    
	try:
    		if self.cb14.GetValue() != self.scanluns_state:
			if self.cb14.GetValue() == True:
				os.chmod("/etc/rc.d/rc.scanluns", 0755)
			else:
				os.chmod("/etc/rc.d/rc.scanluns", 0644)
			changed_state = True	
	except:
		pass
	
	    
	try:
    		if self.cb15.GetValue() != self.sendmail_state:
			if self.cb15.GetValue() == True:
				os.chmod("/etc/rc.d/rc.sendmail", 0755)
			else:
				os.chmod("/etc/rc.d/rc.sendmail", 0644)
			changed_state = True	
	except:
		pass
	
	    
	try:
    		if self.cb16.GetValue() != self.syslog_state:
			if self.cb16.GetValue() == True:
				os.chmod("/etc/rc.d/rc.syslog", 0755)
			else:
				os.chmod("/etc/rc.d/rc.syslog", 0644)
			changed_state = True	
	except:
		pass
	

			    
	try:
    		if self.cb17.GetValue() != self.sshd_state:
			if self.cb17.GetValue() == True:
				os.chmod("/etc/rc.d/rc.sshd", 0755)
			else:
				os.chmod("/etc/rc.d/rc.sshd", 0644)
			changed_state = True	
	except:
		pass

			    
	try:
    		if self.cb18.GetValue() != self.nfsd_state:
			if self.cb18.GetValue() == True:
				os.chmod("/etc/rc.d/rc.nfsd", 0755)
			else:
				os.chmod("/etc/rc.d/rc.nfsd", 0644)
			changed_state = True	
	except:
		pass
	

	try:
    		if self.cb19.GetValue() != self.crond_state:
			if self.cb19.GetValue() == True:
				os.chmod("/usr/sbin/crond", 0755)
			else:
				os.chmod("/usr/sbin/crond", 0644)
			changed_state = True	
	except:
		pass

			    
	try:
    		if self.cb20.GetValue() != self.at_state:
			if self.cb20.GetValue() == True:
				os.chmod("/usr/sbin/atd", 0755)
			else:
				os.chmod("/usr/sbin/atd", 0644)
			changed_state = True	
	except:
		pass


	try:
    		if self.cb21.GetValue() != self.atalk_state:
			if self.cb21.GetValue() == True:
				os.chmod("/etc/rc.d/rc.atalk", 0755)
			else:
				os.chmod("/etc/rc.d/rc.atalk", 0644)
			changed_state = True	
	except:
		pass



	try:
    		if self.cb22.GetValue() != self.hplip_state:
			if self.cb22.GetValue() == True:
				os.chmod("/etc/rc.d/rc.hplip", 0755)
			else:
				os.chmod("/etc/rc.d/rc.hplip", 0644)
			changed_state = True	
	except:
		pass



	if changed_state:	
        	dlg = wx.MessageDialog(self, '\nThe changes have been applied.', "Changes made to services", wx.OK | wx.ICON_INFORMATION)
		dlg.ShowModal()
		dlg.Destroy()
				
        self.Close(True)
	
	
###################################################################################################################	
	
#####################################################################################################################	
	
class MyApp(wx.App):
    def OnInit(self):

	if not os.geteuid()==0:
    		sys.exit("\nOnly root can run this script\n")
    
        frame = MyFrame(None, -1, 'Service Menu')
        frame.Show(True)
        self.SetTopWindow(frame)
        return True

app = MyApp(0)
app.MainLoop()


Tux Pages created on Absolute OS Graphics made/edited by the Gimp   Created with the Gimp byPaul