David Grey's Blog

Friends of Redgate logo

April 2008 - Posts

Vista SP1 installation failing with file permission errors

One of my colleagues asked me today if I had any experience of installing Service Pack 1 on a 64-bit Vista machine. He is having great difficulty getting it to install; about half-way through the process the installation fails with a file permissions error. He's tried several fixes listed on the Microsoft web site but to no avail.

I had to admit that I have no experience of the 64-bit version of SP1 as I don't actually own any 64-bit Vista machines. I did suggest that he might like to try my foolproof method of curing all manner of Vista ills and it worked, so he was very pleased.

What's my foolproof way of curing Vista problems? Simple - run chkdsk  and fix any errors it finds in the filesystem! I have noticed on a number of 32-bit machines that Vista is very bad for corrupting file information. I regularly encounter files that have no owners or ACL's associated with them, yet those files used to work fine. I don't know why it happens but maintaining file metadata integrity seems to be particularly problematic for Vista. Fortunately chkdsk cures the problem on almost every occasion so if you run into problems installing SP1 (or anything else for that matter) on Vista, you may wish to try this little trick first to see if it issues any problems caused by missing/incorrect file permissions.

del.ico.us del.ico.us | Digg It Digg It | Technorati Technorati | StumbleUpon StumbleUpon | Furl Furl | reddit reddit

We're not addicted - we can stop any time we like

In some ways the current strike at the Grangemouth Oil Refinery provides an interesting insight into how ordinary individuals will deal with peak oil and the future lack of oil supplies. The refinery is only scheduled to be shut for two days yet the public has engaged in a round of panic buying which has emptied petrol stations and required additional fuel to be shipped in from the continent and elsewhere in the UK.

The average car/van probably runs for the best part of a week between refills so the 2 day outage shouldn't really make that much of a difference to most people, yet it seems to have done. What are people going to do when there is no more oil to go round and no more fuel to ship in from elsewhere? Few people seem to be aware of the implications of peak oil; if this is the chaos that a two day shortage brings, imagine the civil disturbance when it oil does finally run out or becomes too expensive for the ordinary citizen to buy. We need to start facing up to such realities and looking for alternatives now whilst at the same time doing whatever we can to reduce our energy use to make existing supplies last longer until we have found the alternatives.

del.ico.us del.ico.us | Digg It Digg It | Technorati Technorati | StumbleUpon StumbleUpon | Furl Furl | reddit reddit

A Sad Loss

I was deeply saddened today to hear of the passing of Humphrey Lyttelton, renowned jazz trumpeter and broadcaster. I've spent many happy hours listening to Humph on the radio, primarily in his role as chairman of I'm Sorry I Haven't A Clue (the funniest programme on radio) but also his Radio 2 jazz programme. Listening to the radio will never be quite the sae again.

del.ico.us del.ico.us | Digg It Digg It | Technorati Technorati | StumbleUpon StumbleUpon | Furl Furl | reddit reddit

Posted: Apr 26 2008, 08:39 PM by David | with 1 comment(s)
Filed under:
Being Green is about taking responsibility

There's an interesting article by Dr Tom Crompton, change strategist for WWF-UK, on the BBC News website which argues that the time for small measures to help address climate change is over and the time for large-scale action is now overdue. It's a good article and I agree with the points he has to make.

There are also some interesting comments from other readers, including one who states

'Save the planet? Seriously? Stop being so arrogant. The planet will be fine. Humans may be in trouble, but the planet isn't. It's a selfish desire to save your home, so stop pretending to working towards something noble.'

This point is a valid one and one I've heard before. The planet was around long before human beings and will still be around long after the human species is extinct. But does this absolve us from worrying about climate change and the impact that we have on the planet? Absolutely not. Although humans may be the dominant species we share the planet with many other forms of life. If we mess up the environment through our actions and cause the human race to become extinct then that is our own fault. But if we do cause changes on such a scale we will undoubtedly take a large proportion of other species with us to oblivion.

We don't own the planet, we just happen to live here and have a duty of care to the other species that share the planet with us. Addressing climate change and other environmental issues is a social responsibility challenge. It is about accepting responsibility for our actions and the consequences they have on the world around us. Simply relying on the fact that the planet will outlive us is an abdication from personal responsibility and our duty of care. Yes, tackling such issues will make our lives and homes more secure but to suggest that this is the only concern of the environmental movement is missing the wider issues of our responsibilities as a species.

Cross-posted from http://www.codefounders.com/community/blogs/greenroads

del.ico.us del.ico.us | Digg It Digg It | Technorati Technorati | StumbleUpon StumbleUpon | Furl Furl | reddit reddit

Blogging on the move

Maybe it is the corollary of the old adage about work expanding to fill the time available but these days I seem to have less free time with each passing day. So I was intrigued to see that Richard at Black Marble has produced a Windows Mobile blogging tool which enables you to submit blog posts from your mobile phone. He was kind enough to give me a copy and it is brilliant! Sort of like a stripped down version of LiveWriter, it means I can now post to my blog in any spare minute from wherever I am.

It works really well, obviously - I wrote this post using it. It has full support for tagging and shows your most recent posts making mobile blog management a snip. I'm not sure what his plans are but I hope Richard releases it to the wider community in the future.

del.ico.us del.ico.us | Digg It Digg It | Technorati Technorati | StumbleUpon StumbleUpon | Furl Furl | reddit reddit

Posted: Apr 23 2008, 09:12 PM by David
Filed under: , ,
Getting into the Hive mind - IIS, Application Pools and Process Account Registry Access

I came across an interesting little issue the other day which I thought I'd share with you in case any of you experience a similar problem.

I was working with an ASP .NET application we have produced. For reasons that are too boring to explain the application has to asynchronously call out to an 3rd-party command line utility to perform some processing as part of its operations. I used the .NET Process type to execute the 3rd-party utility in a separate process.

When I built the application on my laptop and ran it under the Visual Studio development Web server everything worked as expected and the 3rd party utility was invoked correctly to do what it needed to do. However when I deployed the application to the staging server running IIS the 3rd-party application started correctly but then failed with an error code before it could complete its operation.

On the staging server the application pool for this application is configured to run under a specific domain account. I logged in to the staging server using this account and verified that I could run the utility correctly from the command line, which I could. Whilst I was still logged in with this account I tried accessing the ASP .NET application again and this time it worked correctly with the 3rd-party utility completed its processing without error.

It took me some time (and a lot of reading of Keith Brown's excellent The .NET Developers Guide to Windows Security book) to figure out what was going on. The fact that it worked when I was logged in with the application pool account made me suspect that it had something to do with the user profile for that account. After reading Keith's book I deduced that Windows does not load the user profile (HKEY_CURRENT_USER hive) for the user when it is impersonating an account and that IIS seems to use impersonation for an application pool account. This means that IIS does not cause the profile to be loaded for the account under which the application pool runs, probably as a performance optimisation. This is different to the behaviour of Windows services; when you configure a Windows service to run under a particular account context it does load the profile for that account.

When an application running in the application pool starts a new process it does so under the context of the application pool account which does not have a profile loaded. This was important in my case as it turns out that the 3rd-party application needs to read a registry key from the HKEY_CURRENT_USER hive to operate correctly, which requires the profile to be loaded.

So what's the solution? There is a Win32-API LoadUserProfile function which can be called to force a user profile to be loaded but since XP SP2/Server 2003 this function can only be called from an administrative account. Running my ASP .NET application under an administrative account was not an acceptable solution but there is a simple alternative. From reading Keith's book I found out that whenever any logon session causes a user profile to be loaded, that user profile becomes available to all other logon sessions on the machine. This means that a process started using impersonation can access the profile if another login session has caused the profile to be loaded. The way I achieved this was to write a Windows service which executes under the same account as the ASP .NET application and does nothing but periodically check to see if it needs to terminate. Simply running this service causes the profile to be loaded so that the 3rd-party utility will execute correctly when started by the ASP .NET application. I set the service to start automatically so that it should always be running when the server starts and, hey presto, the ASP .NET application know works correctly all the time.

del.ico.us del.ico.us | Digg It Digg It | Technorati Technorati | StumbleUpon StumbleUpon | Furl Furl | reddit reddit

One Step Closer to Zero

One of the personal desires I've harboured for some time is to reduce the carbon emissions from my home to as close to zero as I can possibly get them. I got another step closer to that goal today. After a couple of false starts due to documents going astray in the post I finally had cavity wall insulation installed. The installation only took about 2 hours and apart from the noise of the drilling there was very little disruption. The installers did an excellent job and left little mess and I'm now hoping that the extra insulation will help retain heat in the house so that we can reduce the amount of heating oil we burn. Based on my experience of the process I'd recommend it to anyone.

Ideally I'd like to get rid of our oil-fired boiler completely and I am working towards that goal too, but until then reducing the amount of oil we use will help lower our carbon emissions. We currently buy all our electricity from renewable sources and have solar hot-water heating installed so the oil used for heating remains our biggest household source of carbon emissions.

Cross-posted from http://www.codefounders.com/community/blogs/greenroads

del.ico.us del.ico.us | Digg It Digg It | Technorati Technorati | StumbleUpon StumbleUpon | Furl Furl | reddit reddit

How green is your business? Just look it up on the leaderboard!

It is always interesting to see another software vendor entering the power management space and I would encourage all IT users to use such applications as part of their strategy to minimise their CO2 emissions. So I was interested to see a post on the Green PC blog today reqarding new 'carbon control' software to be introduced by CCS, a software company from Scotland.

This new software achieves CO2 reductions by turning off computers when they are not being used and is thus a power management application similar to our own Powerdown product and a number of similar competing applications from other vendors. Where the CCS applications differs from existing power management applications is that it is backed by a social networking site. Information on how much a company has cut its carbon emissions is uploaded to this site and the site provides an at-a-glance view of which businesses are the most green.  A social networking site that compares CO2 savings and publicly names the greenest is an interesting idea but I wonder how many businesses will really be that willing to have their 'green ranking' displayed in this manner?

I would take exception to CCS' claim that their product was 'the only one specifically designed with carbon cuts in mind'. Our own offering, and I suspect those of some other vendors, were expressly designed for this purpose. However it is difficult to persuade customers to adopt such products purely on an environmental basis. An interesting article in this week's IT Week magazine ('Departments pass green buck', IT Week, 7 April 2008) notes that 'increasing awareness of green issues has yet to be translated into much action... where firms had made green moves, their main motivation often had little to do with the environment... these technologies make their business easier to run'. This certainly corresponds with our own experience which shows that it is easier to sell on the cost saving aspects of power management than the attendant CO2 reduction which will accrue from using it. This is why we why (and probably other vendors too) mainly focus on cost savings when marketing power management software and hope to achieve the environmental benefit as a happy side effect.

The same article discusses the results of a survey of a number of IT firms which found that only 21% of businesses had a formal green IT policy and only 8% had fully implemented this policy. Given this low take-up rate of green IT technologies it will be interesting to see how many firms are willing to expose their green credentials to scrutiny the social networking site envisaged by CCS.

del.ico.us del.ico.us | Digg It Digg It | Technorati Technorati | StumbleUpon StumbleUpon | Furl Furl | reddit reddit