Daily Archives

Articles indexed Thursday November 1 2012

Page 11/16 | < Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • PHP static function self:: in joomla JFactory class explanation?

    - by Carbon6
    Hi I'm looking at the code of Joomla and trying to figure out what exactly happends in this function. index.php makes a call to function $app = JFactory::getApplication('site'); jfactory.php code public static function getApplication($id = null, $config = array(), $prefix='J') { if (!self::$application) { jimport('joomla.application.application'); self::$application = JApplication::getInstance($id, $config, $prefix); } return self::$application; } application.php code.. public static function getInstance($client, $config = array(), $prefix = 'J') { static $instances; if (!isset($instances)) { $instances = array(); } ....... more code ........ return $instances[$client]; } Now I cannot figure out in function getApplication why is self:$application used. self::$application = JApplication::getInstance($id, $config, $prefix); $application is always null, what is the purpose of using this approach. I tryied modifying it to $var = JApplication::getInstance($id, $config, $prefix); and returnig it but it doesn't work. I would be very glad if someone with more knowledge could explain what is happening here detailed as possible. Many thanks.

    Read the article

  • Photoshop CS5 not recognising activeDocument

    - by Max Kielland
    I wrote a quite big script for Photoshop CS5.1 on my 64bit Vista machine. Now when I run the very same script on my new 64bit Windows 7 machine, Adobe ExtendScript Tool complains about activeDocument (no such element) in this simple script: #target photoshop var pDoc = app.activeDocument; alert("Done!"); I have tried both and without #target and choosing the target in the ExtendedScript Tool. Is there something I have missed, or do I need to install something more. I only installed the 64bit version of Photoshop. Is it so that the 32bit Photoshop has the script extensions? I don't see why I need to install both 32bit and 64bit versions if I'm only going to use the 64bit version. EDIT I installed the 32bit version as well. Tried the same script against 32 and 64 bit, still no difference. SOLVED The mystery is solved. It is embarrassing simple if you interpret the error message more careful. Of course I can't get an activeDocument if there are no documents in Photoshop, duh!?! I interpreted it as the statement activeDocument wasn't recognised, but of course if I have no document there is no such element (as a photoshop document) to give me. I'm used to C++ and would expect the reuslt to be a NULL value or similar if there is a problem to get the document... excuses, excuses ;) Well, if someone else should get into the same problem, here is the answer on my expense :D

    Read the article

  • How to display different value with ComboBoxTableCell?

    - by Philippe Jean
    I try to use ComboxBoxTableCell without success. The content of the cell display the right value for the attribute of an object. But when the combobox is displayed, all items are displayed with the toString object method and not the attribute. I tryed to override updateItem of ComboBoxTableCell or to provide a StringConverter but nothing works. Do you have some ideas to custom comboxbox list display in a table cell ? I put a short example below to see quickly the problem. Execute the app and click in the cell, you will see the combobox with toString value of the object. package javafx2; import javafx.application.Application; import javafx.beans.property.adapter.JavaBeanObjectPropertyBuilder; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.Scene; import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; import javafx.scene.control.TableColumn.CellDataFeatures; import javafx.scene.control.TableView; import javafx.scene.control.cell.ComboBoxTableCell; import javafx.stage.Stage; import javafx.util.Callback; import javafx.util.StringConverter; public class ComboBoxTableCellTest extends Application { public class Product { private String name; public Product(String name) { this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } } public class Command { private Integer quantite; private Product product; public Command(Product product, Integer quantite) { this.product = product; this.quantite = quantite; } public Integer getQuantite() { return quantite; } public void setQuantite(Integer quantite) { this.quantite = quantite; } public Product getProduct() { return product; } public void setProduct(Product product) { this.product = product; } } public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { Product p1 = new Product("Product 1"); Product p2 = new Product("Product 2"); final ObservableList<Product> products = FXCollections.observableArrayList(p1, p2); ObservableList<Command> commands = FXCollections.observableArrayList(new Command(p1, 20)); TableView<Command> tv = new TableView<Command>(); tv.setItems(commands); TableColumn<Command, Product> tc = new TableColumn<Command, Product>("Product"); tc.setMinWidth(140); tc.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Command,Product>, ObservableValue<Product>>() { @Override public ObservableValue<Product> call(CellDataFeatures<Command, Product> cdf) { try { JavaBeanObjectPropertyBuilder<Product> jbdpb = JavaBeanObjectPropertyBuilder.create(); jbdpb.bean(cdf.getValue()); jbdpb.name("product"); return (ObservableValue) jbdpb.build(); } catch (NoSuchMethodException e) { System.err.println(e.getMessage()); } return null; } }); final StringConverter<Product> converter = new StringConverter<ComboBoxTableCellTest.Product>() { @Override public String toString(Product p) { return p.getName(); } @Override public Product fromString(String s) { // TODO Auto-generated method stub return null; } }; tc.setCellFactory(new Callback<TableColumn<Command,Product>, TableCell<Command,Product>>() { @Override public TableCell<Command, Product> call(TableColumn<Command, Product> tc) { return new ComboBoxTableCell<Command, Product>(converter, products) { @Override public void updateItem(Product product, boolean empty) { super.updateItem(product, empty); if (product != null) { setText(product.getName()); } } }; } }); tv.getColumns().add(tc); tv.setEditable(true); Scene scene = new Scene(tv, 140, 200); stage.setScene(scene); stage.show(); } }

    Read the article

  • Legacy Java code use of com.sun.net.ssl.internal.ssl.Provider()

    - by Dan
    I am working with some code from back in 2003. There is a reference to the following class: new com.sun.net.ssl.internal.ssl.Provider() It is causing an error: Access restriction: The type Provider is not accessible due to restriction on required library /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/jre/lib/jsse.jar Does anyone have any suggestions for a suitable alternative to using this class?

    Read the article

  • Obj-c Turning long string into multidimensional array

    - by Phil
    I have a long NSString, something like "t00010000t00020000t00030000" and so on. I need to split that up into each "t0001000". I'm using... NSArray *tileData = [[GameP objectForKey:@"map"] componentsSeparatedByString:@"t"]; And it splits it up, but the "t" is missing, which I need (although I think I could append it back on). The other way I guess would be to split it up by counting 8 char's, although not sure how to do that. But ideally I need it split into a [][] type array so I can get to each bit with something like... NSString tile = [[tileData objectAtIndex:i] objectAtIndex:j]]; I'm new to obj-c so thanks for any help.

    Read the article

  • access custom group

    - by Carlos
    I have my Access 2007 database configured to use "Custom" groups in the navigation pane. I've grouped all my tables in a way that makes sense. However, whenever I update a link table, it loses its grouping. I have not been able to find a way to avoid this. Since it seems to be unavoidable, I'd like to simply have a macro that adds the table back to the right group programatically. I have not found any examples on how to do this. Any suggestions?

    Read the article

  • xcode 4 creating a 2d grid (range and domain)

    - by user1706978
    I'm learning how to program c and i'm trying to make a program the finds the range (using an equation with x as the domain) of a 2d grid...ive already attempted it, but it's giving me all these errors on Xcode, any help?(As you can see, I'm quite stuck!) #include <stdio.h> #include <stdlib.h> float domain; float domain = 2.0; float domainsol(float x ) { domain = x; float func = 1.25 * x + 5.0; return func; } int main(int argc, const char * argv[]) { }

    Read the article

  • Java -Android. Parser problem

    - by Kano
    I am making a very simple app with an RSS reader. The reader works great, but it's only giving me the title, and i want the description too. I'am very new to android, and I have tried a lot of things, but I can't get it to work. I've found a lot of parsers but they are to complicated for me to understand, so I was hoping to find a simple solution, since it's only title and description i want. Can anyone help me? import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class NyhedActivity extends Activity { String streamTitle = ""; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.nyheder); TextView result = (TextView)findViewById(R.id.result); try { URL rssUrl = new URL("http://tv2sport.dk/rss/*/*/*/248/*/*"); SAXParserFactory mySAXParserFactory = SAXParserFactory.newInstance(); SAXParser mySAXParser = mySAXParserFactory.newSAXParser(); XMLReader myXMLReader = mySAXParser.getXMLReader(); RSSHandler myRSSHandler = new RSSHandler(); myXMLReader.setContentHandler(myRSSHandler); InputSource myInputSource = new InputSource(rssUrl.openStream()); myXMLReader.parse(myInputSource); result.setText(streamTitle); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); result.setText("Cannot connect RSS!"); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); result.setText("Cannot connect RSS!"); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); result.setText("Cannot connect RSS!"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); result.setText("Cannot connect RSS!"); } } private class RSSHandler extends DefaultHandler { final int stateUnknown = 0; final int stateTitle = 1; int state = stateUnknown; int numberOfTitle = 0; String strTitle = ""; String strElement = ""; @Override public void startDocument() throws SAXException { // TODO Auto-generated method stub strTitle = "Nyheder fra "; } @Override public void endDocument() throws SAXException { // TODO Auto-generated method stub strTitle += ""; streamTitle = "" + strTitle; } @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // TODO Auto-generated method stub if (localName.equalsIgnoreCase("title")) { state = stateTitle; strElement = ""; numberOfTitle++; } else { state = stateUnknown; } } @Override public void endElement(String uri, String localName, String qName) throws SAXException { // TODO Auto-generated method stub if (localName.equalsIgnoreCase("title")) { strTitle += strElement + "\n"+"\n"; } state = stateUnknown; } @Override public void characters(char[] ch, int start, int length) throws SAXException { // TODO Auto-generated method stub String strCharacters = new String(ch, start, length); if (state == stateTitle) { strElement += strCharacters; } } } }

    Read the article

  • Using Simple XML and getting NoClassDefFoundError in Android

    - by Berat Onur Ersen
    I'm trying to use Simple XML to convert my java objects to XML format in my Android application. I'm getting NoClassDefFoundError at line Serializer serializer = new Persister(); java.lang.NoClassDefFoundError: org.simpleframework.xml.core.Persister I have simple-xml-2.6.1.jar in project class path and when I got NoClassDefFoundError I also put these 3 jars in classpath stax-1.2.0.jar stax-api-1.0.1.jar xpp3-1.1.3_8.jar but made no use. Still having NoClassDefFoundError. Any kind of help will be appreciated.Thank you.

    Read the article

  • Multiple elements with the same name with SimpleXML and Java

    - by LouieGeetoo
    I'm trying to use SimpleXML to parse an XML document (an ItemLookupResponse for a book from the Amazon Product Advertising API) which contains the following element: <ItemAttributes> <Author>Shane Conder</Author> <Author>Lauren Darcey</Author> <Manufacturer>Pearson Educacion</Manufacturer> <ProductGroup>Book</ProductGroup> <Title>Android Wireless Application Development: Barnes & Noble Special Edition</Title> </ItemAttributes> My problem is that I don't know how to deal with the multiple possible Author elements. Here's what I have right now for the corresponding POJO (Plain Old Java Object), keeping in mind that it's not handling the case of multiple Authors: @Element public class ItemAttributes { @Element public String Author; @Element public String Manufacturer; @Element public String Title; } (I don't care about the ProductGroup, so it's not in the class -- I'm just setting SimpleXML's strict mode to off to allow for that.) I couldn't find an example in the documentation that corresponded with such a case. Using an ElementList with (inline=true) seemed along the right lines, but I didn't see how to do it for String (as opposed to a separate Author class, which I have no need for and don't see how it would even work). Here's a similar question and answer, but for PHP: php - simpleXML how to access a specific element with the same name as others? I don't know what the Java equivalent would be to the accepted answer. Thanks in advance.

    Read the article

  • Simple Xml list parsing problem

    - by Hubidubi
    I have this xml: <root> <fruitlist> <apple>4</apple> <apple>5</apple> <orange>2</orange> <orange>6</orange> </fruitlist> </root> I'm writing a parser class, although I can't figure out how to deal with multiple node types. I can easily parse a list that contains only one node type (eg. just apples, not oranges) @ElementList(name = "fruitlist") private List<Apple> exercises; with more than one node type it also wants so parse non Apple nodes which doesn't work. I also tried to make another list for oranges, but it doen't work, I can't use fruitlist name more than once. @ElementList(name = "fruitlist", entry = "orange") private List<Orange> exercises; The ideal would be two seperate list for both node types. Hubi EDIT: After more searching & fiddling this question is a duplicate: Inheritance with Simple XML Framework

    Read the article

  • How to avoid serializing zero values with Simple Xml

    - by Bram Vandenbussche
    I'm trying to serialise an object using simple xml (http://simple.sourceforge.net/). The object setup is pretty simple: @Root(name = "order_history") public class OrderHistory { @Element(name = "id", required = false) public int ID; @Element(name = "id_order_state") public int StateID; @Element(name = "id_order") public int OrderID; } The problem is when I create a new instance of this class without an ID: OrderHistory newhistory = new OrderHistory(); newhistory.OrderID = _orderid; newhistory.StateID = _stateid; and I serialize it via simple xml: StringWriter xml = new StringWriter(); Serializer serializer = new Persister(); serializer.write(newhistory, xml); it still reads 0 in the resulting xml: <?xml version='1.0' encoding='UTF-8'?> <order_history> <id>0</id> <id_order>2</id_order> <id_order_state>8</id_order_state> </order_history> I'm guessing the reason for this is that the ID property is not null, since integers can't be null. But I really need to get rid of this node, and I'd rather not remove it manually. Any clues anyone?

    Read the article

  • Rails: How do I get created_at to show the time in my current time zone?

    - by Schneems
    Seems that when i create an object, the time is not correct. You can see by the script/console output below. Has anyone encountered anything like this, or have any debugging tips? >> Ticket.create(...) => #<Ticket id: 7, from_email: "[email protected]", ticket_collaterals: nil, to_email: "[email protected]", body: "hello", subject: "testing", status: nil, whymail_id: nil, created_at: "2009-12-31 04:23:20", updated_at: "2009-12-31 04:23:20", forms_id: nil, body_hash: nil> >> Ticket.last.created_at.to_s(:long) => "December 31, 2009 04:23" >> Time.now.to_s(:long) => "December 30, 2009 22:24"

    Read the article

  • Adding Suggestions to the SharePoint 2010 Search Programatically

    - by Ricardo Peres
    There are numerous pages that show how to do this with PowerShell, but I found none on how to do it with plain old C#, so here it goes! To abbreviate, I wanted to have SharePoint suggest the site collection user’s names after the first letters are filled in a search site’s search box. Here’s how I did it: 1: //get the Search Service Application (replace with your own name) 2: SearchServiceApplication searchApp = farm.Services.GetValue<SearchQueryAndSiteSettingsService>().Applications.GetValue<SearchServiceApplication>("Search Service Application") as SearchServiceApplication; 3: 4: Ranking ranking = new Ranking(searchApp); 5:  6: //replace EN-US with your language of choice 7: LanguageResourcePhraseList suggestions = ranking.LanguageResources["EN-US"].QuerySuggestionsAlwaysSuggestList; 8:  9: foreach (SPUser user in rootWeb.Users) 10: { 11: suggestions.AddPhrase(user.Name, String.Empty); 12: } 13:  14: //get the job that processes suggestions and run it 15: SPJobDefinition job = SPFarm.Local.Services.OfType<SearchService>().SelectMany(x => x.JobDefinitions).Where(x => x.Name == "Prepare query suggestions").Single(); 16: job.RunNow(); You may do this, for example, on a feature. Of course, feel free to change users for something else, all suggestions are treated as pure text.

    Read the article

  • Remove values from array on foreach PHP

    - by user104531
    I have an array like this: Array ( [0] => Array ( [id] => 68 [type] => onetype [type_id] => 131 [name] => name1 ) [1] => Array ( [id] => 32 [type] => anothertype [type_id] => 101 [name] => name2 ) ) I need to remove some arrays from it if the users has permissions or not to see that kind of type. I am thinking on doing it with a for each, and do the needed ifs inside it to remove or let it as it. My question is: What's the most efficent way to do this? The array will have no more than 100 records. But several users will request it and do the filtering over and over.

    Read the article

  • Domain redirection to port on Windows Server 2008

    - by Rauffle
    I have a Windows server running IIS. I wish to run a piece of software that hosts a web interface on a non-standard HTTP port (let's say, port 9999). I have static DNS entries on my router for two FQDNs, both of which direct to the Windows server. I wish to have requests to 'website1' to continue to go to the IIS website on port 80, but requests for 'website2' to instead go to port 9999 to be handled by the other application. How can I accomplish this? Right now I can get to the application by going to 'website1:9999' or 'website2:9999'.

    Read the article

  • serving a blog at domain.com/blog when dns for domain.com is pointing elsewhere

    - by user143715
    there is a blog hosted on one machine (apache) (currently at blog.domain.com) and we'd like to move it to domain.com/blog. dns for domain.com is pointed at an haproxy machine load balancing a few nginx app servers. the machine hosting the blog is not behind that load balancer. considering i have complete control over the configuration of everything, whats the most straightforward way to get this to submit to my will and have the blog served from domain.com/blog?

    Read the article

  • Allow different headers on different servers using WFF

    - by Brian
    We've got multiple web servers configured in a cluster using Microsoft's Web Farm Framework. One of the things I like to do to help debugging is to create a header in IIS that identifies the server that handled the request. Unfortunately when I try to do this, WFF sets the headers to the same value on all the servers. Is there a way around this? I tried looking into using skipDirectives, but I can't find any documentation on it (other than a little bit showing how to use it to skip directories and bindings). If there is documentation on this, please link to it! I would like to be able to read up more on it in case I need to do other things as well.

    Read the article

  • Piping perfmon logs over DFS

    - by Sal
    I'm running perfmon on several servers, and I'd like all of the output to be piped to one particular server. I'm trying to do this over DFS by modifying the Root directory arg on each of the servers and placing a DFS path like so: Root Directory: \\PERFMON_LOG_REPOSITORY\[MY_COMP_NAME] The trouble is that when I make the Root directory dump the logs to a file over DFS, I always get the following error upon starting up the Collector Set: when attempting to start the data collector set the following system error occurred: access is denied

    Read the article

  • What can impact the throughput rate at tcp or Os level?

    - by Jimm
    I am facing a problem, where running the same application on different servers, yields unexpected performance results. For example, running the application on a particular faster server (faster cpu, more memory), with no load, yields slower performance than running on a less powerful server on the same network. I am suspecting that either OS or TCP is causing the slowness on the faster server. I cannot use IPerf , unless i modify it, because the "performance" in my application is defined as Component A sends a message to Component B. Component B sends an ACK to component A and ONLY then Component A would send the next message. So it is different from what IPerf does, which to my knowledge, simply tries to push as many messages as possible. Is there a tool that can look at OS and TCP configuration and suggest the cause of slowness?

    Read the article

  • chkconfig creating service symlinks with the wrong order

    - by Robert
    On RHEL 6.3, I have a system service that should be starting after postgresql and httpd (order 64 and 85, respectively), but chkconfig always places it at order 50. I tried an experiment on a CentOS 6.0 virtual machine to make sure I understood the LSB stanza syntax. I created /etc/init.d/foo, owner root, permissions 755, with this text: ### BEGIN INIT INFO # Provides: foo # Required-Start: postgresql httpd # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Foo init script ### END INIT INFO And then ran chkconfig --add foo. Result: /etc/rc5.d/S86foo is created, as expected. (The other runlevels are also as expected.) I repeated the exact same experiment on the RHEL machine, and it created /etc/rc5.d/S50foo instead. I can't see anything different between the two that would lead to different results. Both machines have postgresql and httpd starting at the same orders and runlevels. Any thoughts? I could just use # chkconfig: 2345 86 50, or manually rename the service symlinks to the correct order, but I'm trying to document an install process for later users, and I want to know how to do it right and understand why it's not working as expected.

    Read the article

  • SPF record for Gmail?

    - by Chris
    I have DNS, with a SPF TXT record, configured for a domain name. The primary user of the domain name now needs to be able to send both from our SMTP servers, and also from her GMail account. I've seen all the information about adding "include:_spf.google.com" to the SPF TXT record, but, as I look into it, it appears that record is outdated. In particular, I had the user send me a test message, and note that it was: Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) However, _spf.google.com doesn't list that IP address: $ dig +short _spf.google.com txt "v=spf1 ip4:216.239.32.0/19 ip4:64.233.160.0/19 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:209.85.128.0/17 ip4:66.102.0.0/20 ip4:74.125.0.0/16 ip4:64.18.0.0/20 ip4:207.126.144.0/20 ip4:173.194.0.0/16 ?all" (Note that a 209.85.21*8*.0 network is listed, but not 209.85.21*5*.0.) Is there a better way to enable sending from GMail? This user sends to at least one recipient with a strict SPF policy that bounces mail not from a designated host... Many thanks!

    Read the article

  • Ubuntu 12 Server messing up my hard disk

    - by Jeroen Jacobs
    I'm installing Ubuntu server on a disk with 12GB available. During the setup, I choose the default LVM-based partition layout. However for some reason, Ubuntu decides that it only wants to use 4GB of this disk. How do I reclaim the remaining space of the hard disk? "lvextent" doesn't work btw... output of df -h: Filesystem Size Used Avail Use% Mounted on /dev/mapper/ubuntu-root 4.3G 3.4G 754M 82% / udev 3.9G 4.0K 3.9G 1% /dev tmpfs 1.6G 756K 1.6G 1% /run none 5.0M 0 5.0M 0% /run/lock none 3.9G 0 3.9G 0% /run/shm /dev/sda1 228M 25M 192M 12% /boot output of pvdisplay: --- Physical volume --- PV Name /dev/sda5 VG Name ubuntu PV Size 12.32 GiB / not usable 2.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 3154 Free PE 8 Allocated PE 3146 PV UUID dD06RZ-kGcL-1tTX-Ruds-XIDG-ssMd-FIUkzZ my partitions: Device Boot Start End Blocks Id System /dev/sda1 * 2048 499711 248832 83 Linux /dev/sda2 501758 26343423 12920833 5 Extended /dev/sda5 501760 26343423 12920832 8e Linux LVM when I try lvextent, it says there is not enough diskspace.

    Read the article

  • Apache2 Doesn't Serve Subdomain Alias

    - by Cyle Hunter
    I'm trying to prefix an existing Rails application with a sub-domain, essentially I want the sub-domain to serve the same application. Right now apache2 serves my application with "www.example.com" or "example.com". I adjusted my sites-available virtualhost in hopes of allowing for "foo.example.com" or "www.foo.example.com" however both instances are met with a domain not found error. Here is my current VirtualHost in /etc/apache2/sites-available/example.com: <VirtualHost *:80> ServerName example.com ServerAlias foo.example.com *.example.com www.foo.example.com www.example.com DocumentRoot /home/user/my_app/public <Directory /home/user/my_app/public> AllowOverride all Options -MultiViews </Directory> </VirtualHost> Any ideas? Note, I realized I probably don't need a wild card sub-domain for what I'm trying to do, I simply added that in as a last-ditch effort. Edit: The actual domain is virtualrobotgames.com with the desired subdomain being roboteer.virtualrobotgames.com

    Read the article

  • linux disk usage report inconsistancy after removing file. cpanel inaccurate disk usage report

    - by brando
    relevant software: Red Hat Enterprise Linux Server release 6.3 (Santiago) cpanel installed 11.34.0 (build 7) background and problem: I was getting a disk usage warning (via cpanel) because /var seemed to be filling up on my server. The assumption would be that there was a log file growing too large and filling up the partition. I recently removed a large log file and changed my syslog config to rotate the log files more regularly. I removed something like /var/log/somefile and edited /etc/rsyslog.conf. This is the reason I was suspicious of the disk usage report warning issued by cpanel that I was getting because it didn't seem right. This is what df was reporting for the partitions: $ [/var]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 9.9G 511M 8.9G 6% / tmpfs 5.9G 0 5.9G 0% /dev/shm /dev/sda1 99M 53M 42M 56% /boot /dev/sda8 883G 384G 455G 46% /home /dev/sdb1 9.9G 151M 9.3G 2% /tmp /dev/sda3 9.9G 7.8G 1.6G 84% /usr /dev/sda5 9.9G 9.3G 108M 99% /var This is what du was reporting for /var mount point: $ [/var]# du -sh 528M . clearly something funky was going on. I had a similar kind of reporting inconsistency in the past and I restarted the server and df reporting seemed to be correct after that. I decided to reboot the server to see if the same thing would happpen. This is what df reports now: $ [~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 9.9G 511M 8.9G 6% / tmpfs 5.9G 0 5.9G 0% /dev/shm /dev/sda1 99M 53M 42M 56% /boot /dev/sda8 883G 384G 455G 46% /home /dev/sdb1 9.9G 151M 9.3G 2% /tmp /dev/sda3 9.9G 7.8G 1.6G 84% /usr /dev/sda5 9.9G 697M 8.7G 8% /var This looks more like what I'd expect to get. For consistency this is what du reports for /var: $ [/var]# du -sh 638M . question: This is a nuisance. I'm not sure where the disk usage reports issued by cpanel get their info but it clearly isn't correct. How can I avoid this inaccurate reporting in the future? It seems like df reporting wrong disk usage is a strong indicator of the source problem but I'm not sure. Is there a way to 'refresh' the filesystem somehow so that the df report is accurate without restarting the server? Any other ideas for resolving this issue?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >