I have a drive going bad in one of my servers. Well, in the jbox attached to it. It's part of a mirror so as long as the other half holds until the new drive gets here, this is the swap plan.
Physically swap the drives.
Use the prtvtoc -> fmthard trick to push the vtoc from the other drive to the new drive
metareplace -e d50 c2t2d0s0
And then wait for it to sync. I can use the vtoc from the other half of the mirror since they are identical so I don't have to do that before the physical swap.
--------------
Now here's another horrible problem I worked through with Al Marti yesterday.
I needed php5.3.6 compiled with pdo and the extensions for it built. I grabbed the latest sfw package and installed it, but it didn't have options for enabling pdo in the php.ini. Sure enough, taking a look at the compile line used for the package, it didn't have pdo enabled. That means I have to compile php. I hate compiling php.
Compiling php is an amazingly annoying process for me. It never goes right, and the things that fail are things that should be problems in a big popular package. For the versions of 5.2 that I worked with before, I had to edit the makefile after running configure but before running make because of a typo in the makefile that wasn't in the configure line.
For 5.3.6 I had to cross link a library into /usr/lib even though the configure found the right directory with the file in it during the exploration phase of configure. Anyway...once I got configure working I ran into a problem with the system being unable to find libfontconfig.la. Sure enough, I couldn't find it either. Googling around produced nothing useful for me. Happily while Al was here, he caught a small misunderstanding. I had thought that on SunFreeWare if there was not a specific version number listed for a dependency for a package, then any reasonably recent version of that package would work. I was wrong, so I had missed some of the dependencies because the newer versions of the packages had different libraries. So that solved the libfontconfig.la problem.
Now on to the horrible...
So I get php compiled. It's got pdo enabled in the build. I can confirm that. Still no extensions for it. Al is looking around, I'm looking around. My brain fails so I decide to take a short break and build the apc module. Al sees that and asks about it, and suddenly we wonder "Could the pdo extensions be a pear/pecl module, not something built with the software?" So we try it.
pecl install pdo
Pdo exists! It starts to build! Yay! It fails! Boo!
pecl install pdo_mysql
Exists! Fails!
So we go back to googling around. After quite a while we both find the same bit of information pretty much at the same time. It seems ridiculous. Surely this isn't a reasonable solution just to get a module to build from a well known well used software package. But no...it is. We have to modify the code of the php package in order to get it to work.
From http://pecl.php.net/bugs/bug.php?id=18837
// /usr/include/php5/Zend/zend.h:320 add lines
#define refcount refcount__gc
#define is_ref is_ref__gc
// /usr/include/php5/Zend/zend_API.h:52 add lines
#define object_pp object_ptr
Completely ridiculous, but it works. The pdo package builds.
Now onto getting pdo_mysql to build. It fails because it can't find mysql_config. It finds the directory in which mysql_config exists, but fails to find the file. The file is right there. Baffling! More googling around turns up other people with the same problem but not a lot of solutions until we find this:
http://www.spiration.co.uk/post/1332/install%20PDO_MYSQL%20-%20mysql_config%20and%20header%20files%20problem
Which tells us to create a link from where it exists to another place, and the build will find it. Even though it's already finding the correct directory. Is that reasonable? NO! But we can't find anything else, so we try it. Sure enough...it works.
ln -s /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config
Absolute madness. I hate building php. I really do. So far with us trying to use drupal I've been able to use a pre-built package successfully exactly once on 3 brand new machines when the installed version of php for Solaris was the newest, and we hadn't yet moved on to the newest version of drupal.
Showing posts with label solaris 10. Show all posts
Showing posts with label solaris 10. Show all posts
Friday, May 13, 2011
Thursday, August 5, 2010
adding an application to smf in solaris 10
create the method file in /lib/svc/method, usually easiest to find something close to the app you're installing and modify the file. For example apache2 comes installed, but I put the latest version in /usr/local/apache2 so I just use the files that are already there with path modifications.
Then you need to add a manifest. Those are stored in /var/svc/manifest and usually if you're adding your own you would put it in the /var/svc/manifest/site directory (or so I've heard). Again the best way is to get one that is close and modify it or use it as a template. I've found that the one installed with the system works just fine with an upgraded version of apache in /usr/local/apache2 but best to check to be sure.
Then you import it:
svccfg -v import /var/svc/manifest/site/http-apache2.xml
Then the normal SMF controls should work for it.
Then you need to add a manifest. Those are stored in /var/svc/manifest and usually if you're adding your own you would put it in the /var/svc/manifest/site directory (or so I've heard). Again the best way is to get one that is close and modify it or use it as a template. I've found that the one installed with the system works just fine with an upgraded version of apache in /usr/local/apache2 but best to check to be sure.
Then you import it:
svccfg -v import /var/svc/manifest/site/http-apache2.xml
Then the normal SMF controls should work for it.
Tuesday, April 20, 2010
save or copy vtoc on solaris 10
To capture it to a file:
prtvtoc /dev/rdsk/c#t#d#s2 > out
To use it to format another disk:
prtvtoc /dev/rdsk/c#t#d#s2 | fmthard -s - /dev/rdsk/c#t#d#s2
This comes up because I had a drive get wiped and need to fix the partitioning before I could restore the backup. So now I run a script weekly that keeps the vtoc in a directory and also mails it to me so I have it stored elsewhere. Very convenient in really horrible situations. But also convenient if you need to create a mirror of a drive you've already created.
prtvtoc /dev/rdsk/c#t#d#s2 > out
To use it to format another disk:
prtvtoc /dev/rdsk/c#t#d#s2 | fmthard -s - /dev/rdsk/c#t#d#s2
This comes up because I had a drive get wiped and need to fix the partitioning before I could restore the backup. So now I run a script weekly that keeps the vtoc in a directory and also mails it to me so I have it stored elsewhere. Very convenient in really horrible situations. But also convenient if you need to create a mirror of a drive you've already created.
Tuesday, April 6, 2010
Some more random solaris/unix/geek stuff
Latest OS update: http://www.sun.com/software/solaris/get.jsp
Sun contract info:
go to http://ibis.sun.com/support and login
click on Account
Do a blank search
NetBackup client install (need win32 base and to untar packages)
first install base
then install the updates
ILOM
serial connect
cd /SP/network
then set pending properties to how you want them, then set commitpending
= true and it'll set the properties
set pendingipdiscovery=static
set other "pending" properties
then cd to other SP services and enable the ones you want
set ilom password
backup speed
put 65536 in /usr/openv/netbackup/net_buffer_sz
adjust /usr/openv/netbackup/SIZE_DATA_BUFFER and NUMBER_DATA_BUFFERS
package updater for RHEL 5.4 (Red hat enterprise linux) is pup. Seems to work pretty well.
Sun contract info:
go to http://ibis.sun.com/support and login
click on Account
Do a blank search
NetBackup client install (need win32 base and to untar packages)
first install base
then install the updates
ILOM
serial connect
cd /SP/network
then set pending properties to how you want them, then set commitpending
= true and it'll set the properties
set pendingipdiscovery=static
set other "pending" properties
then cd to other SP services and enable the ones you want
set ilom password
backup speed
put 65536 in /usr/openv/netbackup/net_buffer_sz
adjust /usr/openv/netbackup/SIZE_DATA_BUFFER and NUMBER_DATA_BUFFERS
package updater for RHEL 5.4 (Red hat enterprise linux) is pup. Seems to work pretty well.
Sunday, September 7, 2008
Solaris 10 restore
Here's one that surprised me quite a bit. I had a server that was toast and had to burn it down and rebuild it. The first restore I did wasn't set up right, but I didn't know that at the time. When the server eventually came up, it seemed to work just fine. It's an all in one server so it does apache, coldfusion, mysql, dns, sendmail, and some other apps. All of those appeared to be functioning correctly, so I went on to work on other stuff that was switched as part of the disaster recovery plan. Then I went to check something on the production server and found that in the local zone running the webserver and most of the rest of the stuff, I was missing some pretty seriously important and low level commands from the OS. Things like vi, touch, uptime, and a bunch of others. Baffling. Most baffling for me was how it was running at all with so many low level OS bits missing.
Turns out with netbackup I needed to check "overwrite files" and "rename hard links" but not the softlinks. The hard links hadn't been checked the first time through, so it didn't restore any of the hard link files. Or at least, thats the nearest explanation I can come up with, because checking that and redoing the restore (which was a nightmare in its own right that I'll write up later) seems to have fixed everything just fine.
Turns out with netbackup I needed to check "overwrite files" and "rename hard links" but not the softlinks. The hard links hadn't been checked the first time through, so it didn't restore any of the hard link files. Or at least, thats the nearest explanation I can come up with, because checking that and redoing the restore (which was a nightmare in its own right that I'll write up later) seems to have fixed everything just fine.
Subscribe to:
Posts (Atom)
