JBoss Native SVN: r1053 - trunk/sight/native/share.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-28 04:25:49 -0400 (Fri, 28 Sep 2007)
New Revision: 1053
Modified:
trunk/sight/native/share/no.c
trunk/sight/native/share/proc.c
Log:
Fix JBNATIVE-38 by adding reference counter for long running native ops.
Modified: trunk/sight/native/share/no.c
===================================================================
--- trunk/sight/native/share/no.c 2007-09-28 07:31:45 UTC (rev 1052)
+++ trunk/sight/native/share/no.c 2007-09-28 08:25:49 UTC (rev 1053)
@@ -207,6 +207,7 @@
{
sight_object_t *no = J2P(instance, sight_object_t *);
jobject object = NULL;
+ apr_uint32_t ref_count;
UNREFERENCED_O;
@@ -215,6 +216,12 @@
#endif
if (!no)
return;
+ ref_count = apr_atomic_read32(&no->references);
+ while (ref_count) {
+ apr_thread_yield();
+ ref_count = apr_atomic_read32(&no->references);
+ }
+
if (no->object) {
object = (*_E)->NewLocalRef(_E, no->object);
(*_E)->DeleteWeakGlobalRef(_E, no->object);
Modified: trunk/sight/native/share/proc.c
===================================================================
--- trunk/sight/native/share/proc.c 2007-09-28 07:31:45 UTC (rev 1052)
+++ trunk/sight/native/share/proc.c 2007-09-28 08:25:49 UTC (rev 1053)
@@ -294,13 +294,17 @@
{
sight_object_t *no = J2P(instance, sight_object_t *);
sight_runproc_t *p;
+ apr_status_t rv;
UNREFERENCED_STDARGS;
if (!no || !no->native)
return APR_EINVAL;
+ SIGHT_NO_IREF(no);
p = (sight_runproc_t *)no->native;
- return (jint)apr_proc_wait(&p->p, &p->exitval, &p->exitwhy,
- (apr_wait_how_e)waithow);
+ rv = apr_proc_wait(&p->p, &p->exitval, &p->exitwhy,
+ (apr_wait_how_e)waithow);
+ SIGHT_NO_DREF(no);
+ return rv;
}
@@ -318,6 +322,7 @@
UNREFERENCED_STDARGS;
if (!no || !no->native)
return APR_EINVAL;
+ SIGHT_NO_IREF(no);
p = (sight_runproc_t *)no->native;
if (timeout < 0)
how = APR_WAIT;
@@ -325,9 +330,9 @@
how = APR_NOWAIT;
if ((rc = apr_proc_wait(&p->p, &p->exitval, &p->exitwhy,
how)) != APR_CHILD_NOTDONE)
- return rc;
+ goto done;
if (timeout < 1)
- return rc;
+ goto done;
timeout_value = timeout * 1000L;
timeout_interval = timeout_value / 64;
do {
@@ -338,6 +343,8 @@
timeout_interval *= 2;
} while (rc == APR_CHILD_NOTDONE);
+done:
+ SIGHT_NO_DREF(no);
return rc;
}
@@ -358,11 +365,11 @@
UNREFERENCED_O;
if (!no || !no->native || !progress)
return APR_EINVAL;
+ SIGHT_NO_IREF(no);
p = (sight_runproc_t *)no->native;
-
if ((rc = apr_proc_wait(&p->p, &p->exitval, &p->exitwhy,
APR_NOWAIT)) != APR_CHILD_NOTDONE)
- return rc;
+ goto done;
c = (*_E)->GetObjectClass(_E, progress);
cb.name = "progress";
@@ -370,11 +377,13 @@
cb.object = progress;
cb.method = (*_E)->GetMethodID(_E, c, cb.name, cb.msig);
if (!cb.method || (*_E)->ExceptionCheck(_E)) {
- return APR_EINVAL;
+ rc = APR_EINVAL;
+ goto done;
}
cres = (*_E)->CallIntMethod(_E, cb.object, cb.method, tick, NULL);
if ((*_E)->ExceptionCheck(_E)) {
- return APR_FROM_OS_ERROR(EINTR);
+ rc = APR_FROM_OS_ERROR(EINTR);
+ goto done;
}
if (timeout > 0) {
@@ -402,11 +411,14 @@
}
cres = (*_E)->CallIntMethod(_E, cb.object, cb.method, tick++, NULL);
if ((*_E)->ExceptionCheck(_E)) {
- return APR_FROM_OS_ERROR(EINTR);
+ rc = APR_FROM_OS_ERROR(EINTR);
+ goto done;
}
} while (rc == APR_CHILD_NOTDONE);
+done:
+ SIGHT_NO_DREF(no);
return rc;
}
17 years, 2 months
JBoss Native SVN: r1052 - trunk/sight/native/share.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-28 03:31:45 -0400 (Fri, 28 Sep 2007)
New Revision: 1052
Modified:
trunk/sight/native/share/no.c
Log:
Fix using nonallocated memory
Modified: trunk/sight/native/share/no.c
===================================================================
--- trunk/sight/native/share/no.c 2007-09-27 07:41:01 UTC (rev 1051)
+++ trunk/sight/native/share/no.c 2007-09-28 07:31:45 UTC (rev 1052)
@@ -115,10 +115,10 @@
sight_object_t *no;
UNREFERENCED_STDARGS;
- no = (sight_object_t *)calloc(1, sizeof(sight_object_t));
- if (!no) {
- throwAprMemoryException(_E, THROW_FMARK,
- apr_get_os_error());
+ if (!(no = (sight_object_t *)sight_calloc(_E,
+ sizeof(sight_object_t),
+ THROW_FMARK))) {
+ return 0;
}
no->cb.name = "callback";
no->cb.msig = "(Ljava/lang/Object;)I";
@@ -128,7 +128,6 @@
return P2J(no);
}
-static int created = 0;
SIGHT_EXPORT_DECLARE(void, NativeObject, init0)(SIGHT_STDARGS,
jobject thiz,
jlong instance,
17 years, 2 months
JBoss Native SVN: r1051 - in trunk/sight: native/os/linux and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-27 03:41:01 -0400 (Thu, 27 Sep 2007)
New Revision: 1051
Modified:
trunk/sight/java/org/jboss/sight/LibraryLoader.java
trunk/sight/native/os/linux/service.c
Log:
Add sparc->sparcv9 translation
Modified: trunk/sight/java/org/jboss/sight/LibraryLoader.java
===================================================================
--- trunk/sight/java/org/jboss/sight/LibraryLoader.java 2007-09-27 07:05:27 UTC (rev 1050)
+++ trunk/sight/java/org/jboss/sight/LibraryLoader.java 2007-09-27 07:41:01 UTC (rev 1051)
@@ -76,6 +76,8 @@
cpu = "parisc2";
else if (arch.startsWith("IA64"))
cpu = "ia64";
+ else if (arch.startsWith("sparc"))
+ cpu = "sparcv9";
else if (arch.equals("x86_64"))
cpu = "amd64";
else
Modified: trunk/sight/native/os/linux/service.c
===================================================================
--- trunk/sight/native/os/linux/service.c 2007-09-27 07:05:27 UTC (rev 1050)
+++ trunk/sight/native/os/linux/service.c 2007-09-27 07:41:01 UTC (rev 1051)
@@ -163,8 +163,7 @@
sprintf(rlpath, si->rlpath, si->what);
if ((rd = opendir(rlpath))) {
struct dirent *sent, sbuf;
- int found = 0;
- int state = SIGHT_SS_UNKNOWN;
+ int state = SIGHT_SS_DISABLED;
while (!readdir_r(rd, &sbuf, &sent)) {
char sname[PATH_MAX];
char smatch[PATH_MAX];
@@ -183,18 +182,12 @@
/* TODO: Launch script with status param
* to figure out the state.
*/
- found = 1;
+ state = SIGHT_SS_UNKNOWN;
break;
}
}
closedir(rd);
- if (found) {
- /* Populate the fields */
- CALL_METHOD1(0000, thiz, state);
- }
- else {
- CALL_METHOD1(0000, thiz, SIGHT_SS_DISABLED);
- }
+ CALL_METHOD1(0000, thiz, state);
}
SIGHT_FREE_CSTRING(name);
return APR_FROM_OS_ERROR(rc);
17 years, 3 months
JBoss Native SVN: r1050 - in trunk/sight/java/org/jboss/sight/platform: solaris and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-27 03:05:27 -0400 (Thu, 27 Sep 2007)
New Revision: 1050
Modified:
trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties
Log:
Add more services descriptions
Modified: trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
===================================================================
--- trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-27 06:41:18 UTC (rev 1049)
+++ trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-27 07:05:27 UTC (rev 1050)
@@ -135,7 +135,6 @@
httpd.1=Apache is a World Wide Web server. It is used to serve \
HTML files and CGI.
-
ip6tables.0=Ip6tables firewall
ip6tables.1=Starts, stops and saves ip6tables firewall
@@ -360,3 +359,8 @@
yum-updatesd.1=This is a daemon which periodically checks for updates \
and can send notifications via mail, dbus or syslog.
+# Some common synonyms
+apache.2 = httpd
+apache2.2 = httpd
+cron.2 = crond
+samba.2 = smb
Modified: trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties
===================================================================
--- trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties 2007-09-27 06:41:18 UTC (rev 1049)
+++ trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties 2007-09-27 07:05:27 UTC (rev 1050)
@@ -23,3 +23,31 @@
# Services.properties
# List the commonly known Solaris services
#
+
+acct.0=Process accounting
+acct.1=Starts or stops process accounting.
+
+acctadm.0=Accounting configuration
+acctadm.1=Restore the extended accounting configuration that was in effect \
+ before reboot.
+
+httpd.0=Apache HTTP Server
+httpd.1=Apache is a World Wide Web server. It is used to serve \
+ HTML files and CGI.
+
+sendmail.0=Mail Transport Agent
+sendmail.1=Sendmail is a Mail Transport Agent, which is the program \
+ that moves mail from one machine to another.
+
+samba.0=Samba network services
+samba.1=Starts and stops the Samba smbd and nmbd daemons \
+ used to provide SMB network services.
+
+syslog.0=System logging
+syslog.1=Syslog is the facility by which many daemons use to log \
+ messages to various system log files. It is a good idea to always \
+ run syslog.
+
+
+# Some common synonyms
+apache.2 = httpd
17 years, 3 months
JBoss Native SVN: r1049 - trunk/sight/java/org/jboss/sight/platform/linux.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-27 02:41:18 -0400 (Thu, 27 Sep 2007)
New Revision: 1049
Modified:
trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
Log:
Fix naming style, by removing extra capitalization
Modified: trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
===================================================================
--- trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-27 06:36:38 UTC (rev 1048)
+++ trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-27 06:41:18 UTC (rev 1049)
@@ -24,7 +24,7 @@
# List the commonly known Linux services
#
-acpid.0=Power Management
+acpid.0=ACPI daemon
acpid.1=Listen and dispatch ACPI events from the kernel
anacron.0=Actions scheduler
@@ -38,13 +38,13 @@
specified when at was run, and runs batch commands when the load \
average is low enough.
-auditd.0=Auditing System Daemon
-auditd.1=Linux Auditing System Daemon
+auditd.0=Auditing system daemon
+auditd.1=Linux auditing dystem daemon
autofs.0=Automount
autofs.1=Automounts filesystems on demand
-avahi-daemon.0=Avahi Daemon
+avahi-daemon.0=Avahi daemon
avahi-daemon.1=This is a daemon which runs on client machines to perform \
Zeroconf service discovery on a network. avahi-daemon must be \
running on systems that use Avahi for service discovery. \
@@ -85,11 +85,11 @@
This script just avoids that the postun script \
of hal-cups-utils < 0.6.0 fails.
-dc_client.0=Distcache Client Proxy
-dc_client.1=Distributed SSL Session Cache Client Proxy.
+dc_client.0=Distcache client proxy
+dc_client.1=Distributed SSL session cache client proxy.
-dc_server.0=Distcache Server
-dc_server.1=Distributed SSL Session Cache server.
+dc_server.0=Distcache server
+dc_server.1=Distributed SSL session cache server.
dhcdbd.0=DHcp Client D-Bus Daemon
dhcdbd.1=dhcdbd provides D-BUS control of the ISC DHCP client, \
@@ -139,8 +139,8 @@
ip6tables.0=Ip6tables firewall
ip6tables.1=Starts, stops and saves ip6tables firewall
-ipmi.0=OpenIPMI Driver
-ipmi.1=OpenIPMI Driver init script
+ipmi.0=OpenIPMI driver
+ipmi.1=OpenIPMI driver init script
iptables.0=Iptables firewall
iptables.1=Starts, stops and saves iptables firewall
@@ -171,8 +171,8 @@
kudzu.1=This runs the hardware probe, and optionally configures \
changed hardware.
-mcstrans.0=SELinux Context Translation System Daemon
-mcstrans.1=This starts the SELinux Context Translation System Daemon
+mcstrans.0=SELinux context translation system daemon
+mcstrans.1=This starts the SELinux context translation system daemon
mdmonitor.0=RAID monitoring and management
mdmonitor.1=This starts, stops, and reloads the mdadm-based \
17 years, 3 months
JBoss Native SVN: r1048 - in trunk/sight/java/org/jboss/sight: platform/linux and 1 other directory.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-27 02:36:38 -0400 (Thu, 27 Sep 2007)
New Revision: 1048
Modified:
trunk/sight/java/org/jboss/sight/Service.java
trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
Log:
Add sysnonim for service script names
Modified: trunk/sight/java/org/jboss/sight/Service.java
===================================================================
--- trunk/sight/java/org/jboss/sight/Service.java 2007-09-26 17:04:09 UTC (rev 1047)
+++ trunk/sight/java/org/jboss/sight/Service.java 2007-09-27 06:36:38 UTC (rev 1048)
@@ -80,9 +80,10 @@
}
}
}
- if (OS.IS_LINUX || OS.IS_SOLARIS) {
- service.DisplayName = serviceProperties.getProperty(service.Name + ".0", service.DisplayName);
- service.Description = serviceProperties.getProperty(service.Name + ".1");
+ if (OS.IS_LINUX || OS.IS_SOLARIS) {
+ String pserviceName = serviceProperties.getProperty(service.Name + ".2", service.Name);
+ service.DisplayName = serviceProperties.getProperty(pserviceName + ".0", service.DisplayName);
+ service.Description = serviceProperties.getProperty(pserviceName + ".1");
}
}
Modified: trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
===================================================================
--- trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-26 17:04:09 UTC (rev 1047)
+++ trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-27 06:36:38 UTC (rev 1048)
@@ -30,6 +30,9 @@
anacron.0=Actions scheduler
anacron.1=Run cron jobs that were left out due to downtime
+apmd.0=Advanced Power Management
+apmd.1=Start or stop the Advanced Power Management daemon.
+
atd.0=Actions scheduler
atd.1=Runs commands scheduled by the at command at the time \
specified when at was run, and runs batch commands when the load \
@@ -161,6 +164,9 @@
loading a kdump kernel into memory at system bootup time, \
and for copying away a vmcore at system panic time.
+klogd.0=Kernel log daemon
+klogd.1=Start the kernel log daemon
+
kudzu.0=Kudzu hardware probe
kudzu.1=This runs the hardware probe, and optionally configures \
changed hardware.
@@ -250,6 +256,11 @@
rdisc.0=Rdisc daemon
rdisc.1=This is a daemon which discovers routers on the local subnet.
+readahead.0=Prereads programs required for startup into memory
+readahead.1=This service causes the programs used during startup \
+ to be loaded into memory before they are needed, \
+ thus improving startup performance.
+
readahead_early.0=Prereads programs required for startup into memory
readahead_early.1=This service causes the programs used during startup \
to be loaded into memory before they are needed, \
17 years, 3 months
JBoss Native SVN: r1047 - trunk/sight/java/org/jboss/sight/platform/linux.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-26 13:04:09 -0400 (Wed, 26 Sep 2007)
New Revision: 1047
Modified:
trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
Log:
Be consistent. Remove extra dots in names
Modified: trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
===================================================================
--- trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-26 17:01:44 UTC (rev 1046)
+++ trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-26 17:04:09 UTC (rev 1047)
@@ -117,11 +117,11 @@
haldaemon.1=This is a daemon for collecting and maintaing information \
about hardware from several sources.
-halt.0=Runlevel 0 (halt) or runlevel 6 (reboot).
+halt.0=Runlevel 0 (halt) or runlevel 6 (reboot)
halt.1=It kills all processes, unmounts file systems and then either \
halts or reboots.
-hidd.0=Bluetooth Human Interface Device Daemon.
+hidd.0=Bluetooth Human Interface Device Daemon
hidd.1=Bluetooth Human Interface Device Daemon. Provides keyboard, \
mouse etc. functionality over Bluetooth.
@@ -161,7 +161,7 @@
loading a kdump kernel into memory at system bootup time, \
and for copying away a vmcore at system panic time.
-kudzu.0=Kudzu hardware probe.
+kudzu.0=Kudzu hardware probe
kudzu.1=This runs the hardware probe, and optionally configures \
changed hardware.
@@ -183,11 +183,11 @@
microcode_ctl.0=Apply cpu microcode
microcode_ctl.1=Apply cpu microcode if kernel has CPU microcode device support.
-netfs.0=Mount network filesystems.
+netfs.0=Mount network filesystems
netfs.1=Mounts and unmounts all Network File System (NFS), \
SMB/CIFS (Lan Manager/Windows), and NCP (NetWare) mount points.
-netplugd.0=Network plug management daemon.
+netplugd.0=Network plug management daemon
netplugd.1=Netplugd is a daemon for managing non-static network \
interfaces.
@@ -312,7 +312,7 @@
messages to various system log files. It is a good idea to always \
run syslog.
-tux.0=TUX Kernel-based http server.
+tux.0=TUX Kernel-based http server
tux.1=The TUX threaded kernel-based http server
vncserver.0=VNCserver
17 years, 3 months
JBoss Native SVN: r1046 - trunk/sight/java/org/jboss/sight/platform/linux.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-26 13:01:44 -0400 (Wed, 26 Sep 2007)
New Revision: 1046
Modified:
trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
Log:
Add more known services descriptions
Modified: trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
===================================================================
--- trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-26 15:25:54 UTC (rev 1045)
+++ trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-26 17:01:44 UTC (rev 1046)
@@ -112,3 +112,240 @@
as the Midnight Commander. It also allows mouse-based console \
cut-and-paste operations, and includes support for pop-up \
menus on the console.
+
+haldaemon.0=HAL daemon
+haldaemon.1=This is a daemon for collecting and maintaing information \
+ about hardware from several sources.
+
+halt.0=Runlevel 0 (halt) or runlevel 6 (reboot).
+halt.1=It kills all processes, unmounts file systems and then either \
+ halts or reboots.
+
+hidd.0=Bluetooth Human Interface Device Daemon.
+hidd.1=Bluetooth Human Interface Device Daemon. Provides keyboard, \
+ mouse etc. functionality over Bluetooth.
+
+hplip.0=HPLIP
+hplip.1=HP Linux Imaging and Printing (HPLIP)
+
+httpd.0=Apache HTTP Server
+httpd.1=Apache is a World Wide Web server. It is used to serve \
+ HTML files and CGI.
+
+
+ip6tables.0=Ip6tables firewall
+ip6tables.1=Starts, stops and saves ip6tables firewall
+
+ipmi.0=OpenIPMI Driver
+ipmi.1=OpenIPMI Driver init script
+
+iptables.0=Iptables firewall
+iptables.1=Starts, stops and saves iptables firewall
+
+irda.0=IrDA support
+irda.1=IrDA(TM) (Infrared Data Association) is an industry standard \
+ for wireless, infrared communication between devices. IrDA speeds range \
+ from 9600 bps to 4 Mbps, and IrDA can be used by many modern devices \
+ including laptops, LAN adapters, PDAs, printers, and mobile phones.
+
+irqbalance.0=Irq balancing daemon
+irqbalance.1=The irqbalance daemon will distribute interrupts across \
+ the cpus on a multiprocessor system with the purpose of \
+ spreading the load.
+
+isdn.0=ISDN services
+isdn.1=Start and stop ISDN services
+
+kdump.0=Kernel dump
+kdump.1=The kdump init script provides the support necessary for \
+ loading a kdump kernel into memory at system bootup time, \
+ and for copying away a vmcore at system panic time.
+
+kudzu.0=Kudzu hardware probe.
+kudzu.1=This runs the hardware probe, and optionally configures \
+ changed hardware.
+
+mcstrans.0=SELinux Context Translation System Daemon
+mcstrans.1=This starts the SELinux Context Translation System Daemon
+
+mdmonitor.0=RAID monitoring and management
+mdmonitor.1=This starts, stops, and reloads the mdadm-based \
+ software RAID monitoring and management facility
+
+mdmdp.0=Multipath device monitoring and management
+mdmdp.1=This starts, stops, and reloads the mdmpd-based \
+ multipath device monitoring and management facility
+
+messagebus.0=D-BUS systemwide message bus
+messagebus.1=This is a daemon which broadcasts notifications of system events \
+ and other messages.
+
+microcode_ctl.0=Apply cpu microcode
+microcode_ctl.1=Apply cpu microcode if kernel has CPU microcode device support.
+
+netfs.0=Mount network filesystems.
+netfs.1=Mounts and unmounts all Network File System (NFS), \
+ SMB/CIFS (Lan Manager/Windows), and NCP (NetWare) mount points.
+
+netplugd.0=Network plug management daemon.
+netplugd.1=Netplugd is a daemon for managing non-static network \
+ interfaces.
+
+network.0=Bring up/down networking
+network.1=Activates/Deactivates all network interfaces configured to \
+ start at boot time.
+
+NetworkManager.0=NetworkManager daemon
+NetworkManager.1=This is a daemon for automatically switching network \
+ connections to the best available connection.
+
+NetworkManagerDispatcher.0=NetworkManagerDispatcher daemon
+NetworkManagerDispatcher.1=This daemon automatically runs scripts when NetworkManager \
+ changes the network state.
+
+nfs.0=NFS services
+nfs.1=NFS is a popular protocol for file sharing across TCP/IP \
+ networks. This service provides NFS server functionality, \
+ which is configured via the /etc/exports file.
+
+nfslock.0=NFS file locking service
+nfslock.1=NFS is a popular protocol for file sharing across \
+ TCP/IP networks. This service provides NFS file \
+ locking functionality.
+
+nscd.0=Name Switch Cache Daemon
+nscd.1=This is a daemon which handles passwd and group lookups \
+ for running programs and cache the results for the next \
+ query. You should start this daemon if you use \
+ slow naming services like NIS, NIS+, LDAP, or hesiod.
+
+ntpd.0=NTPv4 daemon
+ntpd.1=The Network Time Protocol (NTP) is used to synchronize the time of \
+ a computer client or server to another server or reference time source, \
+ such as a radio or satellite receiver or modem.
+
+pand.0=Bluetooth Personal Area Networking Daemon
+pand.1=Bluetooth Personal Area Networking Daemon. Provides network \
+ services over Bluetooth.
+
+pcscd.0=PC/SC smart card daemon
+pcscd.1=The PC/SC smart card daemon is a resource manager for the \
+ PC/SC lite and Musclecard frameworks. It coordinates \
+ communications with smart card readers, smart cards, and \
+ cryptographic tokens that are connected to the system.
+
+portmap.0=RPC portmapper
+portmap.1=The portmapper manages RPC connections, which are used by \
+ protocols such as NFS and NIS. The portmap server must be \
+ running on machines which act as servers for protocols which \
+ make use of the RPC mechanism.
+
+postgresql.0=PostgreSQL server
+postgresql.1=Starts and stops the PostgreSQL backend daemon that handles \
+ all database requests.
+
+psacct.0=Kernel process accounting
+psacct.1=Starts and stops process accounting
+
+rdisc.0=Rdisc daemon
+rdisc.1=This is a daemon which discovers routers on the local subnet.
+
+readahead_early.0=Prereads programs required for startup into memory
+readahead_early.1=This service causes the programs used during startup \
+ to be loaded into memory before they are needed, \
+ thus improving startup performance.
+
+readahead_later.0=Prereads programs required for startup into memory
+readahead_later.1=This service causes the programs used during startup \
+ to be loaded into memory before they are needed, \
+ thus improving startup performance.
+
+restorecond.0=Maintain path file context
+restorecond.1=Restorecond uses inotify to look for creation of new files \
+ listed in the /etc/selinux/restorecond.conf file, and restores the \
+ correct security context.
+
+rpcgssd.0=RPCSEC GSS daemon
+rpcgssd.1=Starts user-level daemon that manages RPCSEC GSS contexts \
+ for the NFSv4 client.
+
+
+rpcidmapd.0=RPC name to UID/GID mapper
+rpcidmapd.1=Starts user-level daemon for NFSv4 that maps user \
+ names to UID and GID numbers.
+
+rpcsvcgssd.0=RPCSEC GSS daemon
+rpcsvcgssd.0=Starts user-level daemon that manages RPCSEC GSS contexts \
+ for the NFSv4 server.
+
+saslauthd.0=SASL authentication daemon.
+saslauthd.1=Saslauthd is a server process which handles plaintext \
+ authentication requests on behalf of the cyrus-sasl library.
+
+sendmail.0=Mail Transport Agent
+sendmail.1=Sendmail is a Mail Transport Agent, which is the program \
+ that moves mail from one machine to another.
+
+setroubleshoot.0=SELinux Troubleshooting Daemon
+setroubleshoot.1=This starts the SELinux Troubleshooting Daemon
+
+smartd.0=SMART daemon
+smartd.1=Self Monitoring and Reporting Technology (SMART) Daemon
+
+smb.0=Samba network services
+smb.1=Starts and stops the Samba smbd and nmbd daemons \
+ used to provide SMB network services.
+
+squid.0=Squid Internet Object Cache
+squid.1=Squid - Internet Object Cache. Internet object caching is \
+ a way to store requested Internet objects (i.e., data available \
+ via the HTTP, FTP, and gopher protocols) on a system closer to the \
+ requesting site than to the source. Web browsers can then use the \
+ local Squid cache as a proxy HTTP server, reducing access time as \
+ well as bandwidth consumption.
+
+sshd.0=OpenSSH server daemon
+sshd.1=This starts, stops, and reloads the OpenSSH server daemon.
+
+syslog.0=System logging
+syslog.1=Syslog is the facility by which many daemons use to log \
+ messages to various system log files. It is a good idea to always \
+ run syslog.
+
+tux.0=TUX Kernel-based http server.
+tux.1=The TUX threaded kernel-based http server
+
+vncserver.0=VNCserver
+vncserver.1=Starts and stops vncserver. \
+ Used to provide remote X administration services.
+
+winbind.0=Samba winbind daemon
+winbind.1=Starts and stops the Samba winbind daemon
+
+wpa_supplicant.0=WPA Supplicant
+wpa_supplicant.1=WPA Supplicant for Linux, BSD and \
+ Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). Supplicant \
+ is the IEEE 802.1X/WPA component that is used in the client stations. \
+ It implements key negotiation with a WPA Authenticator and it controls \
+ the roaming and IEEE 802.11 authentication/association of the wlan driver.
+
+xend.0=Xen control daemon
+xend.1=Starts and stops the Xen control daemon.
+
+xendomains.0=Xen domains
+xendomains.1=Start, stop Xen domains automatically when domain 0 boots or shuts down.
+
+xfs.0=X Font Server
+xfs.1=Starts and stops the X Font Server at boot time and shutdown. \
+ It also takes care of (re-)generating font lists.
+
+ypbind.0=Ypbind Daemon
+ypbind.1=This is a daemon which runs on NIS/YP clients and binds them \
+ to a NIS domain. It must be running for systems based on glibc \
+ to work as NIS clients, but it should not be enabled on systems \
+ which are not using NIS.
+
+yum-updatesd.0=Yum-updates daemon
+yum-updatesd.1=This is a daemon which periodically checks for updates \
+ and can send notifications via mail, dbus or syslog.
+
17 years, 3 months
JBoss Native SVN: r1045 - in trunk/sight: java/org/jboss/sight/platform/linux and 2 other directories.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-26 11:25:54 -0400 (Wed, 26 Sep 2007)
New Revision: 1045
Added:
trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties
Modified:
trunk/sight/java/org/jboss/sight/Service.java
trunk/sight/native/os/linux/service.c
Log:
Use properties files for common services
Modified: trunk/sight/java/org/jboss/sight/Service.java
===================================================================
--- trunk/sight/java/org/jboss/sight/Service.java 2007-09-26 11:57:11 UTC (rev 1044)
+++ trunk/sight/java/org/jboss/sight/Service.java 2007-09-26 15:25:54 UTC (rev 1045)
@@ -25,7 +25,10 @@
package org.jboss.sight;
+import java.io.IOException;
+import java.io.InputStream;
import java.util.EnumSet;
+import java.util.Properties;
/**
* Service
@@ -47,6 +50,42 @@
IProgressNotificationCallback progress,
long timeout, int state);
+ private static Properties serviceProperties = null;
+ private static boolean servicePropertiesLoaded = false;
+
+ private static void setupKnownService(Service service)
+ {
+ if (serviceProperties == null) {
+ serviceProperties = new Properties();
+ if (OS.IS_LINUX) {
+ try {
+ InputStream is = LibraryLoader.class.getResourceAsStream
+ ("/org/jboss/sight/platform/linux/Services.properties");
+ serviceProperties.load(is);
+ is.close();
+ }
+ catch (Throwable t) {
+ // Nothing
+ }
+ }
+ else if (OS.IS_SOLARIS) {
+ try {
+ InputStream is = LibraryLoader.class.getResourceAsStream
+ ("/org/jboss/sight/platform/solaris/Services.properties");
+ serviceProperties.load(is);
+ is.close();
+ }
+ catch (Throwable t) {
+ // Nothing
+ }
+ }
+ }
+ if (OS.IS_LINUX || OS.IS_SOLARIS) {
+ service.DisplayName = serviceProperties.getProperty(service.Name + ".0", service.DisplayName);
+ service.Description = serviceProperties.getProperty(service.Name + ".1");
+ }
+ }
+
private Service()
{
super(0);
@@ -72,6 +111,7 @@
throw new OperatingSystemException(Error.getError(e));
}
Name = name;
+ setupKnownService(this);
}
protected Service(ServiceControlManager scm, String name,
@@ -85,6 +125,7 @@
throw new OperatingSystemException(Error.getError(e));
}
Name = name;
+ setupKnownService(this);
}
/**
Added: trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
===================================================================
--- trunk/sight/java/org/jboss/sight/platform/linux/Services.properties (rev 0)
+++ trunk/sight/java/org/jboss/sight/platform/linux/Services.properties 2007-09-26 15:25:54 UTC (rev 1045)
@@ -0,0 +1,114 @@
+# Copyright(c) 2007 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Mladen Turk
+#
+# Services.properties
+# List the commonly known Linux services
+#
+
+acpid.0=Power Management
+acpid.1=Listen and dispatch ACPI events from the kernel
+
+anacron.0=Actions scheduler
+anacron.1=Run cron jobs that were left out due to downtime
+
+atd.0=Actions scheduler
+atd.1=Runs commands scheduled by the at command at the time \
+ specified when at was run, and runs batch commands when the load \
+ average is low enough.
+
+auditd.0=Auditing System Daemon
+auditd.1=Linux Auditing System Daemon
+
+autofs.0=Automount
+autofs.1=Automounts filesystems on demand
+
+avahi-daemon.0=Avahi Daemon
+avahi-daemon.1=This is a daemon which runs on client machines to perform \
+ Zeroconf service discovery on a network. avahi-daemon must be \
+ running on systems that use Avahi for service discovery. \
+ Avahi-daemon should not be running otherwise.
+
+avahi-dnsconfd.0=Avahi dns configuration daemon
+avahi-dnsconfd.1=Connects to a running avahi-daemon and runs the script \
+ /etc/avahi/dnsconf.action for each unicast DNS server that is announced \
+ on the local LAN. This is useful for configuring unicast DNS servers in \
+ a DHCP-like fashion with mDNS.
+
+bluetooth.0=Bluetooth services
+bluetooth.1=Bluetooth services for service discovery, authentication, \
+ Human Interface Devices, etc.
+
+capi.0=Capi services
+capi.1=Start and stop capi services for passiv ISDN cards
+
+conman.0=ConMan
+conman.1=The ConMan daemon is used for console management.
+
+cpuspeed.0=CPU speed
+cpuspeed.1=Run dynamic CPU speed daemon and/or load appropriate \
+ cpu frequency scaling kernel modules and governors.
+
+crond.0=Cron clock daemon
+crond.1=Cron is a standard UNIX program that runs user-specified \
+ programs at periodic scheduled times. vixie cron adds a \
+ number of features to the basic UNIX cron, including better \
+ security and more powerful configuration options.
+
+cups.0=Common UNIX Printing System
+cups.1=Startup/shutdown script for the Common UNIX \
+ Printing System (CUPS).
+
+cups-config-daemon.0=CUPS configuration daemon (obsolete)
+cups-config-daemon.1=cups-config-daemon is obsolete. \
+ This script just avoids that the postun script \
+ of hal-cups-utils < 0.6.0 fails.
+
+dc_client.0=Distcache Client Proxy
+dc_client.1=Distributed SSL Session Cache Client Proxy.
+
+dc_server.0=Distcache Server
+dc_server.1=Distributed SSL Session Cache server.
+
+dhcdbd.0=DHcp Client D-Bus Daemon
+dhcdbd.1=dhcdbd provides D-BUS control of the ISC DHCP client, \
+ dhclient, and D-BUS access to the DHCP options obtained by \
+ dhclient for each IPv4 interface.
+
+dund.0=Bluetooth Dial-Up-Networking Daemon
+dund.1=Bluetooth Dial-Up-Networking Daemon. Provides PPP over RFCOMM \
+ services.
+
+firstboot.0=Firstboot druid
+firstboot.1=Firstboot is a druid style program that runs on the first time \
+ a machine is booted after install. It checks for the existence \
+ of an /etc/sysconfig/firstboot file. If it doesn't find the file, \
+ then the firstboot program needs to run. If it finds the file, \
+ firstboot will not be run. \
+ If /etc/reconfigSys exists, run the reconfiguration \
+ program and remove /etc/reconfigSys when done. \
+ Also will run if 'reconfig' is on the kernel cmdline.
+
+gpm.0=GPM Mouse support
+gpm.1=GPM adds mouse support to text-based Linux applications such \
+ as the Midnight Commander. It also allows mouse-based console \
+ cut-and-paste operations, and includes support for pop-up \
+ menus on the console.
Property changes on: trunk/sight/java/org/jboss/sight/platform/linux/Services.properties
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties
===================================================================
--- trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties (rev 0)
+++ trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties 2007-09-26 15:25:54 UTC (rev 1045)
@@ -0,0 +1,25 @@
+# Copyright(c) 2007 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Mladen Turk
+#
+# Services.properties
+# List the commonly known Solaris services
+#
Property changes on: trunk/sight/java/org/jboss/sight/platform/solaris/Services.properties
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/sight/native/os/linux/service.c
===================================================================
--- trunk/sight/native/os/linux/service.c 2007-09-26 11:57:11 UTC (rev 1044)
+++ trunk/sight/native/os/linux/service.c 2007-09-26 15:25:54 UTC (rev 1045)
@@ -131,68 +131,7 @@
sight_unload_class(_E, &_clazzn);
}
-static const struct {
- const char *script;
- const char *name;
- const char *description;
-} known_services[] = {
- { "acpid"
- "Power Management",
- "Listen and dispatch ACPI events from the kernel"
- },
- { "anacron"
- "Actions scheduler",
- "Run cron jobs that were left out due to downtime"
- },
- { "atd"
- "Actions scheduler",
- "Runs commands scheduled by the at command at the time "
- "specified when at was run, and runs batch commands when the load "
- "average is low enough."
- },
- { "auditd"
- "Auditing System Daemon",
- "Linux Auditing System Daemon"
- },
- { "autofs"
- "Automount",
- "Automounts filesystems on demand"
- },
- { "avahi-daemon"
- "Avahi Daemon",
- "This is a daemon which runs on client machines to perform "
- "Zeroconf service discovery on a network. avahi-daemon must be "
- "running on systems that use Avahi for service discovery. "
- "Avahi-daemon should not be running otherwise."
- },
- { "avahi-dnsconfd"
- "Avahi dns configuration daemon",
- "Connects to a running avahi-daemon and runs the script "
- "/etc/avahi/dnsconf.action for each unicast DNS server that is announced "
- "on the local LAN. This is useful for configuring unicast DNS servers in "
- "a DHCP-like fashion with mDNS."
- },
-
- { NULL,
- NULL,
- NULL
- }
-};
-
-int find_service_desc(const char *name)
-{
- int i = 0;
- while (known_services[i].script) {
- if (!strcmp(known_services[i].script, name)) {
- return i;
- }
- i++;
- }
- return -1;
-}
-
-
SIGHT_EXPORT_DECLARE(jint, Service, open0)(SIGHT_STDARGS,
jobject thiz,
jlong instance,
@@ -238,16 +177,8 @@
strcat(smatch, J2S(name));
/* Match the SnnName */
if (!sight_wmatch(sname, smatch)) {
- int snix = find_service_desc(J2S(name));
-
SET_IFIELD_S(0001, thiz, sname);
- if (snix >= 0) {
- SET_IFIELD_S(0004, thiz, known_services[snix].name);
- SET_IFIELD_S(0005, thiz, known_services[snix].description);
- }
- else {
- SET_IFIELD_S(0004, thiz, sent->d_name);
- }
+ SET_IFIELD_S(0004, thiz, sent->d_name);
/* TODO: Launch script with status param
* to figure out the state.
17 years, 3 months
JBoss Native SVN: r1044 - trunk/sight/native/os/linux.
by jbossnative-commits@lists.jboss.org
Author: mladen.turk(a)jboss.com
Date: 2007-09-26 07:57:11 -0400 (Wed, 26 Sep 2007)
New Revision: 1044
Modified:
trunk/sight/native/os/linux/service.c
Log:
Remove parsing the script files. Use predefined list of known service names
Modified: trunk/sight/native/os/linux/service.c
===================================================================
--- trunk/sight/native/os/linux/service.c 2007-09-25 05:55:25 UTC (rev 1043)
+++ trunk/sight/native/os/linux/service.c 2007-09-26 11:57:11 UTC (rev 1044)
@@ -131,64 +131,65 @@
sight_unload_class(_E, &_clazzn);
}
-#define SCC_DESC "# description:"
-#define SCC_PNAM "# processname:"
-#define SCC_PIDF "# pidfile:"
+static const struct {
+ const char *script;
+ const char *name;
+ const char *description;
+} known_services[] = {
+ { "acpid"
+ "Power Management",
+ "Listen and dispatch ACPI events from the kernel"
+ },
+ { "anacron"
+ "Actions scheduler",
+ "Run cron jobs that were left out due to downtime"
+ },
+ { "atd"
+ "Actions scheduler",
+ "Runs commands scheduled by the at command at the time "
+ "specified when at was run, and runs batch commands when the load "
+ "average is low enough."
+ },
+ { "auditd"
+ "Auditing System Daemon",
+ "Linux Auditing System Daemon"
+ },
+ { "autofs"
+ "Automount",
+ "Automounts filesystems on demand"
+ },
+ { "avahi-daemon"
+ "Avahi Daemon",
+ "This is a daemon which runs on client machines to perform "
+ "Zeroconf service discovery on a network. avahi-daemon must be "
+ "running on systems that use Avahi for service discovery. "
+ "Avahi-daemon should not be running otherwise."
+ },
+ { "avahi-dnsconfd"
+ "Avahi dns configuration daemon",
+ "Connects to a running avahi-daemon and runs the script "
+ "/etc/avahi/dnsconf.action for each unicast DNS server that is announced "
+ "on the local LAN. This is useful for configuring unicast DNS servers in "
+ "a DHCP-like fashion with mDNS."
+ },
-static void parse_service_script(const char *fname, char *description,
- char *procname, char *pidfile)
-{
- FILE *file;
- char buf[8192];
- int mdesc = 0;
- if (!(file = fopen(fname, "r")))
- return;
- while (fgets(&buf[0], 8192, file)) {
- char *pline = sight_trim(&buf[0]);
- /* Skip empty lines */
- if (pline) {
- if (*pline != '#')
- break;
- if (mdesc) {
- mdesc = 0;
- if (buf[0] == '#' && buf[1] == ' ') {
- pline = sight_trim(&buf[1]);
- if (pline) {
- if (strlen(description) + strlen(pline) < SIGHT_MBUFFER_LEN) {
- strcat(description, pline);
- if (description[strlen(description) - 1] == '\\') {
- /* We have multi-line description */
- description[strlen(description) - 1] = '\0';
- mdesc = 1;
- }
- }
- }
- }
- if (!mdesc)
- continue;
- }
- if (!strncmp(pline, SCC_DESC, sizeof(SCC_DESC) - 1)) {
- apr_cpystrn(description, pline + sizeof(SCC_DESC),
- SIGHT_MBUFFER_SIZ);
- if (description[strlen(description) - 1] == '\\') {
- /* We have multi-line description */
- description[strlen(description) - 1] = '\0';
- mdesc = 1;
- }
- }
- else if (!strncmp(pline, SCC_PNAM, sizeof(SCC_PNAM) - 1)) {
- apr_cpystrn(procname, pline + sizeof(SCC_PNAM),
- SIGHT_SBUFFER_SIZ);
- }
- else if (!strncmp(pline, SCC_PIDF, sizeof(SCC_PIDF) - 1)) {
- apr_cpystrn(pidfile, pline + sizeof(SCC_PIDF),
- SIGHT_SBUFFER_SIZ);
- }
+ { NULL,
+ NULL,
+ NULL
+ }
+};
+
+int find_service_desc(const char *name)
+{
+ int i = 0;
+ while (known_services[i].script) {
+ if (!strcmp(known_services[i].script, name)) {
+ return i;
}
- }
-
- fclose(file);
+ i++;
+ }
+ return -1;
}
@@ -225,7 +226,7 @@
struct dirent *sent, sbuf;
int found = 0;
int state = SIGHT_SS_UNKNOWN;
- while (!readdir_r(rd, &sbuf, &sent)) {
+ while (!readdir_r(rd, &sbuf, &sent)) {
char sname[PATH_MAX];
char smatch[PATH_MAX];
struct stat sb;
@@ -237,29 +238,20 @@
strcat(smatch, J2S(name));
/* Match the SnnName */
if (!sight_wmatch(sname, smatch)) {
- char pn[SIGHT_SBUFFER_SIZ] = "";
- char pf[SIGHT_SBUFFER_SIZ] = "";
- char dn[SIGHT_MBUFFER_SIZ] = "";
- parse_service_script(sname, dn, pn, pf);
+ int snix = find_service_desc(J2S(name));
+
SET_IFIELD_S(0001, thiz, sname);
- SET_IFIELD_S(0003, thiz, sent->d_name);
- if (pn[0])
- SET_IFIELD_S(0004, thiz, pn);
- else
+ if (snix >= 0) {
+ SET_IFIELD_S(0004, thiz, known_services[snix].name);
+ SET_IFIELD_S(0005, thiz, known_services[snix].description);
+ }
+ else {
SET_IFIELD_S(0004, thiz, sent->d_name);
- SET_IFIELD_S(0005, thiz, dn);
-
- if (pf[0]) {
- struct stat sb;
- if (stat(pf, &sb) >= 0) {
- /* If there is a pidfile the service
- * is probably running
- */
- state = SIGHT_SS_RUNNING;
- }
- else
- state = SIGHT_SS_STOPPED;
}
+
+ /* TODO: Launch script with status param
+ * to figure out the state.
+ */
found = 1;
break;
}
@@ -267,10 +259,10 @@
closedir(rd);
if (found) {
/* Populate the fields */
- CALL_METHOD1(0000, thiz, state);
+ CALL_METHOD1(0000, thiz, state);
}
else {
- CALL_METHOD1(0000, thiz, SIGHT_SS_DISABLED);
+ CALL_METHOD1(0000, thiz, SIGHT_SS_DISABLED);
}
}
SIGHT_FREE_CSTRING(name);
17 years, 3 months